diff options
Diffstat (limited to 'fs/jfs/jfs_imap.c')
-rw-r--r-- | fs/jfs/jfs_imap.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c index 9bf29f771737..734ec916beaf 100644 --- a/fs/jfs/jfs_imap.c +++ b/fs/jfs/jfs_imap.c | |||
@@ -1019,8 +1019,7 @@ int diFree(struct inode *ip) | |||
1019 | /* update the free inode counts at the iag, ag and | 1019 | /* update the free inode counts at the iag, ag and |
1020 | * map level. | 1020 | * map level. |
1021 | */ | 1021 | */ |
1022 | iagp->nfreeinos = | 1022 | le32_add_cpu(&iagp->nfreeinos, 1); |
1023 | cpu_to_le32(le32_to_cpu(iagp->nfreeinos) + 1); | ||
1024 | imap->im_agctl[agno].numfree += 1; | 1023 | imap->im_agctl[agno].numfree += 1; |
1025 | atomic_inc(&imap->im_numfree); | 1024 | atomic_inc(&imap->im_numfree); |
1026 | 1025 | ||
@@ -1219,9 +1218,8 @@ int diFree(struct inode *ip) | |||
1219 | /* update the number of free inodes and number of free extents | 1218 | /* update the number of free inodes and number of free extents |
1220 | * for the iag. | 1219 | * for the iag. |
1221 | */ | 1220 | */ |
1222 | iagp->nfreeinos = cpu_to_le32(le32_to_cpu(iagp->nfreeinos) - | 1221 | le32_add_cpu(&iagp->nfreeinos, -(INOSPEREXT - 1)); |
1223 | (INOSPEREXT - 1)); | 1222 | le32_add_cpu(&iagp->nfreeexts, 1); |
1224 | iagp->nfreeexts = cpu_to_le32(le32_to_cpu(iagp->nfreeexts) + 1); | ||
1225 | 1223 | ||
1226 | /* update the number of free inodes and backed inodes | 1224 | /* update the number of free inodes and backed inodes |
1227 | * at the ag and inode map level. | 1225 | * at the ag and inode map level. |
@@ -2124,7 +2122,7 @@ static int diAllocBit(struct inomap * imap, struct iag * iagp, int ino) | |||
2124 | /* update the free inode count at the iag, ag, inode | 2122 | /* update the free inode count at the iag, ag, inode |
2125 | * map levels. | 2123 | * map levels. |
2126 | */ | 2124 | */ |
2127 | iagp->nfreeinos = cpu_to_le32(le32_to_cpu(iagp->nfreeinos) - 1); | 2125 | le32_add_cpu(&iagp->nfreeinos, -1); |
2128 | imap->im_agctl[agno].numfree -= 1; | 2126 | imap->im_agctl[agno].numfree -= 1; |
2129 | atomic_dec(&imap->im_numfree); | 2127 | atomic_dec(&imap->im_numfree); |
2130 | 2128 | ||
@@ -2378,9 +2376,8 @@ static int diNewExt(struct inomap * imap, struct iag * iagp, int extno) | |||
2378 | /* update the free inode and free extent counts for the | 2376 | /* update the free inode and free extent counts for the |
2379 | * iag. | 2377 | * iag. |
2380 | */ | 2378 | */ |
2381 | iagp->nfreeinos = cpu_to_le32(le32_to_cpu(iagp->nfreeinos) + | 2379 | le32_add_cpu(&iagp->nfreeinos, (INOSPEREXT - 1)); |
2382 | (INOSPEREXT - 1)); | 2380 | le32_add_cpu(&iagp->nfreeexts, -1); |
2383 | iagp->nfreeexts = cpu_to_le32(le32_to_cpu(iagp->nfreeexts) - 1); | ||
2384 | 2381 | ||
2385 | /* update the free and backed inode counts for the ag. | 2382 | /* update the free and backed inode counts for the ag. |
2386 | */ | 2383 | */ |