Commit f720e3ba authored by Dave Kleikamp's avatar Dave Kleikamp

JFS: Whitespace cleanup and remove some dead code

Signed-off-by: default avatarDave Kleikamp <shaggy@linux.vnet.ibm.com>
parent 5ecd3100
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
__u32 __x = (x); \ __u32 __x = (x); \
((__u32)( \ ((__u32)( \
((__x & (__u32)0x000000ffUL) << 16) | \ ((__x & (__u32)0x000000ffUL) << 16) | \
(__x & (__u32)0x0000ff00UL) | \ (__x & (__u32)0x0000ff00UL) | \
((__x & (__u32)0x00ff0000UL) >> 16) )); \ ((__x & (__u32)0x00ff0000UL) >> 16) )); \
}) })
......
...@@ -19,23 +19,23 @@ ...@@ -19,23 +19,23 @@
#define _H_JFS_DINODE #define _H_JFS_DINODE
/* /*
* jfs_dinode.h: on-disk inode manager * jfs_dinode.h: on-disk inode manager
*/ */
#define INODESLOTSIZE 128 #define INODESLOTSIZE 128
#define L2INODESLOTSIZE 7 #define L2INODESLOTSIZE 7
#define log2INODESIZE 9 /* log2(bytes per dinode) */ #define log2INODESIZE 9 /* log2(bytes per dinode) */
/* /*
* on-disk inode : 512 bytes * on-disk inode : 512 bytes
* *
* note: align 64-bit fields on 8-byte boundary. * note: align 64-bit fields on 8-byte boundary.
*/ */
struct dinode { struct dinode {
/* /*
* I. base area (128 bytes) * I. base area (128 bytes)
* ------------------------ * ------------------------
* *
* define generic/POSIX attributes * define generic/POSIX attributes
*/ */
...@@ -70,16 +70,16 @@ struct dinode { ...@@ -70,16 +70,16 @@ struct dinode {
__le32 di_acltype; /* 4: Type of ACL */ __le32 di_acltype; /* 4: Type of ACL */
/* /*
* Extension Areas. * Extension Areas.
* *
* Historically, the inode was partitioned into 4 128-byte areas, * Historically, the inode was partitioned into 4 128-byte areas,
* the last 3 being defined as unions which could have multiple * the last 3 being defined as unions which could have multiple
* uses. The first 96 bytes had been completely unused until * uses. The first 96 bytes had been completely unused until
* an index table was added to the directory. It is now more * an index table was added to the directory. It is now more
* useful to describe the last 3/4 of the inode as a single * useful to describe the last 3/4 of the inode as a single
* union. We would probably be better off redesigning the * union. We would probably be better off redesigning the
* entire structure from scratch, but we don't want to break * entire structure from scratch, but we don't want to break
* commonality with OS/2's JFS at this time. * commonality with OS/2's JFS at this time.
*/ */
union { union {
struct { struct {
...@@ -95,7 +95,7 @@ struct dinode { ...@@ -95,7 +95,7 @@ struct dinode {
} _dir; /* (384) */ } _dir; /* (384) */
#define di_dirtable u._dir._table #define di_dirtable u._dir._table
#define di_dtroot u._dir._dtroot #define di_dtroot u._dir._dtroot
#define di_parent di_dtroot.header.idotdot #define di_parent di_dtroot.header.idotdot
#define di_DASD di_dtroot.header.DASD #define di_DASD di_dtroot.header.DASD
struct { struct {
...@@ -127,14 +127,14 @@ struct dinode { ...@@ -127,14 +127,14 @@ struct dinode {
#define di_inlinedata u._file._u2._special._u #define di_inlinedata u._file._u2._special._u
#define di_rdev u._file._u2._special._u._rdev #define di_rdev u._file._u2._special._u._rdev
#define di_fastsymlink u._file._u2._special._u._fastsymlink #define di_fastsymlink u._file._u2._special._u._fastsymlink
#define di_inlineea u._file._u2._special._inlineea #define di_inlineea u._file._u2._special._inlineea
} u; } u;
}; };
/* extended mode bits (on-disk inode di_mode) */ /* extended mode bits (on-disk inode di_mode) */
#define IFJOURNAL 0x00010000 /* journalled file */ #define IFJOURNAL 0x00010000 /* journalled file */
#define ISPARSE 0x00020000 /* sparse file enabled */ #define ISPARSE 0x00020000 /* sparse file enabled */
#define INLINEEA 0x00040000 /* inline EA area free */ #define INLINEEA 0x00040000 /* inline EA area free */
#define ISWAPFILE 0x00800000 /* file open for pager swap space */ #define ISWAPFILE 0x00800000 /* file open for pager swap space */
/* more extended mode bits: attributes for OS/2 */ /* more extended mode bits: attributes for OS/2 */
......
This diff is collapsed.
...@@ -83,7 +83,7 @@ static __inline signed char TREEMAX(signed char *cp) ...@@ -83,7 +83,7 @@ static __inline signed char TREEMAX(signed char *cp)
* - 1 is added to account for the control page of the map. * - 1 is added to account for the control page of the map.
*/ */
#define BLKTODMAP(b,s) \ #define BLKTODMAP(b,s) \
((((b) >> 13) + ((b) >> 23) + ((b) >> 33) + 3 + 1) << (s)) ((((b) >> 13) + ((b) >> 23) + ((b) >> 33) + 3 + 1) << (s))
/* /*
* convert disk block number to the logical block number of the LEVEL 0 * convert disk block number to the logical block number of the LEVEL 0
...@@ -98,7 +98,7 @@ static __inline signed char TREEMAX(signed char *cp) ...@@ -98,7 +98,7 @@ static __inline signed char TREEMAX(signed char *cp)
* - 1 is added to account for the control page of the map. * - 1 is added to account for the control page of the map.
*/ */
#define BLKTOL0(b,s) \ #define BLKTOL0(b,s) \
(((((b) >> 23) << 10) + ((b) >> 23) + ((b) >> 33) + 2 + 1) << (s)) (((((b) >> 23) << 10) + ((b) >> 23) + ((b) >> 33) + 2 + 1) << (s))
/* /*
* convert disk block number to the logical block number of the LEVEL 1 * convert disk block number to the logical block number of the LEVEL 1
...@@ -120,7 +120,7 @@ static __inline signed char TREEMAX(signed char *cp) ...@@ -120,7 +120,7 @@ static __inline signed char TREEMAX(signed char *cp)
* at the specified level which describes the disk block. * at the specified level which describes the disk block.
*/ */
#define BLKTOCTL(b,s,l) \ #define BLKTOCTL(b,s,l) \
(((l) == 2) ? 1 : ((l) == 1) ? BLKTOL1((b),(s)) : BLKTOL0((b),(s))) (((l) == 2) ? 1 : ((l) == 1) ? BLKTOL1((b),(s)) : BLKTOL0((b),(s)))
/* /*
* convert aggregate map size to the zero origin dmapctl level of the * convert aggregate map size to the zero origin dmapctl level of the
...@@ -145,27 +145,27 @@ static __inline signed char TREEMAX(signed char *cp) ...@@ -145,27 +145,27 @@ static __inline signed char TREEMAX(signed char *cp)
* dmaptree must be consistent with dmapctl. * dmaptree must be consistent with dmapctl.
*/ */
struct dmaptree { struct dmaptree {
__le32 nleafs; /* 4: number of tree leafs */ __le32 nleafs; /* 4: number of tree leafs */
__le32 l2nleafs; /* 4: l2 number of tree leafs */ __le32 l2nleafs; /* 4: l2 number of tree leafs */
__le32 leafidx; /* 4: index of first tree leaf */ __le32 leafidx; /* 4: index of first tree leaf */
__le32 height; /* 4: height of the tree */ __le32 height; /* 4: height of the tree */
s8 budmin; /* 1: min l2 tree leaf value to combine */ s8 budmin; /* 1: min l2 tree leaf value to combine */
s8 stree[TREESIZE]; /* TREESIZE: tree */ s8 stree[TREESIZE]; /* TREESIZE: tree */
u8 pad[2]; /* 2: pad to word boundary */ u8 pad[2]; /* 2: pad to word boundary */
}; /* - 360 - */ }; /* - 360 - */
/* /*
* dmap page per 8K blocks bitmap * dmap page per 8K blocks bitmap
*/ */
struct dmap { struct dmap {
__le32 nblocks; /* 4: num blks covered by this dmap */ __le32 nblocks; /* 4: num blks covered by this dmap */
__le32 nfree; /* 4: num of free blks in this dmap */ __le32 nfree; /* 4: num of free blks in this dmap */
__le64 start; /* 8: starting blkno for this dmap */ __le64 start; /* 8: starting blkno for this dmap */
struct dmaptree tree; /* 360: dmap tree */ struct dmaptree tree; /* 360: dmap tree */
u8 pad[1672]; /* 1672: pad to 2048 bytes */ u8 pad[1672]; /* 1672: pad to 2048 bytes */
__le32 wmap[LPERDMAP]; /* 1024: bits of the working map */ __le32 wmap[LPERDMAP]; /* 1024: bits of the working map */
__le32 pmap[LPERDMAP]; /* 1024: bits of the persistent map */ __le32 pmap[LPERDMAP]; /* 1024: bits of the persistent map */
}; /* - 4096 - */ }; /* - 4096 - */
/* /*
* disk map control page per level. * disk map control page per level.
...@@ -173,14 +173,14 @@ struct dmap { ...@@ -173,14 +173,14 @@ struct dmap {
* dmapctl must be consistent with dmaptree. * dmapctl must be consistent with dmaptree.
*/ */
struct dmapctl { struct dmapctl {
__le32 nleafs; /* 4: number of tree leafs */ __le32 nleafs; /* 4: number of tree leafs */
__le32 l2nleafs; /* 4: l2 number of tree leafs */ __le32 l2nleafs; /* 4: l2 number of tree leafs */
__le32 leafidx; /* 4: index of the first tree leaf */ __le32 leafidx; /* 4: index of the first tree leaf */
__le32 height; /* 4: height of tree */ __le32 height; /* 4: height of tree */
s8 budmin; /* 1: minimum l2 tree leaf value */ s8 budmin; /* 1: minimum l2 tree leaf value */
s8 stree[CTLTREESIZE]; /* CTLTREESIZE: dmapctl tree */ s8 stree[CTLTREESIZE]; /* CTLTREESIZE: dmapctl tree */
u8 pad[2714]; /* 2714: pad to 4096 */ u8 pad[2714]; /* 2714: pad to 4096 */
}; /* - 4096 - */ }; /* - 4096 - */
/* /*
* common definition for dmaptree within dmap and dmapctl * common definition for dmaptree within dmap and dmapctl
...@@ -202,41 +202,41 @@ typedef union dmtree { ...@@ -202,41 +202,41 @@ typedef union dmtree {
* on-disk aggregate disk allocation map descriptor. * on-disk aggregate disk allocation map descriptor.
*/ */
struct dbmap_disk { struct dbmap_disk {
__le64 dn_mapsize; /* 8: number of blocks in aggregate */ __le64 dn_mapsize; /* 8: number of blocks in aggregate */
__le64 dn_nfree; /* 8: num free blks in aggregate map */ __le64 dn_nfree; /* 8: num free blks in aggregate map */
__le32 dn_l2nbperpage; /* 4: number of blks per page */ __le32 dn_l2nbperpage; /* 4: number of blks per page */
__le32 dn_numag; /* 4: total number of ags */ __le32 dn_numag; /* 4: total number of ags */
__le32 dn_maxlevel; /* 4: number of active ags */ __le32 dn_maxlevel; /* 4: number of active ags */
__le32 dn_maxag; /* 4: max active alloc group number */ __le32 dn_maxag; /* 4: max active alloc group number */
__le32 dn_agpref; /* 4: preferred alloc group (hint) */ __le32 dn_agpref; /* 4: preferred alloc group (hint) */
__le32 dn_aglevel; /* 4: dmapctl level holding the AG */ __le32 dn_aglevel; /* 4: dmapctl level holding the AG */
__le32 dn_agheigth; /* 4: height in dmapctl of the AG */ __le32 dn_agheigth; /* 4: height in dmapctl of the AG */
__le32 dn_agwidth; /* 4: width in dmapctl of the AG */ __le32 dn_agwidth; /* 4: width in dmapctl of the AG */
__le32 dn_agstart; /* 4: start tree index at AG height */ __le32 dn_agstart; /* 4: start tree index at AG height */
__le32 dn_agl2size; /* 4: l2 num of blks per alloc group */ __le32 dn_agl2size; /* 4: l2 num of blks per alloc group */
__le64 dn_agfree[MAXAG];/* 8*MAXAG: per AG free count */ __le64 dn_agfree[MAXAG];/* 8*MAXAG: per AG free count */
__le64 dn_agsize; /* 8: num of blks per alloc group */ __le64 dn_agsize; /* 8: num of blks per alloc group */
s8 dn_maxfreebud; /* 1: max free buddy system */ s8 dn_maxfreebud; /* 1: max free buddy system */
u8 pad[3007]; /* 3007: pad to 4096 */ u8 pad[3007]; /* 3007: pad to 4096 */
}; /* - 4096 - */ }; /* - 4096 - */
struct dbmap { struct dbmap {
s64 dn_mapsize; /* number of blocks in aggregate */ s64 dn_mapsize; /* number of blocks in aggregate */
s64 dn_nfree; /* num free blks in aggregate map */ s64 dn_nfree; /* num free blks in aggregate map */
int dn_l2nbperpage; /* number of blks per page */ int dn_l2nbperpage; /* number of blks per page */
int dn_numag; /* total number of ags */ int dn_numag; /* total number of ags */
int dn_maxlevel; /* number of active ags */ int dn_maxlevel; /* number of active ags */
int dn_maxag; /* max active alloc group number */ int dn_maxag; /* max active alloc group number */
int dn_agpref; /* preferred alloc group (hint) */ int dn_agpref; /* preferred alloc group (hint) */
int dn_aglevel; /* dmapctl level holding the AG */ int dn_aglevel; /* dmapctl level holding the AG */
int dn_agheigth; /* height in dmapctl of the AG */ int dn_agheigth; /* height in dmapctl of the AG */
int dn_agwidth; /* width in dmapctl of the AG */ int dn_agwidth; /* width in dmapctl of the AG */
int dn_agstart; /* start tree index at AG height */ int dn_agstart; /* start tree index at AG height */
int dn_agl2size; /* l2 num of blks per alloc group */ int dn_agl2size; /* l2 num of blks per alloc group */
s64 dn_agfree[MAXAG]; /* per AG free count */ s64 dn_agfree[MAXAG]; /* per AG free count */
s64 dn_agsize; /* num of blks per alloc group */ s64 dn_agsize; /* num of blks per alloc group */
signed char dn_maxfreebud; /* max free buddy system */ signed char dn_maxfreebud; /* max free buddy system */
}; /* - 4096 - */ }; /* - 4096 - */
/* /*
* in-memory aggregate disk allocation map descriptor. * in-memory aggregate disk allocation map descriptor.
*/ */
......
This diff is collapsed.
...@@ -35,7 +35,7 @@ typedef union { ...@@ -35,7 +35,7 @@ typedef union {
/* /*
* entry segment/slot * entry segment/slot
* *
* an entry consists of type dependent head/only segment/slot and * an entry consists of type dependent head/only segment/slot and
* additional segments/slots linked vi next field; * additional segments/slots linked vi next field;
......
...@@ -34,8 +34,8 @@ static int extBrealloc(struct inode *, s64, s64, s64 *, s64 *); ...@@ -34,8 +34,8 @@ static int extBrealloc(struct inode *, s64, s64, s64 *, s64 *);
#endif #endif
static s64 extRoundDown(s64 nb); static s64 extRoundDown(s64 nb);
#define DPD(a) (printk("(a): %d\n",(a))) #define DPD(a) (printk("(a): %d\n",(a)))
#define DPC(a) (printk("(a): %c\n",(a))) #define DPC(a) (printk("(a): %c\n",(a)))
#define DPL1(a) \ #define DPL1(a) \
{ \ { \
if ((a) >> 32) \ if ((a) >> 32) \
...@@ -51,19 +51,19 @@ static s64 extRoundDown(s64 nb); ...@@ -51,19 +51,19 @@ static s64 extRoundDown(s64 nb);
printk("(a): %x\n",(a) << 32); \ printk("(a): %x\n",(a) << 32); \
} }
#define DPD1(a) (printk("(a): %d ",(a))) #define DPD1(a) (printk("(a): %d ",(a)))
#define DPX(a) (printk("(a): %08x\n",(a))) #define DPX(a) (printk("(a): %08x\n",(a)))
#define DPX1(a) (printk("(a): %08x ",(a))) #define DPX1(a) (printk("(a): %08x ",(a)))
#define DPS(a) (printk("%s\n",(a))) #define DPS(a) (printk("%s\n",(a)))
#define DPE(a) (printk("\nENTERING: %s\n",(a))) #define DPE(a) (printk("\nENTERING: %s\n",(a)))
#define DPE1(a) (printk("\nENTERING: %s",(a))) #define DPE1(a) (printk("\nENTERING: %s",(a)))
#define DPS1(a) (printk(" %s ",(a))) #define DPS1(a) (printk(" %s ",(a)))
/* /*
* NAME: extAlloc() * NAME: extAlloc()
* *
* FUNCTION: allocate an extent for a specified page range within a * FUNCTION: allocate an extent for a specified page range within a
* file. * file.
* *
* PARAMETERS: * PARAMETERS:
...@@ -78,9 +78,9 @@ static s64 extRoundDown(s64 nb); ...@@ -78,9 +78,9 @@ static s64 extRoundDown(s64 nb);
* should be marked as allocated but not recorded. * should be marked as allocated but not recorded.
* *
* RETURN VALUES: * RETURN VALUES:
* 0 - success * 0 - success
* -EIO - i/o error. * -EIO - i/o error.
* -ENOSPC - insufficient disk resources. * -ENOSPC - insufficient disk resources.
*/ */
int int
extAlloc(struct inode *ip, s64 xlen, s64 pno, xad_t * xp, bool abnr) extAlloc(struct inode *ip, s64 xlen, s64 pno, xad_t * xp, bool abnr)
...@@ -192,9 +192,9 @@ extAlloc(struct inode *ip, s64 xlen, s64 pno, xad_t * xp, bool abnr) ...@@ -192,9 +192,9 @@ extAlloc(struct inode *ip, s64 xlen, s64 pno, xad_t * xp, bool abnr)
#ifdef _NOTYET #ifdef _NOTYET
/* /*
* NAME: extRealloc() * NAME: extRealloc()
* *
* FUNCTION: extend the allocation of a file extent containing a * FUNCTION: extend the allocation of a file extent containing a
* partial back last page. * partial back last page.
* *
* PARAMETERS: * PARAMETERS:
...@@ -207,9 +207,9 @@ extAlloc(struct inode *ip, s64 xlen, s64 pno, xad_t * xp, bool abnr) ...@@ -207,9 +207,9 @@ extAlloc(struct inode *ip, s64 xlen, s64 pno, xad_t * xp, bool abnr)
* should be marked as allocated but not recorded. * should be marked as allocated but not recorded.
* *
* RETURN VALUES: * RETURN VALUES:
* 0 - success * 0 - success
* -EIO - i/o error. * -EIO - i/o error.
* -ENOSPC - insufficient disk resources. * -ENOSPC - insufficient disk resources.
*/ */
int extRealloc(struct inode *ip, s64 nxlen, xad_t * xp, bool abnr) int extRealloc(struct inode *ip, s64 nxlen, xad_t * xp, bool abnr)
{ {
...@@ -345,9 +345,9 @@ int extRealloc(struct inode *ip, s64 nxlen, xad_t * xp, bool abnr) ...@@ -345,9 +345,9 @@ int extRealloc(struct inode *ip, s64 nxlen, xad_t * xp, bool abnr)
/* /*
* NAME: extHint() * NAME: extHint()
* *
* FUNCTION: produce an extent allocation hint for a file offset. * FUNCTION: produce an extent allocation hint for a file offset.
* *
* PARAMETERS: * PARAMETERS:
* ip - the inode of the file. * ip - the inode of the file.
...@@ -356,8 +356,8 @@ int extRealloc(struct inode *ip, s64 nxlen, xad_t * xp, bool abnr) ...@@ -356,8 +356,8 @@ int extRealloc(struct inode *ip, s64 nxlen, xad_t * xp, bool abnr)
* the hint. * the hint.
* *
* RETURN VALUES: * RETURN VALUES:
* 0 - success * 0 - success
* -EIO - i/o error. * -EIO - i/o error.
*/ */
int extHint(struct inode *ip, s64 offset, xad_t * xp) int extHint(struct inode *ip, s64 offset, xad_t * xp)
{ {
...@@ -387,7 +387,7 @@ int extHint(struct inode *ip, s64 offset, xad_t * xp) ...@@ -387,7 +387,7 @@ int extHint(struct inode *ip, s64 offset, xad_t * xp)
lxdl.nlxd = 1; lxdl.nlxd = 1;
lxdl.lxd = &lxd; lxdl.lxd = &lxd;
LXDoffset(&lxd, prev) LXDoffset(&lxd, prev)
LXDlength(&lxd, nbperpage); LXDlength(&lxd, nbperpage);
xadl.maxnxad = 1; xadl.maxnxad = 1;
xadl.nxad = 0; xadl.nxad = 0;
...@@ -397,11 +397,11 @@ int extHint(struct inode *ip, s64 offset, xad_t * xp) ...@@ -397,11 +397,11 @@ int extHint(struct inode *ip, s64 offset, xad_t * xp)
if ((rc = xtLookupList(ip, &lxdl, &xadl, 0))) if ((rc = xtLookupList(ip, &lxdl, &xadl, 0)))
return (rc); return (rc);
/* check if not extent exists for the previous page. /* check if no extent exists for the previous page.
* this is possible for sparse files. * this is possible for sparse files.
*/ */
if (xadl.nxad == 0) { if (xadl.nxad == 0) {
// assert(ISSPARSE(ip)); // assert(ISSPARSE(ip));
return (0); return (0);
} }
...@@ -410,28 +410,28 @@ int extHint(struct inode *ip, s64 offset, xad_t * xp) ...@@ -410,28 +410,28 @@ int extHint(struct inode *ip, s64 offset, xad_t * xp)
*/ */
xp->flag &= XAD_NOTRECORDED; xp->flag &= XAD_NOTRECORDED;
if(xadl.nxad != 1 || lengthXAD(xp) != nbperpage) { if(xadl.nxad != 1 || lengthXAD(xp) != nbperpage) {
jfs_error(ip->i_sb, "extHint: corrupt xtree"); jfs_error(ip->i_sb, "extHint: corrupt xtree");
return -EIO; return -EIO;
} }
return (0); return (0);
} }
/* /*
* NAME: extRecord() * NAME: extRecord()
* *
* FUNCTION: change a page with a file from not recorded to recorded. * FUNCTION: change a page with a file from not recorded to recorded.
* *
* PARAMETERS: * PARAMETERS:
* ip - inode of the file. * ip - inode of the file.
* cp - cbuf of the file page. * cp - cbuf of the file page.
* *
* RETURN VALUES: * RETURN VALUES:
* 0 - success * 0 - success
* -EIO - i/o error. * -EIO - i/o error.
* -ENOSPC - insufficient disk resources. * -ENOSPC - insufficient disk resources.
*/ */
int extRecord(struct inode *ip, xad_t * xp) int extRecord(struct inode *ip, xad_t * xp)
{ {
...@@ -451,9 +451,9 @@ int extRecord(struct inode *ip, xad_t * xp) ...@@ -451,9 +451,9 @@ int extRecord(struct inode *ip, xad_t * xp)
#ifdef _NOTYET #ifdef _NOTYET
/* /*
* NAME: extFill() * NAME: extFill()
* *
* FUNCTION: allocate disk space for a file page that represents * FUNCTION: allocate disk space for a file page that represents
* a file hole. * a file hole.
* *
* PARAMETERS: * PARAMETERS:
...@@ -461,16 +461,16 @@ int extRecord(struct inode *ip, xad_t * xp) ...@@ -461,16 +461,16 @@ int extRecord(struct inode *ip, xad_t * xp)
* cp - cbuf of the file page represent the hole. * cp - cbuf of the file page represent the hole.
* *
* RETURN VALUES: * RETURN VALUES:
* 0 - success * 0 - success
* -EIO - i/o error. * -EIO - i/o error.
* -ENOSPC - insufficient disk resources. * -ENOSPC - insufficient disk resources.
*/ */
int extFill(struct inode *ip, xad_t * xp) int extFill(struct inode *ip, xad_t * xp)
{ {
int rc, nbperpage = JFS_SBI(ip->i_sb)->nbperpage; int rc, nbperpage = JFS_SBI(ip->i_sb)->nbperpage;
s64 blkno = offsetXAD(xp) >> ip->i_blkbits; s64 blkno = offsetXAD(xp) >> ip->i_blkbits;
// assert(ISSPARSE(ip)); // assert(ISSPARSE(ip));
/* initialize the extent allocation hint */ /* initialize the extent allocation hint */
XADaddress(xp, 0); XADaddress(xp, 0);
...@@ -489,7 +489,7 @@ int extFill(struct inode *ip, xad_t * xp) ...@@ -489,7 +489,7 @@ int extFill(struct inode *ip, xad_t * xp)
/* /*
* NAME: extBalloc() * NAME: extBalloc()
* *
* FUNCTION: allocate disk blocks to form an extent. * FUNCTION: allocate disk blocks to form an extent.
* *
* initially, we will try to allocate disk blocks for the * initially, we will try to allocate disk blocks for the
* requested size (nblocks). if this fails (nblocks * requested size (nblocks). if this fails (nblocks
...@@ -513,9 +513,9 @@ int extFill(struct inode *ip, xad_t * xp) ...@@ -513,9 +513,9 @@ int extFill(struct inode *ip, xad_t * xp)
* allocated block range. * allocated block range.
* *
* RETURN VALUES: * RETURN VALUES:
* 0 - success * 0 - success
* -EIO - i/o error. * -EIO - i/o error.
* -ENOSPC - insufficient disk resources. * -ENOSPC - insufficient disk resources.
*/ */
static int static int
extBalloc(struct inode *ip, s64 hint, s64 * nblocks, s64 * blkno) extBalloc(struct inode *ip, s64 hint, s64 * nblocks, s64 * blkno)
...@@ -580,7 +580,7 @@ extBalloc(struct inode *ip, s64 hint, s64 * nblocks, s64 * blkno) ...@@ -580,7 +580,7 @@ extBalloc(struct inode *ip, s64 hint, s64 * nblocks, s64 * blkno)
/* /*
* NAME: extBrealloc() * NAME: extBrealloc()
* *
* FUNCTION: attempt to extend an extent's allocation. * FUNCTION: attempt to extend an extent's allocation.
* *
* Initially, we will try to extend the extent's allocation * Initially, we will try to extend the extent's allocation
* in place. If this fails, we'll try to move the extent * in place. If this fails, we'll try to move the extent
...@@ -597,8 +597,8 @@ extBalloc(struct inode *ip, s64 hint, s64 * nblocks, s64 * blkno) ...@@ -597,8 +597,8 @@ extBalloc(struct inode *ip, s64 hint, s64 * nblocks, s64 * blkno)
* *
* PARAMETERS: * PARAMETERS:
* ip - the inode of the file. * ip - the inode of the file.
* blkno - starting block number of the extents current allocation. * blkno - starting block number of the extents current allocation.
* nblks - number of blocks within the extents current allocation. * nblks - number of blocks within the extents current allocation.
* newnblks - pointer to a s64 value. on entry, this value is the * newnblks - pointer to a s64 value. on entry, this value is the
* the new desired extent size (number of blocks). on * the new desired extent size (number of blocks). on
* successful exit, this value is set to the extent's actual * successful exit, this value is set to the extent's actual
...@@ -606,9 +606,9 @@ extBalloc(struct inode *ip, s64 hint, s64 * nblocks, s64 * blkno) ...@@ -606,9 +606,9 @@ extBalloc(struct inode *ip, s64 hint, s64 * nblocks, s64 * blkno)
* newblkno - the starting block number of the extents new allocation. * newblkno - the starting block number of the extents new allocation.
* *
* RETURN VALUES: * RETURN VALUES:
* 0 - success * 0 - success
* -EIO - i/o error. * -EIO - i/o error.
* -ENOSPC - insufficient disk resources. * -ENOSPC - insufficient disk resources.
*/ */
static int static int
extBrealloc(struct inode *ip, extBrealloc(struct inode *ip,
...@@ -634,16 +634,16 @@ extBrealloc(struct inode *ip, ...@@ -634,16 +634,16 @@ extBrealloc(struct inode *ip,
/* /*
* NAME: extRoundDown() * NAME: extRoundDown()
* *
* FUNCTION: round down a specified number of blocks to the next * FUNCTION: round down a specified number of blocks to the next
* smallest power of 2 number. * smallest power of 2 number.
* *
* PARAMETERS: * PARAMETERS:
* nb - the inode of the file. * nb - the inode of the file.
* *
* RETURN VALUES: * RETURN VALUES:
* next smallest power of 2 number. * next smallest power of 2 number.
*/ */
static s64 extRoundDown(s64 nb) static s64 extRoundDown(s64 nb)
{ {
......
...@@ -34,9 +34,9 @@ ...@@ -34,9 +34,9 @@
#define JFS_UNICODE 0x00000001 /* unicode name */ #define JFS_UNICODE 0x00000001 /* unicode name */
/* mount time flags for error handling */ /* mount time flags for error handling */
#define JFS_ERR_REMOUNT_RO 0x00000002 /* remount read-only */ #define JFS_ERR_REMOUNT_RO 0x00000002 /* remount read-only */
#define JFS_ERR_CONTINUE 0x00000004 /* continue */ #define JFS_ERR_CONTINUE 0x00000004 /* continue */
#define JFS_ERR_PANIC 0x00000008 /* panic */ #define JFS_ERR_PANIC 0x00000008 /* panic */
/* Quota support */ /* Quota support */
#define JFS_USRQUOTA 0x00000010 #define JFS_USRQUOTA 0x00000010
...@@ -83,7 +83,6 @@ ...@@ -83,7 +83,6 @@
/* case-insensitive name/directory support */ /* case-insensitive name/directory support */
#define JFS_AIX 0x80000000 /* AIX support */ #define JFS_AIX 0x80000000 /* AIX support */
/* POSIX name/directory support - Never implemented*/
/* /*
* buffer cache configuration * buffer cache configuration
...@@ -113,10 +112,10 @@ ...@@ -113,10 +112,10 @@
#define IDATASIZE 256 /* inode inline data size */ #define IDATASIZE 256 /* inode inline data size */
#define IXATTRSIZE 128 /* inode inline extended attribute size */ #define IXATTRSIZE 128 /* inode inline extended attribute size */
#define XTPAGE_SIZE 4096 #define XTPAGE_SIZE 4096
#define log2_PAGESIZE 12 #define log2_PAGESIZE 12
#define IAG_SIZE 4096 #define IAG_SIZE 4096
#define IAG_EXTENT_SIZE 4096 #define IAG_EXTENT_SIZE 4096
#define INOSPERIAG 4096 /* number of disk inodes per iag */ #define INOSPERIAG 4096 /* number of disk inodes per iag */
#define L2INOSPERIAG 12 /* l2 number of disk inodes per iag */ #define L2INOSPERIAG 12 /* l2 number of disk inodes per iag */
......
This diff is collapsed.
...@@ -24,17 +24,17 @@ ...@@ -24,17 +24,17 @@
* jfs_imap.h: disk inode manager * jfs_imap.h: disk inode manager
*/ */
#define EXTSPERIAG 128 /* number of disk inode extent per iag */ #define EXTSPERIAG 128 /* number of disk inode extent per iag */
#define IMAPBLKNO 0 /* lblkno of dinomap within inode map */ #define IMAPBLKNO 0 /* lblkno of dinomap within inode map */
#define SMAPSZ 4 /* number of words per summary map */ #define SMAPSZ 4 /* number of words per summary map */
#define EXTSPERSUM 32 /* number of extents per summary map entry */ #define EXTSPERSUM 32 /* number of extents per summary map entry */
#define L2EXTSPERSUM 5 /* l2 number of extents per summary map */ #define L2EXTSPERSUM 5 /* l2 number of extents per summary map */
#define PGSPERIEXT 4 /* number of 4K pages per dinode extent */ #define PGSPERIEXT 4 /* number of 4K pages per dinode extent */
#define MAXIAGS ((1<<20)-1) /* maximum number of iags */ #define MAXIAGS ((1<<20)-1) /* maximum number of iags */
#define MAXAG 128 /* maximum number of allocation groups */ #define MAXAG 128 /* maximum number of allocation groups */
#define AMAPSIZE 512 /* bytes in the IAG allocation maps */ #define AMAPSIZE 512 /* bytes in the IAG allocation maps */
#define SMAPSIZE 16 /* bytes in the IAG summary maps */ #define SMAPSIZE 16 /* bytes in the IAG summary maps */
/* convert inode number to iag number */ /* convert inode number to iag number */
#define INOTOIAG(ino) ((ino) >> L2INOSPERIAG) #define INOTOIAG(ino) ((ino) >> L2INOSPERIAG)
...@@ -60,31 +60,31 @@ ...@@ -60,31 +60,31 @@
* inode allocation group page (per 4096 inodes of an AG) * inode allocation group page (per 4096 inodes of an AG)
*/ */
struct iag { struct iag {
__le64 agstart; /* 8: starting block of ag */ __le64 agstart; /* 8: starting block of ag */
__le32 iagnum; /* 4: inode allocation group number */ __le32 iagnum; /* 4: inode allocation group number */
__le32 inofreefwd; /* 4: ag inode free list forward */ __le32 inofreefwd; /* 4: ag inode free list forward */
__le32 inofreeback; /* 4: ag inode free list back */ __le32 inofreeback; /* 4: ag inode free list back */
__le32 extfreefwd; /* 4: ag inode extent free list forward */ __le32 extfreefwd; /* 4: ag inode extent free list forward */
__le32 extfreeback; /* 4: ag inode extent free list back */ __le32 extfreeback; /* 4: ag inode extent free list back */
__le32 iagfree; /* 4: iag free list */ __le32 iagfree; /* 4: iag free list */
/* summary map: 1 bit per inode extent */ /* summary map: 1 bit per inode extent */
__le32 inosmap[SMAPSZ]; /* 16: sum map of mapwords w/ free inodes; __le32 inosmap[SMAPSZ]; /* 16: sum map of mapwords w/ free inodes;
* note: this indicates free and backed * note: this indicates free and backed
* inodes, if the extent is not backed the * inodes, if the extent is not backed the
* value will be 1. if the extent is * value will be 1. if the extent is
* backed but all inodes are being used the * backed but all inodes are being used the
* value will be 1. if the extent is * value will be 1. if the extent is
* backed but at least one of the inodes is * backed but at least one of the inodes is
* free the value will be 0. * free the value will be 0.
*/ */
__le32 extsmap[SMAPSZ]; /* 16: sum map of mapwords w/ free extents */ __le32 extsmap[SMAPSZ]; /* 16: sum map of mapwords w/ free extents */
__le32 nfreeinos; /* 4: number of free inodes */ __le32 nfreeinos; /* 4: number of free inodes */
__le32 nfreeexts; /* 4: number of free extents */ __le32 nfreeexts; /* 4: number of free extents */
/* (72) */ /* (72) */
u8 pad[1976]; /* 1976: pad to 2048 bytes */ u8 pad[1976]; /* 1976: pad to 2048 bytes */
/* allocation bit map: 1 bit per inode (0 - free, 1 - allocated) */ /* allocation bit map: 1 bit per inode (0 - free, 1 - allocated) */
__le32 wmap[EXTSPERIAG]; /* 512: working allocation map */ __le32 wmap[EXTSPERIAG]; /* 512: working allocation map */
__le32 pmap[EXTSPERIAG]; /* 512: persistent allocation map */ __le32 pmap[EXTSPERIAG]; /* 512: persistent allocation map */
pxd_t inoext[EXTSPERIAG]; /* 1024: inode extent addresses */ pxd_t inoext[EXTSPERIAG]; /* 1024: inode extent addresses */
}; /* (4096) */ }; /* (4096) */
...@@ -93,44 +93,44 @@ struct iag { ...@@ -93,44 +93,44 @@ struct iag {
* per AG control information (in inode map control page) * per AG control information (in inode map control page)
*/ */
struct iagctl_disk { struct iagctl_disk {
__le32 inofree; /* 4: free inode list anchor */ __le32 inofree; /* 4: free inode list anchor */
__le32 extfree; /* 4: free extent list anchor */ __le32 extfree; /* 4: free extent list anchor */
__le32 numinos; /* 4: number of backed inodes */ __le32 numinos; /* 4: number of backed inodes */
__le32 numfree; /* 4: number of free inodes */ __le32 numfree; /* 4: number of free inodes */
}; /* (16) */ }; /* (16) */
struct iagctl { struct iagctl {
int inofree; /* free inode list anchor */ int inofree; /* free inode list anchor */
int extfree; /* free extent list anchor */ int extfree; /* free extent list anchor */
int numinos; /* number of backed inodes */ int numinos; /* number of backed inodes */
int numfree; /* number of free inodes */ int numfree; /* number of free inodes */
}; };
/* /*
* per fileset/aggregate inode map control page * per fileset/aggregate inode map control page
*/ */
struct dinomap_disk { struct dinomap_disk {
__le32 in_freeiag; /* 4: free iag list anchor */ __le32 in_freeiag; /* 4: free iag list anchor */
__le32 in_nextiag; /* 4: next free iag number */ __le32 in_nextiag; /* 4: next free iag number */
__le32 in_numinos; /* 4: num of backed inodes */ __le32 in_numinos; /* 4: num of backed inodes */
__le32 in_numfree; /* 4: num of free backed inodes */ __le32 in_numfree; /* 4: num of free backed inodes */
__le32 in_nbperiext; /* 4: num of blocks per inode extent */ __le32 in_nbperiext; /* 4: num of blocks per inode extent */
__le32 in_l2nbperiext; /* 4: l2 of in_nbperiext */ __le32 in_l2nbperiext; /* 4: l2 of in_nbperiext */
__le32 in_diskblock; /* 4: for standalone test driver */ __le32 in_diskblock; /* 4: for standalone test driver */
__le32 in_maxag; /* 4: for standalone test driver */ __le32 in_maxag; /* 4: for standalone test driver */
u8 pad[2016]; /* 2016: pad to 2048 */ u8 pad[2016]; /* 2016: pad to 2048 */
struct iagctl_disk in_agctl[MAXAG]; /* 2048: AG control information */ struct iagctl_disk in_agctl[MAXAG]; /* 2048: AG control information */
}; /* (4096) */ }; /* (4096) */
struct dinomap { struct dinomap {
int in_freeiag; /* free iag list anchor */ int in_freeiag; /* free iag list anchor */
int in_nextiag; /* next free iag number */ int in_nextiag; /* next free iag number */
int in_numinos; /* num of backed inodes */ int in_numinos; /* num of backed inodes */
int in_numfree; /* num of free backed inodes */ int in_numfree; /* num of free backed inodes */
int in_nbperiext; /* num of blocks per inode extent */ int in_nbperiext; /* num of blocks per inode extent */
int in_l2nbperiext; /* l2 of in_nbperiext */ int in_l2nbperiext; /* l2 of in_nbperiext */
int in_diskblock; /* for standalone test driver */ int in_diskblock; /* for standalone test driver */
int in_maxag; /* for standalone test driver */ int in_maxag; /* for standalone test driver */
struct iagctl in_agctl[MAXAG]; /* AG control information */ struct iagctl in_agctl[MAXAG]; /* AG control information */
}; };
...@@ -139,9 +139,9 @@ struct dinomap { ...@@ -139,9 +139,9 @@ struct dinomap {
*/ */
struct inomap { struct inomap {
struct dinomap im_imap; /* 4096: inode allocation control */ struct dinomap im_imap; /* 4096: inode allocation control */
struct inode *im_ipimap; /* 4: ptr to inode for imap */ struct inode *im_ipimap; /* 4: ptr to inode for imap */
struct mutex im_freelock; /* 4: iag free list lock */ struct mutex im_freelock; /* 4: iag free list lock */
struct mutex im_aglock[MAXAG]; /* 512: per AG locks */ struct mutex im_aglock[MAXAG]; /* 512: per AG locks */
u32 *im_DBGdimap; u32 *im_DBGdimap;
atomic_t im_numinos; /* num of backed inodes */ atomic_t im_numinos; /* num of backed inodes */
atomic_t im_numfree; /* num of free backed inodes */ atomic_t im_numfree; /* num of free backed inodes */
......
...@@ -40,7 +40,7 @@ struct jfs_inode_info { ...@@ -40,7 +40,7 @@ struct jfs_inode_info {
uint mode2; /* jfs-specific mode */ uint mode2; /* jfs-specific mode */
uint saved_uid; /* saved for uid mount option */ uint saved_uid; /* saved for uid mount option */
uint saved_gid; /* saved for gid mount option */ uint saved_gid; /* saved for gid mount option */
pxd_t ixpxd; /* inode extent descriptor */ pxd_t ixpxd; /* inode extent descriptor */
dxd_t acl; /* dxd describing acl */ dxd_t acl; /* dxd describing acl */
dxd_t ea; /* dxd describing ea */ dxd_t ea; /* dxd describing ea */
time_t otime; /* time created */ time_t otime; /* time created */
...@@ -190,7 +190,7 @@ struct jfs_sb_info { ...@@ -190,7 +190,7 @@ struct jfs_sb_info {
uint gengen; /* inode generation generator*/ uint gengen; /* inode generation generator*/
uint inostamp; /* shows inode belongs to fileset*/ uint inostamp; /* shows inode belongs to fileset*/
/* Formerly in ipbmap */ /* Formerly in ipbmap */
struct bmap *bmap; /* incore bmap descriptor */ struct bmap *bmap; /* incore bmap descriptor */
struct nls_table *nls_tab; /* current codepage */ struct nls_table *nls_tab; /* current codepage */
struct inode *direct_inode; /* metadata inode */ struct inode *direct_inode; /* metadata inode */
......
...@@ -244,7 +244,7 @@ int lmLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, ...@@ -244,7 +244,7 @@ int lmLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
goto writeRecord; goto writeRecord;
/* /*
* initialize/update page/transaction recovery lsn * initialize/update page/transaction recovery lsn
*/ */
lsn = log->lsn; lsn = log->lsn;
...@@ -263,7 +263,7 @@ int lmLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, ...@@ -263,7 +263,7 @@ int lmLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
} }
/* /*
* initialize/update lsn of tblock of the page * initialize/update lsn of tblock of the page
* *
* transaction inherits oldest lsn of pages associated * transaction inherits oldest lsn of pages associated
* with allocation/deallocation of resources (their * with allocation/deallocation of resources (their
...@@ -307,7 +307,7 @@ int lmLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, ...@@ -307,7 +307,7 @@ int lmLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
LOGSYNC_UNLOCK(log, flags); LOGSYNC_UNLOCK(log, flags);
/* /*
* write the log record * write the log record
*/ */
writeRecord: writeRecord:
lsn = lmWriteRecord(log, tblk, lrd, tlck); lsn = lmWriteRecord(log, tblk, lrd, tlck);
...@@ -372,7 +372,7 @@ lmWriteRecord(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, ...@@ -372,7 +372,7 @@ lmWriteRecord(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
goto moveLrd; goto moveLrd;
/* /*
* move log record data * move log record data
*/ */
/* retrieve source meta-data page to log */ /* retrieve source meta-data page to log */
if (tlck->flag & tlckPAGELOCK) { if (tlck->flag & tlckPAGELOCK) {
...@@ -465,7 +465,7 @@ lmWriteRecord(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, ...@@ -465,7 +465,7 @@ lmWriteRecord(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
} }
/* /*
* move log record descriptor * move log record descriptor
*/ */
moveLrd: moveLrd:
lrd->length = cpu_to_le16(len); lrd->length = cpu_to_le16(len);
...@@ -574,7 +574,7 @@ static int lmNextPage(struct jfs_log * log) ...@@ -574,7 +574,7 @@ static int lmNextPage(struct jfs_log * log)
LOGGC_LOCK(log); LOGGC_LOCK(log);
/* /*
* write or queue the full page at the tail of write queue * write or queue the full page at the tail of write queue
*/ */
/* get the tail tblk on commit queue */ /* get the tail tblk on commit queue */
if (list_empty(&log->cqueue)) if (list_empty(&log->cqueue))
...@@ -625,7 +625,7 @@ static int lmNextPage(struct jfs_log * log) ...@@ -625,7 +625,7 @@ static int lmNextPage(struct jfs_log * log)
LOGGC_UNLOCK(log); LOGGC_UNLOCK(log);
/* /*
* allocate/initialize next page * allocate/initialize next page
*/ */
/* if log wraps, the first data page of log is 2 /* if log wraps, the first data page of log is 2
* (0 never used, 1 is superblock). * (0 never used, 1 is superblock).
...@@ -953,7 +953,7 @@ static int lmLogSync(struct jfs_log * log, int hard_sync) ...@@ -953,7 +953,7 @@ static int lmLogSync(struct jfs_log * log, int hard_sync)
} }
/* /*
* forward syncpt * forward syncpt
*/ */
/* if last sync is same as last syncpt, /* if last sync is same as last syncpt,
* invoke sync point forward processing to update sync. * invoke sync point forward processing to update sync.
...@@ -989,7 +989,7 @@ static int lmLogSync(struct jfs_log * log, int hard_sync) ...@@ -989,7 +989,7 @@ static int lmLogSync(struct jfs_log * log, int hard_sync)
lsn = log->lsn; lsn = log->lsn;
/* /*
* setup next syncpt trigger (SWAG) * setup next syncpt trigger (SWAG)
*/ */
logsize = log->logsize; logsize = log->logsize;
...@@ -1000,11 +1000,11 @@ static int lmLogSync(struct jfs_log * log, int hard_sync) ...@@ -1000,11 +1000,11 @@ static int lmLogSync(struct jfs_log * log, int hard_sync)
if (more < 2 * LOGPSIZE) { if (more < 2 * LOGPSIZE) {
jfs_warn("\n ... Log Wrap ... Log Wrap ... Log Wrap ...\n"); jfs_warn("\n ... Log Wrap ... Log Wrap ... Log Wrap ...\n");
/* /*
* log wrapping * log wrapping
* *
* option 1 - panic ? No.! * option 1 - panic ? No.!
* option 2 - shutdown file systems * option 2 - shutdown file systems
* associated with log ? * associated with log ?
* option 3 - extend log ? * option 3 - extend log ?
*/ */
/* /*
...@@ -1062,7 +1062,7 @@ void jfs_syncpt(struct jfs_log *log, int hard_sync) ...@@ -1062,7 +1062,7 @@ void jfs_syncpt(struct jfs_log *log, int hard_sync)
/* /*
* NAME: lmLogOpen() * NAME: lmLogOpen()
* *
* FUNCTION: open the log on first open; * FUNCTION: open the log on first open;
* insert filesystem in the active list of the log. * insert filesystem in the active list of the log.
* *
* PARAMETER: ipmnt - file system mount inode * PARAMETER: ipmnt - file system mount inode
...@@ -1113,7 +1113,7 @@ int lmLogOpen(struct super_block *sb) ...@@ -1113,7 +1113,7 @@ int lmLogOpen(struct super_block *sb)
init_waitqueue_head(&log->syncwait); init_waitqueue_head(&log->syncwait);
/* /*
* external log as separate logical volume * external log as separate logical volume
* *
* file systems to log may have n-to-1 relationship; * file systems to log may have n-to-1 relationship;
*/ */
...@@ -1155,7 +1155,7 @@ int lmLogOpen(struct super_block *sb) ...@@ -1155,7 +1155,7 @@ int lmLogOpen(struct super_block *sb)
return 0; return 0;
/* /*
* unwind on error * unwind on error
*/ */
shutdown: /* unwind lbmLogInit() */ shutdown: /* unwind lbmLogInit() */
list_del(&log->journal_list); list_del(&log->journal_list);
...@@ -1427,7 +1427,7 @@ int lmLogInit(struct jfs_log * log) ...@@ -1427,7 +1427,7 @@ int lmLogInit(struct jfs_log * log)
return 0; return 0;
/* /*
* unwind on error * unwind on error
*/ */
errout30: /* release log page */ errout30: /* release log page */
log->wqueue = NULL; log->wqueue = NULL;
...@@ -1480,7 +1480,7 @@ int lmLogClose(struct super_block *sb) ...@@ -1480,7 +1480,7 @@ int lmLogClose(struct super_block *sb)
if (test_bit(log_INLINELOG, &log->flag)) { if (test_bit(log_INLINELOG, &log->flag)) {
/* /*
* in-line log in host file system * in-line log in host file system
*/ */
rc = lmLogShutdown(log); rc = lmLogShutdown(log);
kfree(log); kfree(log);
...@@ -1504,7 +1504,7 @@ int lmLogClose(struct super_block *sb) ...@@ -1504,7 +1504,7 @@ int lmLogClose(struct super_block *sb)
goto out; goto out;
/* /*
* external log as separate logical volume * external log as separate logical volume
*/ */
list_del(&log->journal_list); list_del(&log->journal_list);
bdev = log->bdev; bdev = log->bdev;
...@@ -1723,7 +1723,7 @@ int lmLogShutdown(struct jfs_log * log) ...@@ -1723,7 +1723,7 @@ int lmLogShutdown(struct jfs_log * log)
* *
* PARAMETE: log - pointer to logs inode. * PARAMETE: log - pointer to logs inode.
* fsdev - kdev_t of filesystem. * fsdev - kdev_t of filesystem.
* serial - pointer to returned log serial number * serial - pointer to returned log serial number
* activate - insert/remove device from active list. * activate - insert/remove device from active list.
* *
* RETURN: 0 - success * RETURN: 0 - success
...@@ -1963,7 +1963,7 @@ static void lbmfree(struct lbuf * bp) ...@@ -1963,7 +1963,7 @@ static void lbmfree(struct lbuf * bp)
* FUNCTION: add a log buffer to the log redrive list * FUNCTION: add a log buffer to the log redrive list
* *
* PARAMETER: * PARAMETER:
* bp - log buffer * bp - log buffer
* *
* NOTES: * NOTES:
* Takes log_redrive_lock. * Takes log_redrive_lock.
...@@ -2054,7 +2054,7 @@ static void lbmWrite(struct jfs_log * log, struct lbuf * bp, int flag, ...@@ -2054,7 +2054,7 @@ static void lbmWrite(struct jfs_log * log, struct lbuf * bp, int flag,
bp->l_flag = flag; bp->l_flag = flag;
/* /*
* insert bp at tail of write queue associated with log * insert bp at tail of write queue associated with log
* *
* (request is either for bp already/currently at head of queue * (request is either for bp already/currently at head of queue
* or new bp to be inserted at tail) * or new bp to be inserted at tail)
...@@ -2117,7 +2117,7 @@ static void lbmDirectWrite(struct jfs_log * log, struct lbuf * bp, int flag) ...@@ -2117,7 +2117,7 @@ static void lbmDirectWrite(struct jfs_log * log, struct lbuf * bp, int flag)
log->base + (bp->l_pn << (L2LOGPSIZE - log->l2bsize)); log->base + (bp->l_pn << (L2LOGPSIZE - log->l2bsize));
/* /*
* initiate pageout of the page * initiate pageout of the page
*/ */
lbmStartIO(bp); lbmStartIO(bp);
} }
...@@ -2128,7 +2128,7 @@ static void lbmDirectWrite(struct jfs_log * log, struct lbuf * bp, int flag) ...@@ -2128,7 +2128,7 @@ static void lbmDirectWrite(struct jfs_log * log, struct lbuf * bp, int flag)
* *
* FUNCTION: Interface to DD strategy routine * FUNCTION: Interface to DD strategy routine
* *
* RETURN: none * RETURN: none
* *
* serialization: LCACHE_LOCK() is NOT held during log i/o; * serialization: LCACHE_LOCK() is NOT held during log i/o;
*/ */
...@@ -2222,7 +2222,7 @@ static int lbmIODone(struct bio *bio, unsigned int bytes_done, int error) ...@@ -2222,7 +2222,7 @@ static int lbmIODone(struct bio *bio, unsigned int bytes_done, int error)
bio_put(bio); bio_put(bio);
/* /*
* pagein completion * pagein completion
*/ */
if (bp->l_flag & lbmREAD) { if (bp->l_flag & lbmREAD) {
bp->l_flag &= ~lbmREAD; bp->l_flag &= ~lbmREAD;
...@@ -2236,7 +2236,7 @@ static int lbmIODone(struct bio *bio, unsigned int bytes_done, int error) ...@@ -2236,7 +2236,7 @@ static int lbmIODone(struct bio *bio, unsigned int bytes_done, int error)
} }
/* /*
* pageout completion * pageout completion
* *
* the bp at the head of write queue has completed pageout. * the bp at the head of write queue has completed pageout.
* *
...@@ -2302,7 +2302,7 @@ static int lbmIODone(struct bio *bio, unsigned int bytes_done, int error) ...@@ -2302,7 +2302,7 @@ static int lbmIODone(struct bio *bio, unsigned int bytes_done, int error)
} }
/* /*
* synchronous pageout: * synchronous pageout:
* *
* buffer has not necessarily been removed from write queue * buffer has not necessarily been removed from write queue
* (e.g., synchronous write of partial-page with COMMIT): * (e.g., synchronous write of partial-page with COMMIT):
...@@ -2316,7 +2316,7 @@ static int lbmIODone(struct bio *bio, unsigned int bytes_done, int error) ...@@ -2316,7 +2316,7 @@ static int lbmIODone(struct bio *bio, unsigned int bytes_done, int error)
} }
/* /*
* Group Commit pageout: * Group Commit pageout:
*/ */
else if (bp->l_flag & lbmGC) { else if (bp->l_flag & lbmGC) {
LCACHE_UNLOCK(flags); LCACHE_UNLOCK(flags);
...@@ -2324,7 +2324,7 @@ static int lbmIODone(struct bio *bio, unsigned int bytes_done, int error) ...@@ -2324,7 +2324,7 @@ static int lbmIODone(struct bio *bio, unsigned int bytes_done, int error)
} }
/* /*
* asynchronous pageout: * asynchronous pageout:
* *
* buffer must have been removed from write queue: * buffer must have been removed from write queue:
* insert buffer at head of freelist where it can be recycled * insert buffer at head of freelist where it can be recycled
...@@ -2375,7 +2375,7 @@ int jfsIOWait(void *arg) ...@@ -2375,7 +2375,7 @@ int jfsIOWait(void *arg)
* FUNCTION: format file system log * FUNCTION: format file system log
* *
* PARAMETERS: * PARAMETERS:
* log - volume log * log - volume log
* logAddress - start address of log space in FS block * logAddress - start address of log space in FS block
* logSize - length of log space in FS block; * logSize - length of log space in FS block;
* *
...@@ -2407,16 +2407,16 @@ int lmLogFormat(struct jfs_log *log, s64 logAddress, int logSize) ...@@ -2407,16 +2407,16 @@ int lmLogFormat(struct jfs_log *log, s64 logAddress, int logSize)
npages = logSize >> sbi->l2nbperpage; npages = logSize >> sbi->l2nbperpage;
/* /*
* log space: * log space:
* *
* page 0 - reserved; * page 0 - reserved;
* page 1 - log superblock; * page 1 - log superblock;
* page 2 - log data page: A SYNC log record is written * page 2 - log data page: A SYNC log record is written
* into this page at logform time; * into this page at logform time;
* pages 3-N - log data page: set to empty log data pages; * pages 3-N - log data page: set to empty log data pages;
*/ */
/* /*
* init log superblock: log page 1 * init log superblock: log page 1
*/ */
logsuper = (struct logsuper *) bp->l_ldata; logsuper = (struct logsuper *) bp->l_ldata;
...@@ -2436,7 +2436,7 @@ int lmLogFormat(struct jfs_log *log, s64 logAddress, int logSize) ...@@ -2436,7 +2436,7 @@ int lmLogFormat(struct jfs_log *log, s64 logAddress, int logSize)
goto exit; goto exit;
/* /*
* init pages 2 to npages-1 as log data pages: * init pages 2 to npages-1 as log data pages:
* *
* log page sequence number (lpsn) initialization: * log page sequence number (lpsn) initialization:
* *
...@@ -2479,7 +2479,7 @@ int lmLogFormat(struct jfs_log *log, s64 logAddress, int logSize) ...@@ -2479,7 +2479,7 @@ int lmLogFormat(struct jfs_log *log, s64 logAddress, int logSize)
goto exit; goto exit;
/* /*
* initialize succeeding log pages: lpsn = 0, 1, ..., (N-2) * initialize succeeding log pages: lpsn = 0, 1, ..., (N-2)
*/ */
for (lspn = 0; lspn < npages - 3; lspn++) { for (lspn = 0; lspn < npages - 3; lspn++) {
lp->h.page = lp->t.page = cpu_to_le32(lspn); lp->h.page = lp->t.page = cpu_to_le32(lspn);
...@@ -2495,7 +2495,7 @@ int lmLogFormat(struct jfs_log *log, s64 logAddress, int logSize) ...@@ -2495,7 +2495,7 @@ int lmLogFormat(struct jfs_log *log, s64 logAddress, int logSize)
rc = 0; rc = 0;
exit: exit:
/* /*
* finalize log * finalize log
*/ */
/* release the buffer */ /* release the buffer */
lbmFree(bp); lbmFree(bp);
......
...@@ -144,7 +144,7 @@ struct logpage { ...@@ -144,7 +144,7 @@ struct logpage {
* *
* (this comment should be rewritten !) * (this comment should be rewritten !)
* jfs uses only "after" log records (only a single writer is allowed * jfs uses only "after" log records (only a single writer is allowed
* in a page, pages are written to temporary paging space if * in a page, pages are written to temporary paging space if
* if they must be written to disk before commit, and i/o is * if they must be written to disk before commit, and i/o is
* scheduled for modified pages to their home location after * scheduled for modified pages to their home location after
* the log records containing the after values and the commit * the log records containing the after values and the commit
...@@ -153,7 +153,7 @@ struct logpage { ...@@ -153,7 +153,7 @@ struct logpage {
* *
* a log record consists of a data area of variable length followed by * a log record consists of a data area of variable length followed by
* a descriptor of fixed size LOGRDSIZE bytes. * a descriptor of fixed size LOGRDSIZE bytes.
* the data area is rounded up to an integral number of 4-bytes and * the data area is rounded up to an integral number of 4-bytes and
* must be no longer than LOGPSIZE. * must be no longer than LOGPSIZE.
* the descriptor is of size of multiple of 4-bytes and aligned on a * the descriptor is of size of multiple of 4-bytes and aligned on a
* 4-byte boundary. * 4-byte boundary.
...@@ -215,13 +215,13 @@ struct lrd { ...@@ -215,13 +215,13 @@ struct lrd {
union { union {
/* /*
* COMMIT: commit * COMMIT: commit
* *
* transaction commit: no type-dependent information; * transaction commit: no type-dependent information;
*/ */
/* /*
* REDOPAGE: after-image * REDOPAGE: after-image
* *
* apply after-image; * apply after-image;
* *
...@@ -236,7 +236,7 @@ struct lrd { ...@@ -236,7 +236,7 @@ struct lrd {
} redopage; /* (20) */ } redopage; /* (20) */
/* /*
* NOREDOPAGE: the page is freed * NOREDOPAGE: the page is freed
* *
* do not apply after-image records which precede this record * do not apply after-image records which precede this record
* in the log with the same page block number to this page. * in the log with the same page block number to this page.
...@@ -252,7 +252,7 @@ struct lrd { ...@@ -252,7 +252,7 @@ struct lrd {
} noredopage; /* (20) */ } noredopage; /* (20) */
/* /*
* UPDATEMAP: update block allocation map * UPDATEMAP: update block allocation map
* *
* either in-line PXD, * either in-line PXD,
* or out-of-line XADLIST; * or out-of-line XADLIST;
...@@ -268,7 +268,7 @@ struct lrd { ...@@ -268,7 +268,7 @@ struct lrd {
} updatemap; /* (20) */ } updatemap; /* (20) */
/* /*
* NOREDOINOEXT: the inode extent is freed * NOREDOINOEXT: the inode extent is freed
* *
* do not apply after-image records which precede this * do not apply after-image records which precede this
* record in the log with the any of the 4 page block * record in the log with the any of the 4 page block
...@@ -286,7 +286,7 @@ struct lrd { ...@@ -286,7 +286,7 @@ struct lrd {
} noredoinoext; /* (20) */ } noredoinoext; /* (20) */
/* /*
* SYNCPT: log sync point * SYNCPT: log sync point
* *
* replay log upto syncpt address specified; * replay log upto syncpt address specified;
*/ */
...@@ -295,13 +295,13 @@ struct lrd { ...@@ -295,13 +295,13 @@ struct lrd {
} syncpt; } syncpt;
/* /*
* MOUNT: file system mount * MOUNT: file system mount
* *
* file system mount: no type-dependent information; * file system mount: no type-dependent information;
*/ */
/* /*
* ? FREEXTENT: free specified extent(s) * ? FREEXTENT: free specified extent(s)
* *
* free specified extent(s) from block allocation map * free specified extent(s) from block allocation map
* N.B.: nextents should be length of data/sizeof(xad_t) * N.B.: nextents should be length of data/sizeof(xad_t)
...@@ -314,7 +314,7 @@ struct lrd { ...@@ -314,7 +314,7 @@ struct lrd {
} freextent; } freextent;
/* /*
* ? NOREDOFILE: this file is freed * ? NOREDOFILE: this file is freed
* *
* do not apply records which precede this record in the log * do not apply records which precede this record in the log
* with the same inode number. * with the same inode number.
...@@ -330,7 +330,7 @@ struct lrd { ...@@ -330,7 +330,7 @@ struct lrd {
} noredofile; } noredofile;
/* /*
* ? NEWPAGE: * ? NEWPAGE:
* *
* metadata type dependent * metadata type dependent
*/ */
...@@ -342,7 +342,7 @@ struct lrd { ...@@ -342,7 +342,7 @@ struct lrd {
} newpage; } newpage;
/* /*
* ? DUMMY: filler * ? DUMMY: filler
* *
* no type-dependent information * no type-dependent information
*/ */
......
...@@ -80,7 +80,7 @@ static int logMOUNT(struct super_block *sb); ...@@ -80,7 +80,7 @@ static int logMOUNT(struct super_block *sb);
*/ */
int jfs_mount(struct super_block *sb) int jfs_mount(struct super_block *sb)
{ {
int rc = 0; /* Return code */ int rc = 0; /* Return code */
struct jfs_sb_info *sbi = JFS_SBI(sb); struct jfs_sb_info *sbi = JFS_SBI(sb);
struct inode *ipaimap = NULL; struct inode *ipaimap = NULL;
struct inode *ipaimap2 = NULL; struct inode *ipaimap2 = NULL;
...@@ -169,7 +169,7 @@ int jfs_mount(struct super_block *sb) ...@@ -169,7 +169,7 @@ int jfs_mount(struct super_block *sb)
sbi->ipaimap2 = NULL; sbi->ipaimap2 = NULL;
/* /*
* mount (the only/single) fileset * mount (the only/single) fileset
*/ */
/* /*
* open fileset inode allocation map (aka fileset inode) * open fileset inode allocation map (aka fileset inode)
...@@ -195,7 +195,7 @@ int jfs_mount(struct super_block *sb) ...@@ -195,7 +195,7 @@ int jfs_mount(struct super_block *sb)
goto out; goto out;
/* /*
* unwind on error * unwind on error
*/ */
errout41: /* close fileset inode allocation map inode */ errout41: /* close fileset inode allocation map inode */
diFreeSpecial(ipimap); diFreeSpecial(ipimap);
......
This diff is collapsed.
...@@ -94,7 +94,7 @@ extern struct tblock *TxBlock; /* transaction block table */ ...@@ -94,7 +94,7 @@ extern struct tblock *TxBlock; /* transaction block table */
*/ */
struct tlock { struct tlock {
lid_t next; /* 2: index next lockword on tid locklist lid_t next; /* 2: index next lockword on tid locklist
* next lockword on freelist * next lockword on freelist
*/ */
tid_t tid; /* 2: transaction id holding lock */ tid_t tid; /* 2: transaction id holding lock */
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
/* /*
* jfs_types.h: * jfs_types.h:
* *
* basic type/utility definitions * basic type/utility definitions
* *
* note: this header file must be the 1st include file * note: this header file must be the 1st include file
* of JFS include list in all JFS .c file. * of JFS include list in all JFS .c file.
...@@ -54,8 +54,8 @@ struct timestruc_t { ...@@ -54,8 +54,8 @@ struct timestruc_t {
*/ */
#define LEFTMOSTONE 0x80000000 #define LEFTMOSTONE 0x80000000
#define HIGHORDER 0x80000000u /* high order bit on */ #define HIGHORDER 0x80000000u /* high order bit on */
#define ONES 0xffffffffu /* all bit on */ #define ONES 0xffffffffu /* all bit on */
/* /*
* logical xd (lxd) * logical xd (lxd)
...@@ -148,7 +148,7 @@ typedef struct { ...@@ -148,7 +148,7 @@ typedef struct {
#define sizeDXD(dxd) le32_to_cpu((dxd)->size) #define sizeDXD(dxd) le32_to_cpu((dxd)->size)
/* /*
* directory entry argument * directory entry argument
*/ */
struct component_name { struct component_name {
int namlen; int namlen;
...@@ -160,14 +160,14 @@ struct component_name { ...@@ -160,14 +160,14 @@ struct component_name {
* DASD limit information - stored in directory inode * DASD limit information - stored in directory inode
*/ */
struct dasd { struct dasd {
u8 thresh; /* Alert Threshold (in percent) */ u8 thresh; /* Alert Threshold (in percent) */
u8 delta; /* Alert Threshold delta (in percent) */ u8 delta; /* Alert Threshold delta (in percent) */
u8 rsrvd1; u8 rsrvd1;
u8 limit_hi; /* DASD limit (in logical blocks) */ u8 limit_hi; /* DASD limit (in logical blocks) */
__le32 limit_lo; /* DASD limit (in logical blocks) */ __le32 limit_lo; /* DASD limit (in logical blocks) */
u8 rsrvd2[3]; u8 rsrvd2[3];
u8 used_hi; /* DASD usage (in logical blocks) */ u8 used_hi; /* DASD usage (in logical blocks) */
__le32 used_lo; /* DASD usage (in logical blocks) */ __le32 used_lo; /* DASD usage (in logical blocks) */
}; };
#define DASDLIMIT(dasdp) \ #define DASDLIMIT(dasdp) \
......
...@@ -60,7 +60,7 @@ int jfs_umount(struct super_block *sb) ...@@ -60,7 +60,7 @@ int jfs_umount(struct super_block *sb)
jfs_info("UnMount JFS: sb:0x%p", sb); jfs_info("UnMount JFS: sb:0x%p", sb);
/* /*
* update superblock and close log * update superblock and close log
* *
* if mounted read-write and log based recovery was enabled * if mounted read-write and log based recovery was enabled
*/ */
......
This diff is collapsed.
...@@ -19,14 +19,14 @@ ...@@ -19,14 +19,14 @@
#define _H_JFS_XTREE #define _H_JFS_XTREE
/* /*
* jfs_xtree.h: extent allocation descriptor B+-tree manager * jfs_xtree.h: extent allocation descriptor B+-tree manager
*/ */
#include "jfs_btree.h" #include "jfs_btree.h"
/* /*
* extent allocation descriptor (xad) * extent allocation descriptor (xad)
*/ */
typedef struct xad { typedef struct xad {
unsigned flag:8; /* 1: flag */ unsigned flag:8; /* 1: flag */
...@@ -38,30 +38,30 @@ typedef struct xad { ...@@ -38,30 +38,30 @@ typedef struct xad {
__le32 addr2; /* 4: address in unit of fsblksize */ __le32 addr2; /* 4: address in unit of fsblksize */
} xad_t; /* (16) */ } xad_t; /* (16) */
#define MAXXLEN ((1 << 24) - 1) #define MAXXLEN ((1 << 24) - 1)
#define XTSLOTSIZE 16 #define XTSLOTSIZE 16
#define L2XTSLOTSIZE 4 #define L2XTSLOTSIZE 4
/* xad_t field construction */ /* xad_t field construction */
#define XADoffset(xad, offset64)\ #define XADoffset(xad, offset64)\
{\ {\
(xad)->off1 = ((u64)offset64) >> 32;\ (xad)->off1 = ((u64)offset64) >> 32;\
(xad)->off2 = __cpu_to_le32((offset64) & 0xffffffff);\ (xad)->off2 = __cpu_to_le32((offset64) & 0xffffffff);\
} }
#define XADaddress(xad, address64)\ #define XADaddress(xad, address64)\
{\ {\
(xad)->addr1 = ((u64)address64) >> 32;\ (xad)->addr1 = ((u64)address64) >> 32;\
(xad)->addr2 = __cpu_to_le32((address64) & 0xffffffff);\ (xad)->addr2 = __cpu_to_le32((address64) & 0xffffffff);\
} }
#define XADlength(xad, length32) (xad)->len = __cpu_to_le24(length32) #define XADlength(xad, length32) (xad)->len = __cpu_to_le24(length32)
/* xad_t field extraction */ /* xad_t field extraction */
#define offsetXAD(xad)\ #define offsetXAD(xad)\
( ((s64)((xad)->off1)) << 32 | __le32_to_cpu((xad)->off2)) ( ((s64)((xad)->off1)) << 32 | __le32_to_cpu((xad)->off2))
#define addressXAD(xad)\ #define addressXAD(xad)\
( ((s64)((xad)->addr1)) << 32 | __le32_to_cpu((xad)->addr2)) ( ((s64)((xad)->addr1)) << 32 | __le32_to_cpu((xad)->addr2))
#define lengthXAD(xad) __le24_to_cpu((xad)->len) #define lengthXAD(xad) __le24_to_cpu((xad)->len)
/* xad list */ /* xad list */
struct xadlist { struct xadlist {
...@@ -71,22 +71,22 @@ struct xadlist { ...@@ -71,22 +71,22 @@ struct xadlist {
}; };
/* xad_t flags */ /* xad_t flags */
#define XAD_NEW 0x01 /* new */ #define XAD_NEW 0x01 /* new */
#define XAD_EXTENDED 0x02 /* extended */ #define XAD_EXTENDED 0x02 /* extended */
#define XAD_COMPRESSED 0x04 /* compressed with recorded length */ #define XAD_COMPRESSED 0x04 /* compressed with recorded length */
#define XAD_NOTRECORDED 0x08 /* allocated but not recorded */ #define XAD_NOTRECORDED 0x08 /* allocated but not recorded */
#define XAD_COW 0x10 /* copy-on-write */ #define XAD_COW 0x10 /* copy-on-write */
/* possible values for maxentry */ /* possible values for maxentry */
#define XTROOTINITSLOT_DIR 6 #define XTROOTINITSLOT_DIR 6
#define XTROOTINITSLOT 10 #define XTROOTINITSLOT 10
#define XTROOTMAXSLOT 18 #define XTROOTMAXSLOT 18
#define XTPAGEMAXSLOT 256 #define XTPAGEMAXSLOT 256
#define XTENTRYSTART 2 #define XTENTRYSTART 2
/* /*
* xtree page: * xtree page:
*/ */
typedef union { typedef union {
struct xtheader { struct xtheader {
...@@ -106,7 +106,7 @@ typedef union { ...@@ -106,7 +106,7 @@ typedef union {
} xtpage_t; } xtpage_t;
/* /*
* external declaration * external declaration
*/ */
extern int xtLookup(struct inode *ip, s64 lstart, s64 llen, extern int xtLookup(struct inode *ip, s64 lstart, s64 llen,
int *pflag, s64 * paddr, int *plen, int flag); int *pflag, s64 * paddr, int *plen, int flag);
......
...@@ -328,7 +328,7 @@ static int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode) ...@@ -328,7 +328,7 @@ static int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode)
* dentry - child directory dentry * dentry - child directory dentry
* *
* RETURN: -EINVAL - if name is . or .. * RETURN: -EINVAL - if name is . or ..
* -EINVAL - if . or .. exist but are invalid. * -EINVAL - if . or .. exist but are invalid.
* errors from subroutines * errors from subroutines
* *
* note: * note:
...@@ -517,7 +517,7 @@ static int jfs_unlink(struct inode *dip, struct dentry *dentry) ...@@ -517,7 +517,7 @@ static int jfs_unlink(struct inode *dip, struct dentry *dentry)
inode_dec_link_count(ip); inode_dec_link_count(ip);
/* /*
* commit zero link count object * commit zero link count object
*/ */
if (ip->i_nlink == 0) { if (ip->i_nlink == 0) {
assert(!test_cflag(COMMIT_Nolink, ip)); assert(!test_cflag(COMMIT_Nolink, ip));
...@@ -596,7 +596,7 @@ static int jfs_unlink(struct inode *dip, struct dentry *dentry) ...@@ -596,7 +596,7 @@ static int jfs_unlink(struct inode *dip, struct dentry *dentry)
/* /*
* NAME: commitZeroLink() * NAME: commitZeroLink()
* *
* FUNCTION: for non-directory, called by jfs_remove(), * FUNCTION: for non-directory, called by jfs_remove(),
* truncate a regular file, directory or symbolic * truncate a regular file, directory or symbolic
* link to zero length. return 0 if type is not * link to zero length. return 0 if type is not
* one of these. * one of these.
...@@ -676,7 +676,7 @@ static s64 commitZeroLink(tid_t tid, struct inode *ip) ...@@ -676,7 +676,7 @@ static s64 commitZeroLink(tid_t tid, struct inode *ip)
/* /*
* NAME: jfs_free_zero_link() * NAME: jfs_free_zero_link()
* *
* FUNCTION: for non-directory, called by iClose(), * FUNCTION: for non-directory, called by iClose(),
* free resources of a file from cache and WORKING map * free resources of a file from cache and WORKING map
* for a file previously committed with zero link count * for a file previously committed with zero link count
* while associated with a pager object, * while associated with a pager object,
...@@ -855,12 +855,12 @@ static int jfs_link(struct dentry *old_dentry, ...@@ -855,12 +855,12 @@ static int jfs_link(struct dentry *old_dentry,
* NAME: jfs_symlink(dip, dentry, name) * NAME: jfs_symlink(dip, dentry, name)
* *
* FUNCTION: creates a symbolic link to <symlink> by name <name> * FUNCTION: creates a symbolic link to <symlink> by name <name>
* in directory <dip> * in directory <dip>
* *
* PARAMETER: dip - parent directory vnode * PARAMETER: dip - parent directory vnode
* dentry - dentry of symbolic link * dentry - dentry of symbolic link
* name - the path name of the existing object * name - the path name of the existing object
* that will be the source of the link * that will be the source of the link
* *
* RETURN: errors from subroutines * RETURN: errors from subroutines
* *
...@@ -1052,9 +1052,9 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry, ...@@ -1052,9 +1052,9 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry,
/* /*
* NAME: jfs_rename * NAME: jfs_rename
* *
* FUNCTION: rename a file or directory * FUNCTION: rename a file or directory
*/ */
static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
struct inode *new_dir, struct dentry *new_dentry) struct inode *new_dir, struct dentry *new_dentry)
...@@ -1331,9 +1331,9 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -1331,9 +1331,9 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
/* /*
* NAME: jfs_mknod * NAME: jfs_mknod
* *
* FUNCTION: Create a special file (device) * FUNCTION: Create a special file (device)
*/ */
static int jfs_mknod(struct inode *dir, struct dentry *dentry, static int jfs_mknod(struct inode *dir, struct dentry *dentry,
int mode, dev_t rdev) int mode, dev_t rdev)
......
...@@ -29,17 +29,17 @@ ...@@ -29,17 +29,17 @@
#include "jfs_txnmgr.h" #include "jfs_txnmgr.h"
#include "jfs_debug.h" #include "jfs_debug.h"
#define BITSPERPAGE (PSIZE << 3) #define BITSPERPAGE (PSIZE << 3)
#define L2MEGABYTE 20 #define L2MEGABYTE 20
#define MEGABYTE (1 << L2MEGABYTE) #define MEGABYTE (1 << L2MEGABYTE)
#define MEGABYTE32 (MEGABYTE << 5) #define MEGABYTE32 (MEGABYTE << 5)
/* convert block number to bmap file page number */ /* convert block number to bmap file page number */
#define BLKTODMAPN(b)\ #define BLKTODMAPN(b)\
(((b) >> 13) + ((b) >> 23) + ((b) >> 33) + 3 + 1) (((b) >> 13) + ((b) >> 23) + ((b) >> 33) + 3 + 1)
/* /*
* jfs_extendfs() * jfs_extendfs()
* *
* function: extend file system; * function: extend file system;
* *
...@@ -48,9 +48,9 @@ ...@@ -48,9 +48,9 @@
* workspace space * workspace space
* *
* input: * input:
* new LVSize: in LV blocks (required) * new LVSize: in LV blocks (required)
* new LogSize: in LV blocks (optional) * new LogSize: in LV blocks (optional)
* new FSSize: in LV blocks (optional) * new FSSize: in LV blocks (optional)
* *
* new configuration: * new configuration:
* 1. set new LogSize as specified or default from new LVSize; * 1. set new LogSize as specified or default from new LVSize;
...@@ -125,8 +125,8 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize) ...@@ -125,8 +125,8 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
} }
/* /*
* reconfigure LV spaces * reconfigure LV spaces
* --------------------- * ---------------------
* *
* validate new size, or, if not specified, determine new size * validate new size, or, if not specified, determine new size
*/ */
...@@ -198,7 +198,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize) ...@@ -198,7 +198,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
log_formatted = 1; log_formatted = 1;
} }
/* /*
* quiesce file system * quiesce file system
* *
* (prepare to move the inline log and to prevent map update) * (prepare to move the inline log and to prevent map update)
* *
...@@ -270,8 +270,8 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize) ...@@ -270,8 +270,8 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
} }
/* /*
* extend block allocation map * extend block allocation map
* --------------------------- * ---------------------------
* *
* extendfs() for new extension, retry after crash recovery; * extendfs() for new extension, retry after crash recovery;
* *
...@@ -283,7 +283,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize) ...@@ -283,7 +283,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
* s_size: aggregate size in physical blocks; * s_size: aggregate size in physical blocks;
*/ */
/* /*
* compute the new block allocation map configuration * compute the new block allocation map configuration
* *
* map dinode: * map dinode:
* di_size: map file size in byte; * di_size: map file size in byte;
...@@ -301,7 +301,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize) ...@@ -301,7 +301,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
newNpages = BLKTODMAPN(t64) + 1; newNpages = BLKTODMAPN(t64) + 1;
/* /*
* extend map from current map (WITHOUT growing mapfile) * extend map from current map (WITHOUT growing mapfile)
* *
* map new extension with unmapped part of the last partial * map new extension with unmapped part of the last partial
* dmap page, if applicable, and extra page(s) allocated * dmap page, if applicable, and extra page(s) allocated
...@@ -341,8 +341,8 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize) ...@@ -341,8 +341,8 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
XSize -= nblocks; XSize -= nblocks;
/* /*
* grow map file to cover remaining extension * grow map file to cover remaining extension
* and/or one extra dmap page for next extendfs(); * and/or one extra dmap page for next extendfs();
* *
* allocate new map pages and its backing blocks, and * allocate new map pages and its backing blocks, and
* update map file xtree * update map file xtree
...@@ -422,8 +422,8 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize) ...@@ -422,8 +422,8 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
dbFinalizeBmap(ipbmap); dbFinalizeBmap(ipbmap);
/* /*
* update inode allocation map * update inode allocation map
* --------------------------- * ---------------------------
* *
* move iag lists from old to new iag; * move iag lists from old to new iag;
* agstart field is not updated for logredo() to reconstruct * agstart field is not updated for logredo() to reconstruct
...@@ -442,8 +442,8 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize) ...@@ -442,8 +442,8 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
} }
/* /*
* finalize * finalize
* -------- * --------
* *
* extension is committed when on-disk super block is * extension is committed when on-disk super block is
* updated with new descriptors: logredo will recover * updated with new descriptors: logredo will recover
...@@ -480,7 +480,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize) ...@@ -480,7 +480,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
diFreeSpecial(ipbmap2); diFreeSpecial(ipbmap2);
/* /*
* update superblock * update superblock
*/ */
if ((rc = readSuper(sb, &bh))) if ((rc = readSuper(sb, &bh)))
goto error_out; goto error_out;
...@@ -530,7 +530,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize) ...@@ -530,7 +530,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
resume: resume:
/* /*
* resume file system transactions * resume file system transactions
*/ */
txResume(sb); txResume(sb);
......
...@@ -63,9 +63,9 @@ ...@@ -63,9 +63,9 @@
* *
* On-disk: * On-disk:
* *
* FEALISTs are stored on disk using blocks allocated by dbAlloc() and * FEALISTs are stored on disk using blocks allocated by dbAlloc() and
* written directly. An EA list may be in-lined in the inode if there is * written directly. An EA list may be in-lined in the inode if there is
* sufficient room available. * sufficient room available.
*/ */
struct ea_buffer { struct ea_buffer {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment