diff options
author | Jens Axboe <axboe@kernel.dk> | 2018-11-18 15:46:03 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-11-18 15:46:03 -0700 |
commit | a78b03bc7300e4f17b1e510884bea1095d92b17b (patch) | |
tree | 855f219806462da09c8021b27848c58713bb1807 /block/blk.h | |
parent | fce15a609f8f30cfacfaf684729add9582be780b (diff) | |
parent | 9ff01193a20d391e8dbce4403dd5ef87c7eaaca6 (diff) | |
download | lwn-a78b03bc7300e4f17b1e510884bea1095d92b17b.tar.gz lwn-a78b03bc7300e4f17b1e510884bea1095d92b17b.zip |
Merge tag 'v4.20-rc3' into for-4.21/block
Merge in -rc3 to resolve a few conflicts, but also to get a few
important fixes that have gone into mainline since the block
4.21 branch was forked off (most notably the SCSI queue issue,
which is both a conflict AND needed fix).
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk.h')
-rw-r--r-- | block/blk.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/block/blk.h b/block/blk.h index 027a0ccc175e..816a9abb87cd 100644 --- a/block/blk.h +++ b/block/blk.h @@ -85,7 +85,7 @@ static inline bool biovec_phys_mergeable(struct request_queue *q, static inline bool __bvec_gap_to_prev(struct request_queue *q, struct bio_vec *bprv, unsigned int offset) { - return offset || + return (offset & queue_virt_boundary(q)) || ((bprv->bv_offset + bprv->bv_len) & queue_virt_boundary(q)); } @@ -234,6 +234,16 @@ static inline void req_set_nomerge(struct request_queue *q, struct request *req) } /* + * The max size one bio can handle is UINT_MAX becasue bvec_iter.bi_size + * is defined as 'unsigned int', meantime it has to aligned to with logical + * block size which is the minimum accepted unit by hardware. + */ +static inline unsigned int bio_allowed_max_sectors(struct request_queue *q) +{ + return round_down(UINT_MAX, queue_logical_block_size(q)) >> 9; +} + +/* * Internal io_context interface */ void get_io_context(struct io_context *ioc); |