diff options
Diffstat (limited to 'fs/xfs/xfs_itable.c')
-rw-r--r-- | fs/xfs/xfs_itable.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c index c237ad15d500..f46338285152 100644 --- a/fs/xfs/xfs_itable.c +++ b/fs/xfs/xfs_itable.c | |||
@@ -209,9 +209,8 @@ xfs_bulkstat( | |||
209 | xfs_inobt_rec_incore_t *irbuf; /* start of irec buffer */ | 209 | xfs_inobt_rec_incore_t *irbuf; /* start of irec buffer */ |
210 | xfs_inobt_rec_incore_t *irbufend; /* end of good irec buffer entries */ | 210 | xfs_inobt_rec_incore_t *irbufend; /* end of good irec buffer entries */ |
211 | xfs_ino_t lastino; /* last inode number returned */ | 211 | xfs_ino_t lastino; /* last inode number returned */ |
212 | int nbcluster; /* # of blocks in a cluster */ | 212 | int blks_per_cluster; /* # of blocks per cluster */ |
213 | int nicluster; /* # of inodes in a cluster */ | 213 | int inodes_per_cluster;/* # of inodes per cluster */ |
214 | int nimask; /* mask for inode clusters */ | ||
215 | int nirbuf; /* size of irbuf */ | 214 | int nirbuf; /* size of irbuf */ |
216 | int rval; /* return value error code */ | 215 | int rval; /* return value error code */ |
217 | int tmp; /* result value from btree calls */ | 216 | int tmp; /* result value from btree calls */ |
@@ -243,11 +242,8 @@ xfs_bulkstat( | |||
243 | *done = 0; | 242 | *done = 0; |
244 | fmterror = 0; | 243 | fmterror = 0; |
245 | ubufp = ubuffer; | 244 | ubufp = ubuffer; |
246 | nicluster = mp->m_sb.sb_blocksize >= XFS_INODE_CLUSTER_SIZE(mp) ? | 245 | blks_per_cluster = xfs_icluster_size_fsb(mp); |
247 | mp->m_sb.sb_inopblock : | 246 | inodes_per_cluster = blks_per_cluster << mp->m_sb.sb_inopblog; |
248 | (XFS_INODE_CLUSTER_SIZE(mp) >> mp->m_sb.sb_inodelog); | ||
249 | nimask = ~(nicluster - 1); | ||
250 | nbcluster = nicluster >> mp->m_sb.sb_inopblog; | ||
251 | irbuf = kmem_zalloc_greedy(&irbsize, PAGE_SIZE, PAGE_SIZE * 4); | 247 | irbuf = kmem_zalloc_greedy(&irbsize, PAGE_SIZE, PAGE_SIZE * 4); |
252 | if (!irbuf) | 248 | if (!irbuf) |
253 | return ENOMEM; | 249 | return ENOMEM; |
@@ -390,12 +386,12 @@ xfs_bulkstat( | |||
390 | agbno = XFS_AGINO_TO_AGBNO(mp, r.ir_startino); | 386 | agbno = XFS_AGINO_TO_AGBNO(mp, r.ir_startino); |
391 | for (chunkidx = 0; | 387 | for (chunkidx = 0; |
392 | chunkidx < XFS_INODES_PER_CHUNK; | 388 | chunkidx < XFS_INODES_PER_CHUNK; |
393 | chunkidx += nicluster, | 389 | chunkidx += inodes_per_cluster, |
394 | agbno += nbcluster) { | 390 | agbno += blks_per_cluster) { |
395 | if (xfs_inobt_maskn(chunkidx, nicluster) | 391 | if (xfs_inobt_maskn(chunkidx, |
396 | & ~r.ir_free) | 392 | inodes_per_cluster) & ~r.ir_free) |
397 | xfs_btree_reada_bufs(mp, agno, | 393 | xfs_btree_reada_bufs(mp, agno, |
398 | agbno, nbcluster, | 394 | agbno, blks_per_cluster, |
399 | &xfs_inode_buf_ops); | 395 | &xfs_inode_buf_ops); |
400 | } | 396 | } |
401 | blk_finish_plug(&plug); | 397 | blk_finish_plug(&plug); |