Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 110535
b: refs/heads/master
c: 3e6053d
h: refs/heads/master
i:
  110533: beaa9af
  110531: 1e15903
  110527: 6592626
v: v3
  • Loading branch information
Hugh Dickins authored and Jens Axboe committed Oct 9, 2008
1 parent 6b292e9 commit 3923a2a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4677735f03f5b6b6f2182f457a921855cadfb85b
refs/heads/master: 3e6053d76dcbd92b2f9f4ad5ece9bce83149523e
7 changes: 4 additions & 3 deletions trunk/block/blk-barrier.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,13 @@ static void blkdev_discard_end_io(struct bio *bio, int err)
* @bdev: blockdev to issue discard for
* @sector: start sector
* @nr_sects: number of sectors to discard
* @gfp_mask: memory allocation flags (for bio_alloc)
*
* Description:
* Issue a discard request for the sectors in question. Does not wait.
*/
int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
unsigned nr_sects)
int blkdev_issue_discard(struct block_device *bdev,
sector_t sector, sector_t nr_sects, gfp_t gfp_mask)
{
struct request_queue *q;
struct bio *bio;
Expand All @@ -354,7 +355,7 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
return -EOPNOTSUPP;

while (nr_sects && !ret) {
bio = bio_alloc(GFP_KERNEL, 0);
bio = bio_alloc(gfp_mask, 0);
if (!bio)
return -ENOMEM;

Expand Down
9 changes: 5 additions & 4 deletions trunk/include/linux/blkdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <linux/bio.h>
#include <linux/module.h>
#include <linux/stringify.h>
#include <linux/gfp.h>
#include <linux/bsg.h>
#include <linux/smp.h>

Expand Down Expand Up @@ -873,15 +874,15 @@ static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt,
}

extern int blkdev_issue_flush(struct block_device *, sector_t *);
extern int blkdev_issue_discard(struct block_device *, sector_t sector,
unsigned nr_sects);
extern int blkdev_issue_discard(struct block_device *,
sector_t sector, sector_t nr_sects, gfp_t);

static inline int sb_issue_discard(struct super_block *sb,
sector_t block, unsigned nr_blocks)
sector_t block, sector_t nr_blocks)
{
block <<= (sb->s_blocksize_bits - 9);
nr_blocks <<= (sb->s_blocksize_bits - 9);
return blkdev_issue_discard(sb->s_bdev, block, nr_blocks);
return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL);
}

/*
Expand Down

0 comments on commit 3923a2a

Please sign in to comment.