Skip to content

Commit

Permalink
dm: pass gfp_mask to alloc_rq_tio
Browse files Browse the repository at this point in the history
This patch adds the gfp_mask argument to alloc_rq_tio().
No functional change.

This patch is a preparation for a later patch in this series which needs to
allocate tio (for barrier I/O) with different allocation flag (GFP_NOIO) from
the one in the normal I/O code path.

Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
  • Loading branch information
Kiyoshi Ueda authored and Alasdair G Kergon committed Dec 10, 2009
1 parent 598de40 commit 0888564
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/md/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,10 @@ static void free_tio(struct mapped_device *md, struct dm_target_io *tio)
mempool_free(tio, md->tio_pool);
}

static struct dm_rq_target_io *alloc_rq_tio(struct mapped_device *md)
static struct dm_rq_target_io *alloc_rq_tio(struct mapped_device *md,
gfp_t gfp_mask)
{
return mempool_alloc(md->tio_pool, GFP_ATOMIC);
return mempool_alloc(md->tio_pool, gfp_mask);
}

static void free_rq_tio(struct dm_rq_target_io *tio)
Expand Down Expand Up @@ -1471,7 +1472,7 @@ static int dm_prep_fn(struct request_queue *q, struct request *rq)
return BLKPREP_KILL;
}

tio = alloc_rq_tio(md); /* Only one for each original request */
tio = alloc_rq_tio(md, GFP_ATOMIC);
if (!tio)
/* -ENOMEM */
return BLKPREP_DEFER;
Expand Down

0 comments on commit 0888564

Please sign in to comment.