[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190411210834.4105-15-jglisse@redhat.com>
Date: Thu, 11 Apr 2019 17:08:33 -0400
From: jglisse@...hat.com
To: linux-kernel@...r.kernel.org
Cc: Jérôme Glisse <jglisse@...hat.com>,
linux-fsdevel@...r.kernel.org, linux-block@...r.kernel.org,
linux-mm@...ck.org, John Hubbard <jhubbard@...dia.com>,
Jan Kara <jack@...e.cz>,
Dan Williams <dan.j.williams@...el.com>,
Alexander Viro <viro@...iv.linux.org.uk>,
Johannes Thumshirn <jthumshirn@...e.de>,
Christoph Hellwig <hch@....de>, Jens Axboe <axboe@...nel.dk>,
Ming Lei <ming.lei@...hat.com>,
Dave Chinner <david@...morbit.com>,
Jason Gunthorpe <jgg@...pe.ca>,
Matthew Wilcox <willy@...radead.org>,
Steve French <sfrench@...ba.org>, linux-cifs@...r.kernel.org,
samba-technical@...ts.samba.org, Ilya Dryomov <idryomov@...il.com>,
Sage Weil <sage@...hat.com>, Alex Elder <elder@...nel.org>,
ceph-devel@...r.kernel.org
Subject: [PATCH v1 14/15] fs: use bvec_set_gup_page() where appropriate
From: Jérôme Glisse <jglisse@...hat.com>
When we get a page reference through get_user_page*() we want to keep
track of that and bvec now has the ability to do so. Convert code to
use bvec_set_gup_page() where appropriate.
Signed-off-by: Jérôme Glisse <jglisse@...hat.com>
Cc: linux-fsdevel@...r.kernel.org
Cc: linux-block@...r.kernel.org
Cc: linux-mm@...ck.org
Cc: John Hubbard <jhubbard@...dia.com>
Cc: Jan Kara <jack@...e.cz>
Cc: Dan Williams <dan.j.williams@...el.com>
Cc: Alexander Viro <viro@...iv.linux.org.uk>
Cc: Johannes Thumshirn <jthumshirn@...e.de>
Cc: Christoph Hellwig <hch@....de>
Cc: Jens Axboe <axboe@...nel.dk>
Cc: Ming Lei <ming.lei@...hat.com>
Cc: Dave Chinner <david@...morbit.com>
Cc: Jason Gunthorpe <jgg@...pe.ca>
Cc: Matthew Wilcox <willy@...radead.org>
Cc: Steve French <sfrench@...ba.org>
Cc: linux-cifs@...r.kernel.org
Cc: samba-technical@...ts.samba.org
Cc: Ilya Dryomov <idryomov@...il.com>
Cc: Sage Weil <sage@...hat.com>
Cc: Alex Elder <elder@...nel.org>
Cc: ceph-devel@...r.kernel.org
---
fs/ceph/file.c | 3 +++
fs/cifs/misc.c | 6 +++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index d5561662b902..6c5b85f01721 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -104,6 +104,9 @@ static ssize_t __iter_get_bvecs(struct iov_iter *iter, size_t maxsize,
min_t(int, bytes, PAGE_SIZE - start),
start);
+ /* Is iov_iter_get_pages() using GUP ? */
+ if (iov_iter_get_pages_use_gup(iter))
+ bvec_set_gup_page(&bv, pages[idx]);
bvecs[bvec_idx] = bv;
bytes -= bv.bv_len;
start = 0;
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index bc77a4a5f1af..e10d9f0f5874 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -883,7 +883,11 @@ setup_aio_ctx_iter(struct cifs_aio_ctx *ctx, struct iov_iter *iter, int rw)
for (i = 0; i < cur_npages; i++) {
len = rc > PAGE_SIZE ? PAGE_SIZE : rc;
- bvec_set_page(&bv[npages + i], pages[i]);
+ /* Is iov_iter_get_pages() using GUP ? */
+ if (iov_iter_get_pages_use_gup(iter))
+ bvec_set_gup_page(&bv[npages + i], pages[i]);
+ else
+ bvec_set_page(&bv[npages + i], pages[i]);
bv[npages + i].bv_offset = start;
bv[npages + i].bv_len = len - start;
rc -= len;
--
2.20.1
Powered by blists - more mailing lists