diff options
Diffstat (limited to 'block/blk.h')
-rw-r--r-- | block/blk.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/block/blk.h b/block/blk.h index 94f7c084f68f..49e2928a1632 100644 --- a/block/blk.h +++ b/block/blk.h @@ -25,11 +25,6 @@ struct blk_flush_queue { struct list_head flush_data_in_flight; struct request *flush_rq; - /* - * flush_rq shares tag with this rq, both can't be active - * at the same time - */ - struct request *orig_rq; struct lock_class_key key; spinlock_t mq_flush_lock; }; @@ -270,6 +265,20 @@ static inline unsigned int bio_allowed_max_sectors(struct request_queue *q) } /* + * The max bio size which is aligned to q->limits.discard_granularity. This + * is a hint to split large discard bio in generic block layer, then if device + * driver needs to split the discard bio into smaller ones, their bi_size can + * be very probably and easily aligned to discard_granularity of the device's + * queue. + */ +static inline unsigned int bio_aligned_discard_max_sectors( + struct request_queue *q) +{ + return round_down(UINT_MAX, q->limits.discard_granularity) >> + SECTOR_SHIFT; +} + +/* * Internal io_context interface */ void get_io_context(struct io_context *ioc); |