diff options
author | Tony Lindgren <tony@atomide.com> | 2012-09-05 17:06:08 (GMT) |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2012-09-05 17:06:08 (GMT) |
commit | 580a7ce8fb5012c0c0afe592bdafd482a3679911 (patch) | |
tree | 3fb6b00359a63d8d2e33005599046c105956d314 /include/linux/blkdev.h | |
parent | a17fb8f520c3c662686aa54a86773f354002c7d3 (diff) | |
parent | e534e871a94ba2e3bfdf0edd3685eb805fc960d8 (diff) | |
download | linux-fsl-qoriq-580a7ce8fb5012c0c0afe592bdafd482a3679911.tar.xz |
Merge branch 'fixes-wakeupgen' into fixes
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r-- | include/linux/blkdev.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 4e72a9d..4a2ab7c 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -601,7 +601,7 @@ static inline void blk_clear_rl_full(struct request_list *rl, bool sync) * it already be started by driver. */ #define RQ_NOMERGE_FLAGS \ - (REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_FLUSH | REQ_FUA) + (REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_FLUSH | REQ_FUA | REQ_DISCARD) #define rq_mergeable(rq) \ (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && \ (((rq)->cmd_flags & REQ_DISCARD) || \ @@ -894,6 +894,8 @@ extern void blk_queue_flush_queueable(struct request_queue *q, bool queueable); extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); +extern int blk_bio_map_sg(struct request_queue *q, struct bio *bio, + struct scatterlist *sglist); extern void blk_dump_rq_flags(struct request *, char *); extern long nr_blockdev_pages(void); @@ -1139,6 +1141,16 @@ static inline int queue_limit_discard_alignment(struct queue_limits *lim, sector & (lim->discard_granularity - 1); } +static inline int bdev_discard_alignment(struct block_device *bdev) +{ + struct request_queue *q = bdev_get_queue(bdev); + + if (bdev != bdev->bd_contains) + return bdev->bd_part->discard_alignment; + + return q->limits.discard_alignment; +} + static inline unsigned int queue_discard_zeroes_data(struct request_queue *q) { if (q->limits.max_discard_sectors && q->limits.discard_zeroes_data == 1) |