Thread (25 messages) 25 messages, 5 authors, 2021-06-24

Re: [dm-devel] [PATCH 06/18] bvec: add a bvec_kmap_local helper

From: Bart Van Assche <bvanassche@acm.org>
Date: 2021-06-16 16:52:35
Also in: ceph-devel, dm-devel, linux-block, linux-mips, linuxppc-dev, lkml

On 6/15/21 6:24 AM, Christoph Hellwig wrote:
+/**
+ * bvec_kmap_local - map a bvec into the kernel virtual address space
+ * @bvec: bvec to map
+ *
+ * Must be called on single-page bvecs only.  Call kunmap_local on the returned
+ * address to unmap.
+ */
+static inline void *bvec_kmap_local(struct bio_vec *bvec)
+{
+	return kmap_local_page(bvec->bv_page) + bvec->bv_offset;
+}
Hi Christoph,

Would it be appropriate to add WARN_ON_ONCE(bvec->bv_offset >=
PAGE_SIZE) in this function?

Thanks,

Bart.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help