From: Nathan Scott Date: Sun, 8 Jul 2001 23:41:21 +0000 (+0000) Subject: sync with low memory changes from kernel - these are noops in userspace though. X-Git-Tag: v1.3.0~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76c410fff6c4af1281f0532bb1201d930196bb17;p=thirdparty%2Fxfsprogs-dev.git sync with low memory changes from kernel - these are noops in userspace though. --- diff --git a/libxfs/xfs.h b/libxfs/xfs.h index 1b60bd456..8a85e377b 100644 --- a/libxfs/xfs.h +++ b/libxfs/xfs.h @@ -451,7 +451,7 @@ int xfs_alloc_split (xfs_btree_cur_t *, int, xfs_agblock_t *, xfs_alloc_key_t *, xfs_btree_cur_t **, int *); /* xfs_da_btree.c */ -xfs_dabuf_t *xfs_da_buf_make (int, xfs_buf_t **, inst_t *); +xfs_dabuf_t *xfs_da_buf_make (int, xfs_buf_t **, inst_t *, int); int xfs_da_root_join (xfs_da_state_t *, xfs_da_state_blk_t *); int xfs_da_root_split (xfs_da_state_t *, xfs_da_state_blk_t *, xfs_da_state_blk_t *); diff --git a/libxfs/xfs_da_btree.c b/libxfs/xfs_da_btree.c index 52fcdfdac..be44b985f 100644 --- a/libxfs/xfs_da_btree.c +++ b/libxfs/xfs_da_btree.c @@ -2013,6 +2013,7 @@ xfs_da_do_buf( int nbplist=0; int nfsb; int nmap; + int mem_flags = trans ? KM_SLEEP : KM_SLEEP_IO; xfs_dabuf_t *rbp; mp = dp->i_mount; @@ -2050,8 +2051,7 @@ xfs_da_do_buf( xfs_fsblock_t firstblock; firstblock = NULLFSBLOCK; - mapp = kmem_alloc(sizeof(*mapp) * nfsb, - trans ? KM_SLEEP : KM_SLEEP_IO); + mapp = kmem_alloc(sizeof(*mapp) * nfsb, mem_flags); nmap = nfsb; if ((error = xfs_bmapi(trans, dp, (xfs_fileoff_t)bno, nfsb, @@ -2072,7 +2072,7 @@ xfs_da_do_buf( goto exit0; } if (caller != 3 && nmap > 1) { - bplist = kmem_alloc(sizeof(*bplist) * nmap, KM_SLEEP); + bplist = kmem_alloc(sizeof(*bplist) * nmap, mem_flags); nbplist = 0; } else bplist = NULL; @@ -2132,9 +2132,9 @@ xfs_da_do_buf( * Build a dabuf structure. */ if (bplist) { - rbp = xfs_da_buf_make(nbplist, bplist, ra); + rbp = xfs_da_buf_make(nbplist, bplist, ra, mem_flags); } else if (bp) - rbp = xfs_da_buf_make(1, &bp, ra); + rbp = xfs_da_buf_make(1, &bp, ra, mem_flags); else rbp = NULL; /* @@ -2297,7 +2297,7 @@ lock_t xfs_dabuf_global_lock; */ /* ARGSUSED */ STATIC xfs_dabuf_t * -xfs_da_buf_make(int nbuf, xfs_buf_t **bps, inst_t *ra) +xfs_da_buf_make(int nbuf, xfs_buf_t **bps, inst_t *ra, int mem_flags) { xfs_buf_t *bp; xfs_dabuf_t *dabuf; @@ -2305,9 +2305,9 @@ xfs_da_buf_make(int nbuf, xfs_buf_t **bps, inst_t *ra) int off; if (nbuf == 1) - dabuf = kmem_zone_alloc(xfs_dabuf_zone, KM_SLEEP); + dabuf = kmem_zone_alloc(xfs_dabuf_zone, mem_flags); else - dabuf = kmem_alloc(XFS_DA_BUF_SIZE(nbuf), KM_SLEEP); + dabuf = kmem_alloc(XFS_DA_BUF_SIZE(nbuf), mem_flags); dabuf->dirty = 0; #ifdef XFS_DABUF_DEBUG dabuf->ra = ra;