diff options
author | Nathan Scott <nathans@sgi.com> | 2006-09-28 03:03:27 +0200 |
---|---|---|
committer | Tim Shimmin <tes@sgi.com> | 2006-09-28 03:03:27 +0200 |
commit | 77e4635ae191774526ed695482a151ac986f3806 (patch) | |
tree | 42cfa03f913883cd7f3d53be19b7e8c25258ee2c /fs/xfs/xfs_itable.c | |
parent | [XFS] Improve error handling for the zero-fsblock extent detection code. (diff) | |
download | linux-77e4635ae191774526ed695482a151ac986f3806.tar.xz linux-77e4635ae191774526ed695482a151ac986f3806.zip |
[XFS] Add a greedy allocation interface, allocating within a min/max size
range.
SGI-PV: 955302
SGI-Modid: xfs-linux-melb:xfs-kern:26803a
Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_itable.c')
-rw-r--r-- | fs/xfs/xfs_itable.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c index 612689940659..0fbbd7b9c696 100644 --- a/fs/xfs/xfs_itable.c +++ b/fs/xfs/xfs_itable.c @@ -326,7 +326,6 @@ xfs_bulkstat( int i; /* loop index */ int icount; /* count of inodes good in irbuf */ int irbsize; /* size of irec buffer in bytes */ - unsigned int kmflags; /* flags for allocating irec buffer */ xfs_ino_t ino; /* inode number (filesystem) */ xfs_inobt_rec_incore_t *irbp; /* current irec buffer pointer */ xfs_inobt_rec_incore_t *irbuf; /* start of irec buffer */ @@ -371,19 +370,8 @@ xfs_bulkstat( (XFS_INODE_CLUSTER_SIZE(mp) >> mp->m_sb.sb_inodelog); nimask = ~(nicluster - 1); nbcluster = nicluster >> mp->m_sb.sb_inopblog; - /* - * Allocate a local buffer for inode cluster btree records. - * This caps our maximum readahead window (so don't be stingy) - * but we must handle the case where we can't get a contiguous - * multi-page buffer, so we drop back toward pagesize; the end - * case we ensure succeeds, via appropriate allocation flags. - */ - irbsize = NBPP * 4; - kmflags = KM_SLEEP | KM_MAYFAIL; - while (!(irbuf = kmem_alloc(irbsize, kmflags))) { - if ((irbsize >>= 1) <= NBPP) - kmflags = KM_SLEEP; - } + irbuf = kmem_zalloc_greedy(&irbsize, NBPC, NBPC * 4, + KM_SLEEP | KM_MAYFAIL | KM_LARGE); nirbuf = irbsize / sizeof(*irbuf); /* |