From: David Howells <dhowells@redhat.com>
To: Jens Axboe <axboe@kernel.dk>, Al Viro <viro@zeniv.linux.org.uk>,
Christoph Hellwig <hch@infradead.org>
Cc: David Howells <dhowells@redhat.com>,
Matthew Wilcox <willy@infradead.org>, Jan Kara <jack@suse.cz>,
Jeff Layton <jlayton@kernel.org>,
David Hildenbrand <david@redhat.com>,
Jason Gunthorpe <jgg@nvidia.com>,
Logan Gunthorpe <logang@deltatee.com>,
Hillf Danton <hdanton@sina.com>,
Christian Brauner <brauner@kernel.org>,
linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Christoph Hellwig <hch@lst.de>,
Christian Brauner <christian@brauner.io>
Subject: [RFC PATCH 08/11] iov_iter: Drop iov_iter_rw() and fold in last user
Date: Fri, 30 Jun 2023 16:25:21 +0100 [thread overview]
Message-ID: <20230630152524.661208-9-dhowells@redhat.com> (raw)
In-Reply-To: <20230630152524.661208-1-dhowells@redhat.com>
Drop the last usage of iov_iter_rw() into __iov_iter_get_pages_alloc().
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Christoph Hellwig <hch@lst.de>
cc: Jens Axboe <axboe@kernel.dk>
cc: Christian Brauner <christian@brauner.io>
cc: Alexander Viro <viro@zeniv.linux.org.uk>
cc: linux-block@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
---
include/linux/uio.h | 5 -----
lib/iov_iter.c | 2 +-
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/include/linux/uio.h b/include/linux/uio.h
index ff81e5ccaef2..70e12f536f8f 100644
--- a/include/linux/uio.h
+++ b/include/linux/uio.h
@@ -136,11 +136,6 @@ static inline bool iov_iter_is_xarray(const struct iov_iter *i)
return iov_iter_type(i) == ITER_XARRAY;
}
-static inline unsigned char iov_iter_rw(const struct iov_iter *i)
-{
- return i->data_source ? WRITE : READ;
-}
-
static inline bool user_backed_iter(const struct iov_iter *i)
{
return i->user_backed;
diff --git a/lib/iov_iter.c b/lib/iov_iter.c
index b667b1e2f688..b8c52231a6ff 100644
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -1097,7 +1097,7 @@ static ssize_t __iov_iter_get_pages_alloc(struct iov_iter *i,
unsigned long addr;
int res;
- if (iov_iter_rw(i) != WRITE)
+ if (i->data_source == ITER_SOURCE)
gup_flags |= FOLL_WRITE;
if (i->nofault)
gup_flags |= FOLL_NOFAULT;
next prev parent reply other threads:[~2023-06-30 15:26 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-30 15:25 [RFC PATCH 00/11] iov_iter: Use I/O direction from kiocb, iomap & request rather than iov_iter David Howells
2023-06-30 15:25 ` [RFC PATCH 01/11] iov_iter: Fix comment refs to iov_iter_get_pages/pages_alloc() David Howells
2023-07-06 15:21 ` Christoph Hellwig
2023-06-30 15:25 ` [RFC PATCH 02/11] vfs: Set IOCB_WRITE in iocbs that we're going to write from David Howells
2023-07-06 15:22 ` Christoph Hellwig
2023-06-30 15:25 ` [RFC PATCH 03/11] vfs: Use init_kiocb() to initialise new IOCBs David Howells
2023-06-30 15:39 ` Jens Axboe
2023-06-30 16:00 ` David Howells
2023-06-30 16:05 ` Jens Axboe
2023-07-06 15:29 ` Christoph Hellwig
2023-06-30 15:25 ` [RFC PATCH 04/11] iov_iter: Use IOCB_WRITE rather than iterator direction David Howells
2023-06-30 15:25 ` [RFC PATCH 05/11] iov_iter: Use IOMAP_WRITE " David Howells
2023-07-06 15:30 ` Christoph Hellwig
2023-06-30 15:25 ` [RFC PATCH 06/11] iov_iter: Use op_is_write() " David Howells
2023-07-06 15:30 ` Christoph Hellwig
2023-06-30 15:25 ` [RFC PATCH 07/11] cifs: Drop the check using iov_iter_rw() David Howells
2023-06-30 15:25 ` David Howells [this message]
2023-07-06 15:31 ` [RFC PATCH 08/11] iov_iter: Drop iov_iter_rw() and fold in last user Christoph Hellwig
2023-06-30 15:25 ` [RFC PATCH 09/11] iov_iter: Use I/O dir flags with iov_iter_extract_pages() David Howells
2023-06-30 15:25 ` [RFC PATCH 10/11] 9p: Pin pages rather than ref'ing if appropriate David Howells
2023-06-30 15:25 ` [RFC PATCH 11/11] scsi: Use extract_iter_to_sg() David Howells
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230630152524.661208-9-dhowells@redhat.com \
--to=dhowells@redhat.com \
--cc=axboe@kernel.dk \
--cc=brauner@kernel.org \
--cc=christian@brauner.io \
--cc=david@redhat.com \
--cc=hch@infradead.org \
--cc=hch@lst.de \
--cc=hdanton@sina.com \
--cc=jack@suse.cz \
--cc=jgg@nvidia.com \
--cc=jlayton@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=logang@deltatee.com \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox