aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/blkdev.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r--include/linux/blkdev.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 86c2bdff3b89..e23a86cae5ac 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -998,15 +998,18 @@ static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt,
998} 998}
999 999
1000extern int blkdev_issue_flush(struct block_device *, sector_t *); 1000extern int blkdev_issue_flush(struct block_device *, sector_t *);
1001extern int blkdev_issue_discard(struct block_device *, 1001#define DISCARD_FL_WAIT 0x01 /* wait for completion */
1002 sector_t sector, sector_t nr_sects, gfp_t); 1002#define DISCARD_FL_BARRIER 0x02 /* issue DISCARD_BARRIER request */
1003extern int blkdev_issue_discard(struct block_device *, sector_t sector,
1004 sector_t nr_sects, gfp_t, int flags);
1003 1005
1004static inline int sb_issue_discard(struct super_block *sb, 1006static inline int sb_issue_discard(struct super_block *sb,
1005 sector_t block, sector_t nr_blocks) 1007 sector_t block, sector_t nr_blocks)
1006{ 1008{
1007 block <<= (sb->s_blocksize_bits - 9); 1009 block <<= (sb->s_blocksize_bits - 9);
1008 nr_blocks <<= (sb->s_blocksize_bits - 9); 1010 nr_blocks <<= (sb->s_blocksize_bits - 9);
1009 return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL); 1011 return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL,
1012 DISCARD_FL_BARRIER);
1010} 1013}
1011 1014
1012extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm); 1015extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm);