提交 e6e74717 编写于 作者: C Christoph Hellwig 提交者: Jens Axboe

bvec: add a bvec_kmap_local helper

Add a helper to call kmap_local_page on a bvec.  There is no need for
an unmap helper given that kunmap_local accept any address in the mapped
page.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: NMartin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: NIra Weiny <ira.weiny@intel.com>
Link: https://lore.kernel.org/r/20210727055646.118787-4-hch@lst.deSigned-off-by: NJens Axboe <axboe@kernel.dk>
上级 e45cef51
......@@ -7,6 +7,7 @@
#ifndef __LINUX_BVEC_H
#define __LINUX_BVEC_H
#include <linux/highmem.h>
#include <linux/bug.h>
#include <linux/errno.h>
#include <linux/limits.h>
......@@ -183,4 +184,16 @@ static inline void bvec_advance(const struct bio_vec *bvec,
}
}
/**
* 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;
}
#endif /* __LINUX_BVEC_H */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册