From mboxrd@z Thu Jan 1 00:00:00 1970 From: Logan Gunthorpe Subject: [RFC PATCH 09/16] bvec: introduce bvec_page and bvec_set_page accessors Date: Wed, 24 May 2017 15:42:20 -0600 Message-ID: <1495662147-18277-10-git-send-email-logang@deltatee.com> References: <1495662147-18277-1-git-send-email-logang@deltatee.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1495662147-18277-1-git-send-email-logang-OTvnGxWRz7hWk0Htik3J/w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org Sender: "Linux-nvdimm" To: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-block-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org, linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: Jens Axboe , Keith Busch , Andrew Morton , Johannes Berg , Matthew Wilcox , Benjamin Herrenschmidt , Ming Lei , =?UTF-8?q?Christian=20K=C3=B6nig?= , Jason Gunthorpe , Jerome Glisse , Christoph Hellwig List-Id: linux-rdma@vger.kernel.org Introduce two accessor functions for bv_page: bvec_page to return the page and bvec_set_page. A follow on patch will mechanically convert all the individual uses within the kernel. Signed-off-by: Logan Gunthorpe Signed-off-by: Stephen Bates --- include/linux/bvec.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/linux/bvec.h b/include/linux/bvec.h index 89b65b8..b5369a0 100644 --- a/include/linux/bvec.h +++ b/include/linux/bvec.h @@ -43,6 +43,16 @@ struct bvec_iter { current bvec */ }; +static inline struct page *bvec_page(const struct bio_vec *bvec) +{ + return bvec->bv_page; +} + +static inline void bvec_set_page(struct bio_vec *bvec, struct page *page) +{ + bvec->bv_page = page; +} + /* * various member access, note that bio_data should of course not be used * on highmem page vectors -- 2.1.4