aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/blkdev.h
diff options
context:
space:
mode:
authorDmitry Monakhov <dmonakhov@openvz.org>2010-04-28 09:55:06 -0400
committerJens Axboe <jens.axboe@oracle.com>2010-04-28 13:47:36 -0400
commitfbd9b09a177a481eda256447c881f014f29034fe (patch)
treeef7e213045382f82a1e3e3cf134d196a1045dd7a /include/linux/blkdev.h
parent6b4517a7913a09d3259bb1d21c9cb300f12294bd (diff)
blkdev: generalize flags for blkdev_issue_fn functions
The patch just convert all blkdev_issue_xxx function to common set of flags. Wait/allocation semantics preserved. Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r--include/linux/blkdev.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 5cf17a49ce38..59b9aed0ee7d 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -998,12 +998,16 @@ static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt,
998 return NULL; 998 return NULL;
999 return bqt->tag_index[tag]; 999 return bqt->tag_index[tag];
1000} 1000}
1001 1001enum{
1002extern int blkdev_issue_flush(struct block_device *, sector_t *); 1002 BLKDEV_WAIT, /* wait for completion */
1003#define DISCARD_FL_WAIT 0x01 /* wait for completion */ 1003 BLKDEV_BARRIER, /*issue request with barrier */
1004#define DISCARD_FL_BARRIER 0x02 /* issue DISCARD_BARRIER request */ 1004};
1005extern int blkdev_issue_discard(struct block_device *, sector_t sector, 1005#define BLKDEV_IFL_WAIT (1 << BLKDEV_WAIT)
1006 sector_t nr_sects, gfp_t, int flags); 1006#define BLKDEV_IFL_BARRIER (1 << BLKDEV_BARRIER)
1007extern int blkdev_issue_flush(struct block_device *, gfp_t, sector_t *,
1008 unsigned long);
1009extern int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
1010 sector_t nr_sects, gfp_t gfp_mask, unsigned long flags);
1007 1011
1008static inline int sb_issue_discard(struct super_block *sb, 1012static inline int sb_issue_discard(struct super_block *sb,
1009 sector_t block, sector_t nr_blocks) 1013 sector_t block, sector_t nr_blocks)
@@ -1011,7 +1015,7 @@ static inline int sb_issue_discard(struct super_block *sb,
1011 block <<= (sb->s_blocksize_bits - 9); 1015 block <<= (sb->s_blocksize_bits - 9);
1012 nr_blocks <<= (sb->s_blocksize_bits - 9); 1016 nr_blocks <<= (sb->s_blocksize_bits - 9);
1013 return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL, 1017 return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL,
1014 DISCARD_FL_BARRIER); 1018 BLKDEV_IFL_WAIT | BLKDEV_IFL_BARRIER);
1015} 1019}
1016 1020
1017extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm); 1021extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm);