diff options
Diffstat (limited to 'fs/xfs/xfs_itable.c')
-rw-r--r-- | fs/xfs/xfs_itable.c | 33 |
1 files changed, 5 insertions, 28 deletions
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c index 2ea7d402188d..b93e14b86754 100644 --- a/fs/xfs/xfs_itable.c +++ b/fs/xfs/xfs_itable.c | |||
@@ -43,7 +43,7 @@ xfs_internal_inum( | |||
43 | { | 43 | { |
44 | return (ino == mp->m_sb.sb_rbmino || ino == mp->m_sb.sb_rsumino || | 44 | return (ino == mp->m_sb.sb_rbmino || ino == mp->m_sb.sb_rsumino || |
45 | (xfs_sb_version_hasquota(&mp->m_sb) && | 45 | (xfs_sb_version_hasquota(&mp->m_sb) && |
46 | (ino == mp->m_sb.sb_uquotino || ino == mp->m_sb.sb_gquotino))); | 46 | xfs_is_quota_inode(&mp->m_sb, ino))); |
47 | } | 47 | } |
48 | 48 | ||
49 | /* | 49 | /* |
@@ -221,7 +221,6 @@ xfs_bulkstat( | |||
221 | char __user *ubufp; /* pointer into user's buffer */ | 221 | char __user *ubufp; /* pointer into user's buffer */ |
222 | int ubelem; /* spaces used in user's buffer */ | 222 | int ubelem; /* spaces used in user's buffer */ |
223 | int ubused; /* bytes used by formatter */ | 223 | int ubused; /* bytes used by formatter */ |
224 | xfs_buf_t *bp; /* ptr to on-disk inode cluster buf */ | ||
225 | 224 | ||
226 | /* | 225 | /* |
227 | * Get the last inode value, see if there's nothing to do. | 226 | * Get the last inode value, see if there's nothing to do. |
@@ -263,7 +262,6 @@ xfs_bulkstat( | |||
263 | rval = 0; | 262 | rval = 0; |
264 | while (XFS_BULKSTAT_UBLEFT(ubleft) && agno < mp->m_sb.sb_agcount) { | 263 | while (XFS_BULKSTAT_UBLEFT(ubleft) && agno < mp->m_sb.sb_agcount) { |
265 | cond_resched(); | 264 | cond_resched(); |
266 | bp = NULL; | ||
267 | error = xfs_ialloc_read_agi(mp, NULL, agno, &agbp); | 265 | error = xfs_ialloc_read_agi(mp, NULL, agno, &agbp); |
268 | if (error) { | 266 | if (error) { |
269 | /* | 267 | /* |
@@ -383,11 +381,13 @@ xfs_bulkstat( | |||
383 | * Also start read-ahead now for this chunk. | 381 | * Also start read-ahead now for this chunk. |
384 | */ | 382 | */ |
385 | if (r.ir_freecount < XFS_INODES_PER_CHUNK) { | 383 | if (r.ir_freecount < XFS_INODES_PER_CHUNK) { |
384 | struct blk_plug plug; | ||
386 | /* | 385 | /* |
387 | * Loop over all clusters in the next chunk. | 386 | * Loop over all clusters in the next chunk. |
388 | * Do a readahead if there are any allocated | 387 | * Do a readahead if there are any allocated |
389 | * inodes in that cluster. | 388 | * inodes in that cluster. |
390 | */ | 389 | */ |
390 | blk_start_plug(&plug); | ||
391 | agbno = XFS_AGINO_TO_AGBNO(mp, r.ir_startino); | 391 | agbno = XFS_AGINO_TO_AGBNO(mp, r.ir_startino); |
392 | for (chunkidx = 0; | 392 | for (chunkidx = 0; |
393 | chunkidx < XFS_INODES_PER_CHUNK; | 393 | chunkidx < XFS_INODES_PER_CHUNK; |
@@ -399,6 +399,7 @@ xfs_bulkstat( | |||
399 | agbno, nbcluster, | 399 | agbno, nbcluster, |
400 | &xfs_inode_buf_ops); | 400 | &xfs_inode_buf_ops); |
401 | } | 401 | } |
402 | blk_finish_plug(&plug); | ||
402 | irbp->ir_startino = r.ir_startino; | 403 | irbp->ir_startino = r.ir_startino; |
403 | irbp->ir_freecount = r.ir_freecount; | 404 | irbp->ir_freecount = r.ir_freecount; |
404 | irbp->ir_free = r.ir_free; | 405 | irbp->ir_free = r.ir_free; |
@@ -433,27 +434,7 @@ xfs_bulkstat( | |||
433 | irbp->ir_freecount < XFS_INODES_PER_CHUNK; | 434 | irbp->ir_freecount < XFS_INODES_PER_CHUNK; |
434 | chunkidx++, clustidx++, agino++) { | 435 | chunkidx++, clustidx++, agino++) { |
435 | ASSERT(chunkidx < XFS_INODES_PER_CHUNK); | 436 | ASSERT(chunkidx < XFS_INODES_PER_CHUNK); |
436 | /* | 437 | |
437 | * Recompute agbno if this is the | ||
438 | * first inode of the cluster. | ||
439 | * | ||
440 | * Careful with clustidx. There can be | ||
441 | * multiple clusters per chunk, a single | ||
442 | * cluster per chunk or a cluster that has | ||
443 | * inodes represented from several different | ||
444 | * chunks (if blocksize is large). | ||
445 | * | ||
446 | * Because of this, the starting clustidx is | ||
447 | * initialized to zero in this loop but must | ||
448 | * later be reset after reading in the cluster | ||
449 | * buffer. | ||
450 | */ | ||
451 | if ((chunkidx & (nicluster - 1)) == 0) { | ||
452 | agbno = XFS_AGINO_TO_AGBNO(mp, | ||
453 | irbp->ir_startino) + | ||
454 | ((chunkidx & nimask) >> | ||
455 | mp->m_sb.sb_inopblog); | ||
456 | } | ||
457 | ino = XFS_AGINO_TO_INO(mp, agno, agino); | 438 | ino = XFS_AGINO_TO_INO(mp, agno, agino); |
458 | /* | 439 | /* |
459 | * Skip if this inode is free. | 440 | * Skip if this inode is free. |
@@ -499,10 +480,6 @@ xfs_bulkstat( | |||
499 | 480 | ||
500 | cond_resched(); | 481 | cond_resched(); |
501 | } | 482 | } |
502 | |||
503 | if (bp) | ||
504 | xfs_buf_relse(bp); | ||
505 | |||
506 | /* | 483 | /* |
507 | * Set up for the next loop iteration. | 484 | * Set up for the next loop iteration. |
508 | */ | 485 | */ |