diff options
Diffstat (limited to 'fs/xfs/xfs_itable.c')
-rw-r--r-- | fs/xfs/xfs_itable.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c index 62efab2f3839..3af02314c605 100644 --- a/fs/xfs/xfs_itable.c +++ b/fs/xfs/xfs_itable.c | |||
@@ -408,8 +408,10 @@ xfs_bulkstat( | |||
408 | (XFS_INODE_CLUSTER_SIZE(mp) >> mp->m_sb.sb_inodelog); | 408 | (XFS_INODE_CLUSTER_SIZE(mp) >> mp->m_sb.sb_inodelog); |
409 | nimask = ~(nicluster - 1); | 409 | nimask = ~(nicluster - 1); |
410 | nbcluster = nicluster >> mp->m_sb.sb_inopblog; | 410 | nbcluster = nicluster >> mp->m_sb.sb_inopblog; |
411 | irbuf = kmem_zalloc_greedy(&irbsize, PAGE_SIZE, PAGE_SIZE * 4, | 411 | irbuf = kmem_zalloc_greedy(&irbsize, PAGE_SIZE, PAGE_SIZE * 4); |
412 | KM_SLEEP | KM_MAYFAIL | KM_LARGE); | 412 | if (!irbuf) |
413 | return ENOMEM; | ||
414 | |||
413 | nirbuf = irbsize / sizeof(*irbuf); | 415 | nirbuf = irbsize / sizeof(*irbuf); |
414 | 416 | ||
415 | /* | 417 | /* |
@@ -420,9 +422,7 @@ xfs_bulkstat( | |||
420 | while (XFS_BULKSTAT_UBLEFT(ubleft) && agno < mp->m_sb.sb_agcount) { | 422 | while (XFS_BULKSTAT_UBLEFT(ubleft) && agno < mp->m_sb.sb_agcount) { |
421 | cond_resched(); | 423 | cond_resched(); |
422 | bp = NULL; | 424 | bp = NULL; |
423 | down_read(&mp->m_peraglock); | ||
424 | error = xfs_ialloc_read_agi(mp, NULL, agno, &agbp); | 425 | error = xfs_ialloc_read_agi(mp, NULL, agno, &agbp); |
425 | up_read(&mp->m_peraglock); | ||
426 | if (error) { | 426 | if (error) { |
427 | /* | 427 | /* |
428 | * Skip this allocation group and go to the next one. | 428 | * Skip this allocation group and go to the next one. |
@@ -729,7 +729,7 @@ xfs_bulkstat( | |||
729 | /* | 729 | /* |
730 | * Done, we're either out of filesystem or space to put the data. | 730 | * Done, we're either out of filesystem or space to put the data. |
731 | */ | 731 | */ |
732 | kmem_free(irbuf); | 732 | kmem_free_large(irbuf); |
733 | *ubcountp = ubelem; | 733 | *ubcountp = ubelem; |
734 | /* | 734 | /* |
735 | * Found some inodes, return them now and return the error next time. | 735 | * Found some inodes, return them now and return the error next time. |
@@ -849,9 +849,7 @@ xfs_inumbers( | |||
849 | agbp = NULL; | 849 | agbp = NULL; |
850 | while (left > 0 && agno < mp->m_sb.sb_agcount) { | 850 | while (left > 0 && agno < mp->m_sb.sb_agcount) { |
851 | if (agbp == NULL) { | 851 | if (agbp == NULL) { |
852 | down_read(&mp->m_peraglock); | ||
853 | error = xfs_ialloc_read_agi(mp, NULL, agno, &agbp); | 852 | error = xfs_ialloc_read_agi(mp, NULL, agno, &agbp); |
854 | up_read(&mp->m_peraglock); | ||
855 | if (error) { | 853 | if (error) { |
856 | /* | 854 | /* |
857 | * If we can't read the AGI of this ag, | 855 | * If we can't read the AGI of this ag, |