summaryrefslogtreecommitdiff
path: root/block/blk.h
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2018-12-13 20:20:36 +0300
committerRob Herring <robh@kernel.org>2018-12-13 20:20:36 +0300
commitacc2038738bd6f881e7a277ba14fa7c589fd3058 (patch)
treefd56524867a9b726b3e5d2cb040ff16b2f2a67a0 /block/blk.h
parentcd1cc0bef46fc8d8f9ebe82d2064d4f4bd5ecf16 (diff)
parent2c9b0b00af23cdc70d28d82e077dc1d280bcb84a (diff)
downloadlinux-acc2038738bd6f881e7a277ba14fa7c589fd3058.tar.xz
Merge branch 'yaml-bindings-for-v4.21' into dt/next
Diffstat (limited to 'block/blk.h')
-rw-r--r--block/blk.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/block/blk.h b/block/blk.h
index a1841b8ff129..0089fefdf771 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -169,7 +169,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));
}
@@ -396,6 +396,16 @@ static inline unsigned long blk_rq_deadline(struct request *rq)
}
/*
+ * 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);