aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-barrier.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/blk-barrier.c')
-rw-r--r--block/blk-barrier.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/block/blk-barrier.c b/block/blk-barrier.c
index 988b63479b2f..5c99ff8d2db8 100644
--- a/block/blk-barrier.c
+++ b/block/blk-barrier.c
@@ -332,12 +332,13 @@ static void blkdev_discard_end_io(struct bio *bio, int err)
332 * @bdev: blockdev to issue discard for 332 * @bdev: blockdev to issue discard for
333 * @sector: start sector 333 * @sector: start sector
334 * @nr_sects: number of sectors to discard 334 * @nr_sects: number of sectors to discard
335 * @gfp_mask: memory allocation flags (for bio_alloc)
335 * 336 *
336 * Description: 337 * Description:
337 * Issue a discard request for the sectors in question. Does not wait. 338 * Issue a discard request for the sectors in question. Does not wait.
338 */ 339 */
339int blkdev_issue_discard(struct block_device *bdev, sector_t sector, 340int blkdev_issue_discard(struct block_device *bdev,
340 unsigned nr_sects) 341 sector_t sector, sector_t nr_sects, gfp_t gfp_mask)
341{ 342{
342 struct request_queue *q; 343 struct request_queue *q;
343 struct bio *bio; 344 struct bio *bio;
@@ -354,7 +355,7 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
354 return -EOPNOTSUPP; 355 return -EOPNOTSUPP;
355 356
356 while (nr_sects && !ret) { 357 while (nr_sects && !ret) {
357 bio = bio_alloc(GFP_KERNEL, 0); 358 bio = bio_alloc(gfp_mask, 0);
358 if (!bio) 359 if (!bio)
359 return -ENOMEM; 360 return -ENOMEM;
360 361