diff options
Diffstat (limited to 'fs/jfs')
-rw-r--r-- | fs/jfs/file.c | 6 | ||||
-rw-r--r-- | fs/jfs/inode.c | 2 | ||||
-rw-r--r-- | fs/jfs/ioctl.c | 15 | ||||
-rw-r--r-- | fs/jfs/jfs_dmap.c | 12 | ||||
-rw-r--r-- | fs/jfs/jfs_extent.c | 14 | ||||
-rw-r--r-- | fs/jfs/jfs_extent.h | 4 | ||||
-rw-r--r-- | fs/jfs/jfs_imap.c | 26 | ||||
-rw-r--r-- | fs/jfs/jfs_imap.h | 4 | ||||
-rw-r--r-- | fs/jfs/jfs_metapage.h | 4 | ||||
-rw-r--r-- | fs/jfs/jfs_txnmgr.c | 16 | ||||
-rw-r--r-- | fs/jfs/jfs_types.h | 4 | ||||
-rw-r--r-- | fs/jfs/jfs_xtree.c | 2 | ||||
-rw-r--r-- | fs/jfs/namei.c | 22 | ||||
-rw-r--r-- | fs/jfs/xattr.c | 10 |
14 files changed, 66 insertions, 75 deletions
diff --git a/fs/jfs/file.c b/fs/jfs/file.c index 1c9745be5ada..976e90dc2d1b 100644 --- a/fs/jfs/file.c +++ b/fs/jfs/file.c | |||
@@ -103,13 +103,11 @@ struct inode_operations jfs_file_inode_operations = { | |||
103 | const struct file_operations jfs_file_operations = { | 103 | const struct file_operations jfs_file_operations = { |
104 | .open = jfs_open, | 104 | .open = jfs_open, |
105 | .llseek = generic_file_llseek, | 105 | .llseek = generic_file_llseek, |
106 | .write = generic_file_write, | 106 | .write = do_sync_write, |
107 | .read = generic_file_read, | 107 | .read = do_sync_read, |
108 | .aio_read = generic_file_aio_read, | 108 | .aio_read = generic_file_aio_read, |
109 | .aio_write = generic_file_aio_write, | 109 | .aio_write = generic_file_aio_write, |
110 | .mmap = generic_file_mmap, | 110 | .mmap = generic_file_mmap, |
111 | .readv = generic_file_readv, | ||
112 | .writev = generic_file_writev, | ||
113 | .sendfile = generic_file_sendfile, | 111 | .sendfile = generic_file_sendfile, |
114 | .fsync = jfs_fsync, | 112 | .fsync = jfs_fsync, |
115 | .release = jfs_release, | 113 | .release = jfs_release, |
diff --git a/fs/jfs/inode.c b/fs/jfs/inode.c index a223cf4faa9b..a8cc169235d9 100644 --- a/fs/jfs/inode.c +++ b/fs/jfs/inode.c | |||
@@ -227,7 +227,7 @@ int jfs_get_block(struct inode *ip, sector_t lblock, | |||
227 | #ifdef _JFS_4K | 227 | #ifdef _JFS_4K |
228 | if ((rc = extHint(ip, lblock64 << ip->i_sb->s_blocksize_bits, &xad))) | 228 | if ((rc = extHint(ip, lblock64 << ip->i_sb->s_blocksize_bits, &xad))) |
229 | goto unlock; | 229 | goto unlock; |
230 | rc = extAlloc(ip, xlen, lblock64, &xad, FALSE); | 230 | rc = extAlloc(ip, xlen, lblock64, &xad, false); |
231 | if (rc) | 231 | if (rc) |
232 | goto unlock; | 232 | goto unlock; |
233 | 233 | ||
diff --git a/fs/jfs/ioctl.c b/fs/jfs/ioctl.c index 67b3774820eb..37db52488262 100644 --- a/fs/jfs/ioctl.c +++ b/fs/jfs/ioctl.c | |||
@@ -6,7 +6,6 @@ | |||
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include <linux/fs.h> | 8 | #include <linux/fs.h> |
9 | #include <linux/ext2_fs.h> | ||
10 | #include <linux/ctype.h> | 9 | #include <linux/ctype.h> |
11 | #include <linux/capability.h> | 10 | #include <linux/capability.h> |
12 | #include <linux/time.h> | 11 | #include <linux/time.h> |
@@ -22,13 +21,13 @@ static struct { | |||
22 | long jfs_flag; | 21 | long jfs_flag; |
23 | long ext2_flag; | 22 | long ext2_flag; |
24 | } jfs_map[] = { | 23 | } jfs_map[] = { |
25 | {JFS_NOATIME_FL, EXT2_NOATIME_FL}, | 24 | {JFS_NOATIME_FL, FS_NOATIME_FL}, |
26 | {JFS_DIRSYNC_FL, EXT2_DIRSYNC_FL}, | 25 | {JFS_DIRSYNC_FL, FS_DIRSYNC_FL}, |
27 | {JFS_SYNC_FL, EXT2_SYNC_FL}, | 26 | {JFS_SYNC_FL, FS_SYNC_FL}, |
28 | {JFS_SECRM_FL, EXT2_SECRM_FL}, | 27 | {JFS_SECRM_FL, FS_SECRM_FL}, |
29 | {JFS_UNRM_FL, EXT2_UNRM_FL}, | 28 | {JFS_UNRM_FL, FS_UNRM_FL}, |
30 | {JFS_APPEND_FL, EXT2_APPEND_FL}, | 29 | {JFS_APPEND_FL, FS_APPEND_FL}, |
31 | {JFS_IMMUTABLE_FL, EXT2_IMMUTABLE_FL}, | 30 | {JFS_IMMUTABLE_FL, FS_IMMUTABLE_FL}, |
32 | {0, 0}, | 31 | {0, 0}, |
33 | }; | 32 | }; |
34 | 33 | ||
diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c index c161c98954e0..f05ebb629182 100644 --- a/fs/jfs/jfs_dmap.c +++ b/fs/jfs/jfs_dmap.c | |||
@@ -403,8 +403,8 @@ int dbFree(struct inode *ip, s64 blkno, s64 nblocks) | |||
403 | * | 403 | * |
404 | * PARAMETERS: | 404 | * PARAMETERS: |
405 | * ipbmap - pointer to in-core inode for the block map. | 405 | * ipbmap - pointer to in-core inode for the block map. |
406 | * free - TRUE if block range is to be freed from the persistent | 406 | * free - 'true' if block range is to be freed from the persistent |
407 | * map; FALSE if it is to be allocated. | 407 | * map; 'false' if it is to be allocated. |
408 | * blkno - starting block number of the range. | 408 | * blkno - starting block number of the range. |
409 | * nblocks - number of contiguous blocks in the range. | 409 | * nblocks - number of contiguous blocks in the range. |
410 | * tblk - transaction block; | 410 | * tblk - transaction block; |
@@ -2394,7 +2394,7 @@ static int dbFreeBits(struct bmap * bmp, struct dmap * dp, s64 blkno, | |||
2394 | * requires the dmap control page to be adjusted. | 2394 | * requires the dmap control page to be adjusted. |
2395 | * newval - the new value of the lower level dmap or dmap control | 2395 | * newval - the new value of the lower level dmap or dmap control |
2396 | * page root. | 2396 | * page root. |
2397 | * alloc - TRUE if adjustment is due to an allocation. | 2397 | * alloc - 'true' if adjustment is due to an allocation. |
2398 | * level - current level of dmap control page (i.e. L0, L1, L2) to | 2398 | * level - current level of dmap control page (i.e. L0, L1, L2) to |
2399 | * be adjusted. | 2399 | * be adjusted. |
2400 | * | 2400 | * |
@@ -3290,7 +3290,7 @@ int dbExtendFS(struct inode *ipbmap, s64 blkno, s64 nblocks) | |||
3290 | { | 3290 | { |
3291 | struct jfs_sb_info *sbi = JFS_SBI(ipbmap->i_sb); | 3291 | struct jfs_sb_info *sbi = JFS_SBI(ipbmap->i_sb); |
3292 | int nbperpage = sbi->nbperpage; | 3292 | int nbperpage = sbi->nbperpage; |
3293 | int i, i0 = TRUE, j, j0 = TRUE, k, n; | 3293 | int i, i0 = true, j, j0 = true, k, n; |
3294 | s64 newsize; | 3294 | s64 newsize; |
3295 | s64 p; | 3295 | s64 p; |
3296 | struct metapage *mp, *l2mp, *l1mp = NULL, *l0mp = NULL; | 3296 | struct metapage *mp, *l2mp, *l1mp = NULL, *l0mp = NULL; |
@@ -3398,7 +3398,7 @@ int dbExtendFS(struct inode *ipbmap, s64 blkno, s64 nblocks) | |||
3398 | j = (blkno & (MAXL1SIZE - 1)) >> L2MAXL0SIZE; | 3398 | j = (blkno & (MAXL1SIZE - 1)) >> L2MAXL0SIZE; |
3399 | l1leaf = l1dcp->stree + CTLLEAFIND + j; | 3399 | l1leaf = l1dcp->stree + CTLLEAFIND + j; |
3400 | p = BLKTOL0(blkno, sbi->l2nbperpage); | 3400 | p = BLKTOL0(blkno, sbi->l2nbperpage); |
3401 | j0 = FALSE; | 3401 | j0 = false; |
3402 | } else { | 3402 | } else { |
3403 | /* assign/init L1 page */ | 3403 | /* assign/init L1 page */ |
3404 | l1mp = get_metapage(ipbmap, p, PSIZE, 0); | 3404 | l1mp = get_metapage(ipbmap, p, PSIZE, 0); |
@@ -3432,7 +3432,7 @@ int dbExtendFS(struct inode *ipbmap, s64 blkno, s64 nblocks) | |||
3432 | l0leaf = l0dcp->stree + CTLLEAFIND + i; | 3432 | l0leaf = l0dcp->stree + CTLLEAFIND + i; |
3433 | p = BLKTODMAP(blkno, | 3433 | p = BLKTODMAP(blkno, |
3434 | sbi->l2nbperpage); | 3434 | sbi->l2nbperpage); |
3435 | i0 = FALSE; | 3435 | i0 = false; |
3436 | } else { | 3436 | } else { |
3437 | /* assign/init L0 page */ | 3437 | /* assign/init L0 page */ |
3438 | l0mp = get_metapage(ipbmap, p, PSIZE, 0); | 3438 | l0mp = get_metapage(ipbmap, p, PSIZE, 0); |
diff --git a/fs/jfs/jfs_extent.c b/fs/jfs/jfs_extent.c index 4c74f0944f7e..933b7457bfbd 100644 --- a/fs/jfs/jfs_extent.c +++ b/fs/jfs/jfs_extent.c | |||
@@ -74,7 +74,7 @@ static s64 extRoundDown(s64 nb); | |||
74 | * extent that is used as an allocation hint if the | 74 | * extent that is used as an allocation hint if the |
75 | * xaddr of the xad is non-zero. on successful exit, | 75 | * xaddr of the xad is non-zero. on successful exit, |
76 | * the xad describes the newly allocated extent. | 76 | * the xad describes the newly allocated extent. |
77 | * abnr - boolean_t indicating whether the newly allocated extent | 77 | * abnr - bool indicating whether the newly allocated extent |
78 | * should be marked as allocated but not recorded. | 78 | * should be marked as allocated but not recorded. |
79 | * | 79 | * |
80 | * RETURN VALUES: | 80 | * RETURN VALUES: |
@@ -83,7 +83,7 @@ static s64 extRoundDown(s64 nb); | |||
83 | * -ENOSPC - insufficient disk resources. | 83 | * -ENOSPC - insufficient disk resources. |
84 | */ | 84 | */ |
85 | int | 85 | int |
86 | extAlloc(struct inode *ip, s64 xlen, s64 pno, xad_t * xp, boolean_t abnr) | 86 | extAlloc(struct inode *ip, s64 xlen, s64 pno, xad_t * xp, bool abnr) |
87 | { | 87 | { |
88 | struct jfs_sb_info *sbi = JFS_SBI(ip->i_sb); | 88 | struct jfs_sb_info *sbi = JFS_SBI(ip->i_sb); |
89 | s64 nxlen, nxaddr, xoff, hint, xaddr = 0; | 89 | s64 nxlen, nxaddr, xoff, hint, xaddr = 0; |
@@ -117,7 +117,7 @@ extAlloc(struct inode *ip, s64 xlen, s64 pno, xad_t * xp, boolean_t abnr) | |||
117 | * following the hint extent. | 117 | * following the hint extent. |
118 | */ | 118 | */ |
119 | if (offsetXAD(xp) + nxlen == xoff && | 119 | if (offsetXAD(xp) + nxlen == xoff && |
120 | abnr == ((xp->flag & XAD_NOTRECORDED) ? TRUE : FALSE)) | 120 | abnr == ((xp->flag & XAD_NOTRECORDED) ? true : false)) |
121 | xaddr = hint + nxlen; | 121 | xaddr = hint + nxlen; |
122 | 122 | ||
123 | /* adjust the hint to the last block of the extent */ | 123 | /* adjust the hint to the last block of the extent */ |
@@ -148,7 +148,7 @@ extAlloc(struct inode *ip, s64 xlen, s64 pno, xad_t * xp, boolean_t abnr) | |||
148 | } | 148 | } |
149 | 149 | ||
150 | /* determine the value of the extent flag */ | 150 | /* determine the value of the extent flag */ |
151 | xflag = (abnr == TRUE) ? XAD_NOTRECORDED : 0; | 151 | xflag = abnr ? XAD_NOTRECORDED : 0; |
152 | 152 | ||
153 | /* if we can extend the hint extent to cover the current request, | 153 | /* if we can extend the hint extent to cover the current request, |
154 | * extend it. otherwise, insert a new extent to | 154 | * extend it. otherwise, insert a new extent to |
@@ -203,7 +203,7 @@ extAlloc(struct inode *ip, s64 xlen, s64 pno, xad_t * xp, boolean_t abnr) | |||
203 | * xlen - request size of the resulting extent. | 203 | * xlen - request size of the resulting extent. |
204 | * xp - pointer to an xad. on successful exit, the xad | 204 | * xp - pointer to an xad. on successful exit, the xad |
205 | * describes the newly allocated extent. | 205 | * describes the newly allocated extent. |
206 | * abnr - boolean_t indicating whether the newly allocated extent | 206 | * abnr - bool indicating whether the newly allocated extent |
207 | * should be marked as allocated but not recorded. | 207 | * should be marked as allocated but not recorded. |
208 | * | 208 | * |
209 | * RETURN VALUES: | 209 | * RETURN VALUES: |
@@ -211,7 +211,7 @@ extAlloc(struct inode *ip, s64 xlen, s64 pno, xad_t * xp, boolean_t abnr) | |||
211 | * -EIO - i/o error. | 211 | * -EIO - i/o error. |
212 | * -ENOSPC - insufficient disk resources. | 212 | * -ENOSPC - insufficient disk resources. |
213 | */ | 213 | */ |
214 | int extRealloc(struct inode *ip, s64 nxlen, xad_t * xp, boolean_t abnr) | 214 | int extRealloc(struct inode *ip, s64 nxlen, xad_t * xp, bool abnr) |
215 | { | 215 | { |
216 | struct super_block *sb = ip->i_sb; | 216 | struct super_block *sb = ip->i_sb; |
217 | s64 xaddr, xlen, nxaddr, delta, xoff; | 217 | s64 xaddr, xlen, nxaddr, delta, xoff; |
@@ -476,7 +476,7 @@ int extFill(struct inode *ip, xad_t * xp) | |||
476 | XADaddress(xp, 0); | 476 | XADaddress(xp, 0); |
477 | 477 | ||
478 | /* allocate an extent to fill the hole */ | 478 | /* allocate an extent to fill the hole */ |
479 | if ((rc = extAlloc(ip, nbperpage, blkno, xp, FALSE))) | 479 | if ((rc = extAlloc(ip, nbperpage, blkno, xp, false))) |
480 | return (rc); | 480 | return (rc); |
481 | 481 | ||
482 | assert(lengthPXD(xp) == nbperpage); | 482 | assert(lengthPXD(xp) == nbperpage); |
diff --git a/fs/jfs/jfs_extent.h b/fs/jfs/jfs_extent.h index e80fc7ced87d..3a7f3f22e989 100644 --- a/fs/jfs/jfs_extent.h +++ b/fs/jfs/jfs_extent.h | |||
@@ -22,10 +22,10 @@ | |||
22 | #define INOHINT(ip) \ | 22 | #define INOHINT(ip) \ |
23 | (addressPXD(&(JFS_IP(ip)->ixpxd)) + lengthPXD(&(JFS_IP(ip)->ixpxd)) - 1) | 23 | (addressPXD(&(JFS_IP(ip)->ixpxd)) + lengthPXD(&(JFS_IP(ip)->ixpxd)) - 1) |
24 | 24 | ||
25 | extern int extAlloc(struct inode *, s64, s64, xad_t *, boolean_t); | 25 | extern int extAlloc(struct inode *, s64, s64, xad_t *, bool); |
26 | extern int extFill(struct inode *, xad_t *); | 26 | extern int extFill(struct inode *, xad_t *); |
27 | extern int extHint(struct inode *, s64, xad_t *); | 27 | extern int extHint(struct inode *, s64, xad_t *); |
28 | extern int extRealloc(struct inode *, s64, xad_t *, boolean_t); | 28 | extern int extRealloc(struct inode *, s64, xad_t *, bool); |
29 | extern int extRecord(struct inode *, xad_t *); | 29 | extern int extRecord(struct inode *, xad_t *); |
30 | 30 | ||
31 | #endif /* _H_JFS_EXTENT */ | 31 | #endif /* _H_JFS_EXTENT */ |
diff --git a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c index 369d7f39c040..a45ee2489580 100644 --- a/fs/jfs/jfs_imap.c +++ b/fs/jfs/jfs_imap.c | |||
@@ -78,8 +78,8 @@ static HLIST_HEAD(aggregate_hash); | |||
78 | /* | 78 | /* |
79 | * forward references | 79 | * forward references |
80 | */ | 80 | */ |
81 | static int diAllocAG(struct inomap *, int, boolean_t, struct inode *); | 81 | static int diAllocAG(struct inomap *, int, bool, struct inode *); |
82 | static int diAllocAny(struct inomap *, int, boolean_t, struct inode *); | 82 | static int diAllocAny(struct inomap *, int, bool, struct inode *); |
83 | static int diAllocBit(struct inomap *, struct iag *, int); | 83 | static int diAllocBit(struct inomap *, struct iag *, int); |
84 | static int diAllocExt(struct inomap *, int, struct inode *); | 84 | static int diAllocExt(struct inomap *, int, struct inode *); |
85 | static int diAllocIno(struct inomap *, int, struct inode *); | 85 | static int diAllocIno(struct inomap *, int, struct inode *); |
@@ -1345,7 +1345,7 @@ diInitInode(struct inode *ip, int iagno, int ino, int extno, struct iag * iagp) | |||
1345 | * | 1345 | * |
1346 | * PARAMETERS: | 1346 | * PARAMETERS: |
1347 | * pip - pointer to incore inode for the parent inode. | 1347 | * pip - pointer to incore inode for the parent inode. |
1348 | * dir - TRUE if the new disk inode is for a directory. | 1348 | * dir - 'true' if the new disk inode is for a directory. |
1349 | * ip - pointer to a new inode | 1349 | * ip - pointer to a new inode |
1350 | * | 1350 | * |
1351 | * RETURN VALUES: | 1351 | * RETURN VALUES: |
@@ -1353,7 +1353,7 @@ diInitInode(struct inode *ip, int iagno, int ino, int extno, struct iag * iagp) | |||
1353 | * -ENOSPC - insufficient disk resources. | 1353 | * -ENOSPC - insufficient disk resources. |
1354 | * -EIO - i/o error. | 1354 | * -EIO - i/o error. |
1355 | */ | 1355 | */ |
1356 | int diAlloc(struct inode *pip, boolean_t dir, struct inode *ip) | 1356 | int diAlloc(struct inode *pip, bool dir, struct inode *ip) |
1357 | { | 1357 | { |
1358 | int rc, ino, iagno, addext, extno, bitno, sword; | 1358 | int rc, ino, iagno, addext, extno, bitno, sword; |
1359 | int nwords, rem, i, agno; | 1359 | int nwords, rem, i, agno; |
@@ -1375,7 +1375,7 @@ int diAlloc(struct inode *pip, boolean_t dir, struct inode *ip) | |||
1375 | /* for a directory, the allocation policy is to start | 1375 | /* for a directory, the allocation policy is to start |
1376 | * at the ag level using the preferred ag. | 1376 | * at the ag level using the preferred ag. |
1377 | */ | 1377 | */ |
1378 | if (dir == TRUE) { | 1378 | if (dir) { |
1379 | agno = dbNextAG(JFS_SBI(pip->i_sb)->ipbmap); | 1379 | agno = dbNextAG(JFS_SBI(pip->i_sb)->ipbmap); |
1380 | AG_LOCK(imap, agno); | 1380 | AG_LOCK(imap, agno); |
1381 | goto tryag; | 1381 | goto tryag; |
@@ -1651,7 +1651,7 @@ int diAlloc(struct inode *pip, boolean_t dir, struct inode *ip) | |||
1651 | * PARAMETERS: | 1651 | * PARAMETERS: |
1652 | * imap - pointer to inode map control structure. | 1652 | * imap - pointer to inode map control structure. |
1653 | * agno - allocation group to allocate from. | 1653 | * agno - allocation group to allocate from. |
1654 | * dir - TRUE if the new disk inode is for a directory. | 1654 | * dir - 'true' if the new disk inode is for a directory. |
1655 | * ip - pointer to the new inode to be filled in on successful return | 1655 | * ip - pointer to the new inode to be filled in on successful return |
1656 | * with the disk inode number allocated, its extent address | 1656 | * with the disk inode number allocated, its extent address |
1657 | * and the start of the ag. | 1657 | * and the start of the ag. |
@@ -1662,7 +1662,7 @@ int diAlloc(struct inode *pip, boolean_t dir, struct inode *ip) | |||
1662 | * -EIO - i/o error. | 1662 | * -EIO - i/o error. |
1663 | */ | 1663 | */ |
1664 | static int | 1664 | static int |
1665 | diAllocAG(struct inomap * imap, int agno, boolean_t dir, struct inode *ip) | 1665 | diAllocAG(struct inomap * imap, int agno, bool dir, struct inode *ip) |
1666 | { | 1666 | { |
1667 | int rc, addext, numfree, numinos; | 1667 | int rc, addext, numfree, numinos; |
1668 | 1668 | ||
@@ -1682,7 +1682,7 @@ diAllocAG(struct inomap * imap, int agno, boolean_t dir, struct inode *ip) | |||
1682 | * if there are a small number of free inodes or number of free | 1682 | * if there are a small number of free inodes or number of free |
1683 | * inodes is a small percentage of the number of backed inodes. | 1683 | * inodes is a small percentage of the number of backed inodes. |
1684 | */ | 1684 | */ |
1685 | if (dir == TRUE) | 1685 | if (dir) |
1686 | addext = (numfree < 64 || | 1686 | addext = (numfree < 64 || |
1687 | (numfree < 256 | 1687 | (numfree < 256 |
1688 | && ((numfree * 100) / numinos) <= 20)); | 1688 | && ((numfree * 100) / numinos) <= 20)); |
@@ -1721,7 +1721,7 @@ diAllocAG(struct inomap * imap, int agno, boolean_t dir, struct inode *ip) | |||
1721 | * PARAMETERS: | 1721 | * PARAMETERS: |
1722 | * imap - pointer to inode map control structure. | 1722 | * imap - pointer to inode map control structure. |
1723 | * agno - primary allocation group (to avoid). | 1723 | * agno - primary allocation group (to avoid). |
1724 | * dir - TRUE if the new disk inode is for a directory. | 1724 | * dir - 'true' if the new disk inode is for a directory. |
1725 | * ip - pointer to a new inode to be filled in on successful return | 1725 | * ip - pointer to a new inode to be filled in on successful return |
1726 | * with the disk inode number allocated, its extent address | 1726 | * with the disk inode number allocated, its extent address |
1727 | * and the start of the ag. | 1727 | * and the start of the ag. |
@@ -1732,7 +1732,7 @@ diAllocAG(struct inomap * imap, int agno, boolean_t dir, struct inode *ip) | |||
1732 | * -EIO - i/o error. | 1732 | * -EIO - i/o error. |
1733 | */ | 1733 | */ |
1734 | static int | 1734 | static int |
1735 | diAllocAny(struct inomap * imap, int agno, boolean_t dir, struct inode *ip) | 1735 | diAllocAny(struct inomap * imap, int agno, bool dir, struct inode *ip) |
1736 | { | 1736 | { |
1737 | int ag, rc; | 1737 | int ag, rc; |
1738 | int maxag = JFS_SBI(imap->im_ipimap->i_sb)->bmap->db_maxag; | 1738 | int maxag = JFS_SBI(imap->im_ipimap->i_sb)->bmap->db_maxag; |
@@ -2749,7 +2749,7 @@ static int diFindFree(u32 word, int start) | |||
2749 | * PARAMETERS: | 2749 | * PARAMETERS: |
2750 | * ipimap - Incore inode map inode | 2750 | * ipimap - Incore inode map inode |
2751 | * inum - Number of inode to mark in permanent map | 2751 | * inum - Number of inode to mark in permanent map |
2752 | * is_free - If TRUE indicates inode should be marked freed, otherwise | 2752 | * is_free - If 'true' indicates inode should be marked freed, otherwise |
2753 | * indicates inode should be marked allocated. | 2753 | * indicates inode should be marked allocated. |
2754 | * | 2754 | * |
2755 | * RETURN VALUES: | 2755 | * RETURN VALUES: |
@@ -2757,7 +2757,7 @@ static int diFindFree(u32 word, int start) | |||
2757 | */ | 2757 | */ |
2758 | int | 2758 | int |
2759 | diUpdatePMap(struct inode *ipimap, | 2759 | diUpdatePMap(struct inode *ipimap, |
2760 | unsigned long inum, boolean_t is_free, struct tblock * tblk) | 2760 | unsigned long inum, bool is_free, struct tblock * tblk) |
2761 | { | 2761 | { |
2762 | int rc; | 2762 | int rc; |
2763 | struct iag *iagp; | 2763 | struct iag *iagp; |
@@ -2796,7 +2796,7 @@ diUpdatePMap(struct inode *ipimap, | |||
2796 | /* | 2796 | /* |
2797 | * mark the inode free in persistent map: | 2797 | * mark the inode free in persistent map: |
2798 | */ | 2798 | */ |
2799 | if (is_free == TRUE) { | 2799 | if (is_free) { |
2800 | /* The inode should have been allocated both in working | 2800 | /* The inode should have been allocated both in working |
2801 | * map and in persistent map; | 2801 | * map and in persistent map; |
2802 | * the inode will be freed from working map at the release | 2802 | * the inode will be freed from working map at the release |
diff --git a/fs/jfs/jfs_imap.h b/fs/jfs/jfs_imap.h index 6e24465f0f98..e3b7db47db6b 100644 --- a/fs/jfs/jfs_imap.h +++ b/fs/jfs/jfs_imap.h | |||
@@ -159,11 +159,11 @@ struct inomap { | |||
159 | #define im_maxag im_imap.in_maxag | 159 | #define im_maxag im_imap.in_maxag |
160 | 160 | ||
161 | extern int diFree(struct inode *); | 161 | extern int diFree(struct inode *); |
162 | extern int diAlloc(struct inode *, boolean_t, struct inode *); | 162 | extern int diAlloc(struct inode *, bool, struct inode *); |
163 | extern int diSync(struct inode *); | 163 | extern int diSync(struct inode *); |
164 | /* external references */ | 164 | /* external references */ |
165 | extern int diUpdatePMap(struct inode *ipimap, unsigned long inum, | 165 | extern int diUpdatePMap(struct inode *ipimap, unsigned long inum, |
166 | boolean_t is_free, struct tblock * tblk); | 166 | bool is_free, struct tblock * tblk); |
167 | extern int diExtendFS(struct inode *ipimap, struct inode *ipbmap); | 167 | extern int diExtendFS(struct inode *ipimap, struct inode *ipbmap); |
168 | extern int diMount(struct inode *); | 168 | extern int diMount(struct inode *); |
169 | extern int diUnmount(struct inode *, int); | 169 | extern int diUnmount(struct inode *, int); |
diff --git a/fs/jfs/jfs_metapage.h b/fs/jfs/jfs_metapage.h index d17a3290f5aa..01a5a455e012 100644 --- a/fs/jfs/jfs_metapage.h +++ b/fs/jfs/jfs_metapage.h | |||
@@ -65,10 +65,10 @@ extern struct metapage *__get_metapage(struct inode *inode, | |||
65 | int absolute, unsigned long new); | 65 | int absolute, unsigned long new); |
66 | 66 | ||
67 | #define read_metapage(inode, lblock, size, absolute)\ | 67 | #define read_metapage(inode, lblock, size, absolute)\ |
68 | __get_metapage(inode, lblock, size, absolute, FALSE) | 68 | __get_metapage(inode, lblock, size, absolute, false) |
69 | 69 | ||
70 | #define get_metapage(inode, lblock, size, absolute)\ | 70 | #define get_metapage(inode, lblock, size, absolute)\ |
71 | __get_metapage(inode, lblock, size, absolute, TRUE) | 71 | __get_metapage(inode, lblock, size, absolute, true) |
72 | 72 | ||
73 | extern void release_metapage(struct metapage *); | 73 | extern void release_metapage(struct metapage *); |
74 | extern void grab_metapage(struct metapage *); | 74 | extern void grab_metapage(struct metapage *); |
diff --git a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c index 3856efc399c1..ebfa6c061d78 100644 --- a/fs/jfs/jfs_txnmgr.c +++ b/fs/jfs/jfs_txnmgr.c | |||
@@ -2393,7 +2393,7 @@ static void txUpdateMap(struct tblock * tblk) | |||
2393 | * unlock mapper/write lock | 2393 | * unlock mapper/write lock |
2394 | */ | 2394 | */ |
2395 | if (tblk->xflag & COMMIT_CREATE) { | 2395 | if (tblk->xflag & COMMIT_CREATE) { |
2396 | diUpdatePMap(ipimap, tblk->ino, FALSE, tblk); | 2396 | diUpdatePMap(ipimap, tblk->ino, false, tblk); |
2397 | /* update persistent block allocation map | 2397 | /* update persistent block allocation map |
2398 | * for the allocation of inode extent; | 2398 | * for the allocation of inode extent; |
2399 | */ | 2399 | */ |
@@ -2403,7 +2403,7 @@ static void txUpdateMap(struct tblock * tblk) | |||
2403 | txAllocPMap(ipimap, (struct maplock *) & pxdlock, tblk); | 2403 | txAllocPMap(ipimap, (struct maplock *) & pxdlock, tblk); |
2404 | } else if (tblk->xflag & COMMIT_DELETE) { | 2404 | } else if (tblk->xflag & COMMIT_DELETE) { |
2405 | ip = tblk->u.ip; | 2405 | ip = tblk->u.ip; |
2406 | diUpdatePMap(ipimap, ip->i_ino, TRUE, tblk); | 2406 | diUpdatePMap(ipimap, ip->i_ino, true, tblk); |
2407 | iput(ip); | 2407 | iput(ip); |
2408 | } | 2408 | } |
2409 | } | 2409 | } |
@@ -2451,7 +2451,7 @@ static void txAllocPMap(struct inode *ip, struct maplock * maplock, | |||
2451 | if (xad->flag & (XAD_NEW | XAD_EXTENDED)) { | 2451 | if (xad->flag & (XAD_NEW | XAD_EXTENDED)) { |
2452 | xaddr = addressXAD(xad); | 2452 | xaddr = addressXAD(xad); |
2453 | xlen = lengthXAD(xad); | 2453 | xlen = lengthXAD(xad); |
2454 | dbUpdatePMap(ipbmap, FALSE, xaddr, | 2454 | dbUpdatePMap(ipbmap, false, xaddr, |
2455 | (s64) xlen, tblk); | 2455 | (s64) xlen, tblk); |
2456 | xad->flag &= ~(XAD_NEW | XAD_EXTENDED); | 2456 | xad->flag &= ~(XAD_NEW | XAD_EXTENDED); |
2457 | jfs_info("allocPMap: xaddr:0x%lx xlen:%d", | 2457 | jfs_info("allocPMap: xaddr:0x%lx xlen:%d", |
@@ -2462,7 +2462,7 @@ static void txAllocPMap(struct inode *ip, struct maplock * maplock, | |||
2462 | pxdlock = (struct pxd_lock *) maplock; | 2462 | pxdlock = (struct pxd_lock *) maplock; |
2463 | xaddr = addressPXD(&pxdlock->pxd); | 2463 | xaddr = addressPXD(&pxdlock->pxd); |
2464 | xlen = lengthPXD(&pxdlock->pxd); | 2464 | xlen = lengthPXD(&pxdlock->pxd); |
2465 | dbUpdatePMap(ipbmap, FALSE, xaddr, (s64) xlen, tblk); | 2465 | dbUpdatePMap(ipbmap, false, xaddr, (s64) xlen, tblk); |
2466 | jfs_info("allocPMap: xaddr:0x%lx xlen:%d", (ulong) xaddr, xlen); | 2466 | jfs_info("allocPMap: xaddr:0x%lx xlen:%d", (ulong) xaddr, xlen); |
2467 | } else { /* (maplock->flag & mlckALLOCPXDLIST) */ | 2467 | } else { /* (maplock->flag & mlckALLOCPXDLIST) */ |
2468 | 2468 | ||
@@ -2471,7 +2471,7 @@ static void txAllocPMap(struct inode *ip, struct maplock * maplock, | |||
2471 | for (n = 0; n < pxdlistlock->count; n++, pxd++) { | 2471 | for (n = 0; n < pxdlistlock->count; n++, pxd++) { |
2472 | xaddr = addressPXD(pxd); | 2472 | xaddr = addressPXD(pxd); |
2473 | xlen = lengthPXD(pxd); | 2473 | xlen = lengthPXD(pxd); |
2474 | dbUpdatePMap(ipbmap, FALSE, xaddr, (s64) xlen, | 2474 | dbUpdatePMap(ipbmap, false, xaddr, (s64) xlen, |
2475 | tblk); | 2475 | tblk); |
2476 | jfs_info("allocPMap: xaddr:0x%lx xlen:%d", | 2476 | jfs_info("allocPMap: xaddr:0x%lx xlen:%d", |
2477 | (ulong) xaddr, xlen); | 2477 | (ulong) xaddr, xlen); |
@@ -2513,7 +2513,7 @@ void txFreeMap(struct inode *ip, | |||
2513 | if (!(xad->flag & XAD_NEW)) { | 2513 | if (!(xad->flag & XAD_NEW)) { |
2514 | xaddr = addressXAD(xad); | 2514 | xaddr = addressXAD(xad); |
2515 | xlen = lengthXAD(xad); | 2515 | xlen = lengthXAD(xad); |
2516 | dbUpdatePMap(ipbmap, TRUE, xaddr, | 2516 | dbUpdatePMap(ipbmap, true, xaddr, |
2517 | (s64) xlen, tblk); | 2517 | (s64) xlen, tblk); |
2518 | jfs_info("freePMap: xaddr:0x%lx " | 2518 | jfs_info("freePMap: xaddr:0x%lx " |
2519 | "xlen:%d", | 2519 | "xlen:%d", |
@@ -2524,7 +2524,7 @@ void txFreeMap(struct inode *ip, | |||
2524 | pxdlock = (struct pxd_lock *) maplock; | 2524 | pxdlock = (struct pxd_lock *) maplock; |
2525 | xaddr = addressPXD(&pxdlock->pxd); | 2525 | xaddr = addressPXD(&pxdlock->pxd); |
2526 | xlen = lengthPXD(&pxdlock->pxd); | 2526 | xlen = lengthPXD(&pxdlock->pxd); |
2527 | dbUpdatePMap(ipbmap, TRUE, xaddr, (s64) xlen, | 2527 | dbUpdatePMap(ipbmap, true, xaddr, (s64) xlen, |
2528 | tblk); | 2528 | tblk); |
2529 | jfs_info("freePMap: xaddr:0x%lx xlen:%d", | 2529 | jfs_info("freePMap: xaddr:0x%lx xlen:%d", |
2530 | (ulong) xaddr, xlen); | 2530 | (ulong) xaddr, xlen); |
@@ -2535,7 +2535,7 @@ void txFreeMap(struct inode *ip, | |||
2535 | for (n = 0; n < pxdlistlock->count; n++, pxd++) { | 2535 | for (n = 0; n < pxdlistlock->count; n++, pxd++) { |
2536 | xaddr = addressPXD(pxd); | 2536 | xaddr = addressPXD(pxd); |
2537 | xlen = lengthPXD(pxd); | 2537 | xlen = lengthPXD(pxd); |
2538 | dbUpdatePMap(ipbmap, TRUE, xaddr, | 2538 | dbUpdatePMap(ipbmap, true, xaddr, |
2539 | (s64) xlen, tblk); | 2539 | (s64) xlen, tblk); |
2540 | jfs_info("freePMap: xaddr:0x%lx xlen:%d", | 2540 | jfs_info("freePMap: xaddr:0x%lx xlen:%d", |
2541 | (ulong) xaddr, xlen); | 2541 | (ulong) xaddr, xlen); |
diff --git a/fs/jfs/jfs_types.h b/fs/jfs/jfs_types.h index 5bfad39a2078..09b252958687 100644 --- a/fs/jfs/jfs_types.h +++ b/fs/jfs/jfs_types.h | |||
@@ -57,10 +57,6 @@ struct timestruc_t { | |||
57 | #define HIGHORDER 0x80000000u /* high order bit on */ | 57 | #define HIGHORDER 0x80000000u /* high order bit on */ |
58 | #define ONES 0xffffffffu /* all bit on */ | 58 | #define ONES 0xffffffffu /* all bit on */ |
59 | 59 | ||
60 | typedef int boolean_t; | ||
61 | #define TRUE 1 | ||
62 | #define FALSE 0 | ||
63 | |||
64 | /* | 60 | /* |
65 | * logical xd (lxd) | 61 | * logical xd (lxd) |
66 | */ | 62 | */ |
diff --git a/fs/jfs/jfs_xtree.c b/fs/jfs/jfs_xtree.c index e72f4ebb6e9c..c92307d3a57e 100644 --- a/fs/jfs/jfs_xtree.c +++ b/fs/jfs/jfs_xtree.c | |||
@@ -2964,7 +2964,7 @@ xtRelocate(tid_t tid, struct inode * ip, xad_t * oxad, /* old XAD */ | |||
2964 | cmSetXD(ip, cp, pno, dxaddr, nblks); | 2964 | cmSetXD(ip, cp, pno, dxaddr, nblks); |
2965 | 2965 | ||
2966 | /* release the cbuf, mark it as modified */ | 2966 | /* release the cbuf, mark it as modified */ |
2967 | cmPut(cp, TRUE); | 2967 | cmPut(cp, true); |
2968 | 2968 | ||
2969 | dxaddr += nblks; | 2969 | dxaddr += nblks; |
2970 | sxaddr += nblks; | 2970 | sxaddr += nblks; |
diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c index 295268ad231b..b8d16a6aa88f 100644 --- a/fs/jfs/namei.c +++ b/fs/jfs/namei.c | |||
@@ -292,7 +292,7 @@ static int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode) | |||
292 | mark_inode_dirty(ip); | 292 | mark_inode_dirty(ip); |
293 | 293 | ||
294 | /* update parent directory inode */ | 294 | /* update parent directory inode */ |
295 | dip->i_nlink++; /* for '..' from child directory */ | 295 | inc_nlink(dip); /* for '..' from child directory */ |
296 | dip->i_ctime = dip->i_mtime = CURRENT_TIME; | 296 | dip->i_ctime = dip->i_mtime = CURRENT_TIME; |
297 | mark_inode_dirty(dip); | 297 | mark_inode_dirty(dip); |
298 | 298 | ||
@@ -393,9 +393,8 @@ static int jfs_rmdir(struct inode *dip, struct dentry *dentry) | |||
393 | /* update parent directory's link count corresponding | 393 | /* update parent directory's link count corresponding |
394 | * to ".." entry of the target directory deleted | 394 | * to ".." entry of the target directory deleted |
395 | */ | 395 | */ |
396 | dip->i_nlink--; | ||
397 | dip->i_ctime = dip->i_mtime = CURRENT_TIME; | 396 | dip->i_ctime = dip->i_mtime = CURRENT_TIME; |
398 | mark_inode_dirty(dip); | 397 | inode_dec_link_count(dip); |
399 | 398 | ||
400 | /* | 399 | /* |
401 | * OS/2 could have created EA and/or ACL | 400 | * OS/2 could have created EA and/or ACL |
@@ -415,7 +414,7 @@ static int jfs_rmdir(struct inode *dip, struct dentry *dentry) | |||
415 | JFS_IP(ip)->acl.flag = 0; | 414 | JFS_IP(ip)->acl.flag = 0; |
416 | 415 | ||
417 | /* mark the target directory as deleted */ | 416 | /* mark the target directory as deleted */ |
418 | ip->i_nlink = 0; | 417 | clear_nlink(ip); |
419 | mark_inode_dirty(ip); | 418 | mark_inode_dirty(ip); |
420 | 419 | ||
421 | rc = txCommit(tid, 2, &iplist[0], 0); | 420 | rc = txCommit(tid, 2, &iplist[0], 0); |
@@ -515,8 +514,7 @@ static int jfs_unlink(struct inode *dip, struct dentry *dentry) | |||
515 | mark_inode_dirty(dip); | 514 | mark_inode_dirty(dip); |
516 | 515 | ||
517 | /* update target's inode */ | 516 | /* update target's inode */ |
518 | ip->i_nlink--; | 517 | inode_dec_link_count(ip); |
519 | mark_inode_dirty(ip); | ||
520 | 518 | ||
521 | /* | 519 | /* |
522 | * commit zero link count object | 520 | * commit zero link count object |
@@ -824,7 +822,7 @@ static int jfs_link(struct dentry *old_dentry, | |||
824 | goto free_dname; | 822 | goto free_dname; |
825 | 823 | ||
826 | /* update object inode */ | 824 | /* update object inode */ |
827 | ip->i_nlink++; /* for new link */ | 825 | inc_nlink(ip); /* for new link */ |
828 | ip->i_ctime = CURRENT_TIME; | 826 | ip->i_ctime = CURRENT_TIME; |
829 | dir->i_ctime = dir->i_mtime = CURRENT_TIME; | 827 | dir->i_ctime = dir->i_mtime = CURRENT_TIME; |
830 | mark_inode_dirty(dir); | 828 | mark_inode_dirty(dir); |
@@ -835,7 +833,7 @@ static int jfs_link(struct dentry *old_dentry, | |||
835 | rc = txCommit(tid, 2, &iplist[0], 0); | 833 | rc = txCommit(tid, 2, &iplist[0], 0); |
836 | 834 | ||
837 | if (rc) { | 835 | if (rc) { |
838 | ip->i_nlink--; | 836 | ip->i_nlink--; /* never instantiated */ |
839 | iput(ip); | 837 | iput(ip); |
840 | } else | 838 | } else |
841 | d_instantiate(dentry, ip); | 839 | d_instantiate(dentry, ip); |
@@ -1155,9 +1153,9 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1155 | old_ip->i_ino, JFS_RENAME); | 1153 | old_ip->i_ino, JFS_RENAME); |
1156 | if (rc) | 1154 | if (rc) |
1157 | goto out4; | 1155 | goto out4; |
1158 | new_ip->i_nlink--; | 1156 | drop_nlink(new_ip); |
1159 | if (S_ISDIR(new_ip->i_mode)) { | 1157 | if (S_ISDIR(new_ip->i_mode)) { |
1160 | new_ip->i_nlink--; | 1158 | drop_nlink(new_ip); |
1161 | if (new_ip->i_nlink) { | 1159 | if (new_ip->i_nlink) { |
1162 | mutex_unlock(&JFS_IP(new_ip)->commit_mutex); | 1160 | mutex_unlock(&JFS_IP(new_ip)->commit_mutex); |
1163 | if (old_dir != new_dir) | 1161 | if (old_dir != new_dir) |
@@ -1208,7 +1206,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1208 | goto out4; | 1206 | goto out4; |
1209 | } | 1207 | } |
1210 | if (S_ISDIR(old_ip->i_mode)) | 1208 | if (S_ISDIR(old_ip->i_mode)) |
1211 | new_dir->i_nlink++; | 1209 | inc_nlink(new_dir); |
1212 | } | 1210 | } |
1213 | /* | 1211 | /* |
1214 | * Remove old directory entry | 1212 | * Remove old directory entry |
@@ -1223,7 +1221,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1223 | goto out4; | 1221 | goto out4; |
1224 | } | 1222 | } |
1225 | if (S_ISDIR(old_ip->i_mode)) { | 1223 | if (S_ISDIR(old_ip->i_mode)) { |
1226 | old_dir->i_nlink--; | 1224 | drop_nlink(old_dir); |
1227 | if (old_dir != new_dir) { | 1225 | if (old_dir != new_dir) { |
1228 | /* | 1226 | /* |
1229 | * Change inode number of parent for moved directory | 1227 | * Change inode number of parent for moved directory |
diff --git a/fs/jfs/xattr.c b/fs/jfs/xattr.c index 9bc5b7c055ce..7a10e1928961 100644 --- a/fs/jfs/xattr.c +++ b/fs/jfs/xattr.c | |||
@@ -97,26 +97,26 @@ static inline int is_os2_xattr(struct jfs_ea *ea) | |||
97 | */ | 97 | */ |
98 | if ((ea->namelen >= XATTR_SYSTEM_PREFIX_LEN) && | 98 | if ((ea->namelen >= XATTR_SYSTEM_PREFIX_LEN) && |
99 | !strncmp(ea->name, XATTR_SYSTEM_PREFIX, XATTR_SYSTEM_PREFIX_LEN)) | 99 | !strncmp(ea->name, XATTR_SYSTEM_PREFIX, XATTR_SYSTEM_PREFIX_LEN)) |
100 | return FALSE; | 100 | return false; |
101 | /* | 101 | /* |
102 | * Check for "user." | 102 | * Check for "user." |
103 | */ | 103 | */ |
104 | if ((ea->namelen >= XATTR_USER_PREFIX_LEN) && | 104 | if ((ea->namelen >= XATTR_USER_PREFIX_LEN) && |
105 | !strncmp(ea->name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN)) | 105 | !strncmp(ea->name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN)) |
106 | return FALSE; | 106 | return false; |
107 | /* | 107 | /* |
108 | * Check for "security." | 108 | * Check for "security." |
109 | */ | 109 | */ |
110 | if ((ea->namelen >= XATTR_SECURITY_PREFIX_LEN) && | 110 | if ((ea->namelen >= XATTR_SECURITY_PREFIX_LEN) && |
111 | !strncmp(ea->name, XATTR_SECURITY_PREFIX, | 111 | !strncmp(ea->name, XATTR_SECURITY_PREFIX, |
112 | XATTR_SECURITY_PREFIX_LEN)) | 112 | XATTR_SECURITY_PREFIX_LEN)) |
113 | return FALSE; | 113 | return false; |
114 | /* | 114 | /* |
115 | * Check for "trusted." | 115 | * Check for "trusted." |
116 | */ | 116 | */ |
117 | if ((ea->namelen >= XATTR_TRUSTED_PREFIX_LEN) && | 117 | if ((ea->namelen >= XATTR_TRUSTED_PREFIX_LEN) && |
118 | !strncmp(ea->name, XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN)) | 118 | !strncmp(ea->name, XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN)) |
119 | return FALSE; | 119 | return false; |
120 | /* | 120 | /* |
121 | * Add any other valid namespace prefixes here | 121 | * Add any other valid namespace prefixes here |
122 | */ | 122 | */ |
@@ -124,7 +124,7 @@ static inline int is_os2_xattr(struct jfs_ea *ea) | |||
124 | /* | 124 | /* |
125 | * We assume it's OS/2's flat namespace | 125 | * We assume it's OS/2's flat namespace |
126 | */ | 126 | */ |
127 | return TRUE; | 127 | return true; |
128 | } | 128 | } |
129 | 129 | ||
130 | static inline int name_size(struct jfs_ea *ea) | 130 | static inline int name_size(struct jfs_ea *ea) |