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 *);
int nbplist=0;
int nfsb;
int nmap;
+ int mem_flags = trans ? KM_SLEEP : KM_SLEEP_IO;
xfs_dabuf_t *rbp;
mp = dp->i_mount;
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,
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;
* 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;
/*
*/
/* 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;
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;