X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=block%2Fblk.h;h=e8d598e4a948de5d4e5d9ff298166b2fb6cacbc0;hb=e45d4b5e270c693042c482bf4efb92e7d075dd2e;hp=3f1446937aece26f38ceb66cf4e3d159a23df871;hpb=4b43a3bc20ec6ecebb651f48a670373f9dfa1dbb;p=mirror_ubuntu-bionic-kernel.git diff --git a/block/blk.h b/block/blk.h index 3f1446937aec..e8d598e4a948 100644 --- a/block/blk.h +++ b/block/blk.h @@ -245,6 +245,16 @@ static inline void req_set_nomerge(struct request_queue *q, struct request *req) q->last_merge = NULL; } +/* + * 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 */ @@ -330,4 +340,6 @@ static inline void blk_queue_bounce(struct request_queue *q, struct bio **bio) } #endif /* CONFIG_BOUNCE */ +extern void blk_drain_queue(struct request_queue *q); + #endif /* BLK_INTERNAL_H */