From 8ad302ffc91879efbe51b59e80b9e9e4ed31318a Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 20 May 2021 13:57:56 +0200 Subject: [PATCH] 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: Christoph Hellwig --- include/linux/bvec.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/bvec.h b/include/linux/bvec.h index 883faf5f1523..5048df1b432c 100644 --- a/include/linux/bvec.h +++ b/include/linux/bvec.h @@ -7,6 +7,7 @@ #ifndef __LINUX_BVEC_H #define __LINUX_BVEC_H +#include #include #include #include @@ -183,4 +184,9 @@ static inline void bvec_advance(const struct bio_vec *bvec, } } +static inline char *bvec_kmap_local(struct bio_vec *bvec) +{ + return kmap_local_page(bvec->bv_page) + bvec->bv_offset; +} + #endif /* __LINUX_BVEC_H */ -- 2.50.1