The rw parameter to direct_IO is redundant with iov_iter-type, and
treated slightly differently just about everywhere it's used: some users
do rw WRITE, and others do rw == WRITE where they should be doing a
bitwise check. Simplify this with the new iov_iter_rw() helper, which
always returns
Hi,
Al, here's some cleanup that you mentioned back in December that I got
around to (https://lkml.org/lkml/2014/12/15/28).
In summary, the rw parameter to a_ops-direct_IO() is redundant with
.type in struct iov_iter. Additionally, rw is inconsistently checked for
being a WRITE; some filesystems
On Mon, Mar 16, 2015 at 04:33:49AM -0700, Omar Sandoval wrote:
Get either READ or WRITE out of iter-type.
Umm...
+ * Get one of READ or WRITE out of iter-type without any other flags OR'd in
+ * with it.
+ */
+static inline int iov_iter_rw(const struct iov_iter *i)
+{
+ return
On Mon, Mar 16, 2015 at 04:33:48AM -0700, Omar Sandoval wrote:
Hi,
Al, here's some cleanup that you mentioned back in December that I got
around to (https://lkml.org/lkml/2014/12/15/28).
In summary, the rw parameter to a_ops-direct_IO() is redundant with
.type in struct iov_iter.
Most filesystems call through to these at some point, so we'll start
here.
Signed-off-by: Omar Sandoval osan...@osandov.com
---
fs/affs/file.c | 2 +-
fs/block_dev.c | 5 ++---
fs/btrfs/inode.c| 8
fs/direct-io.c | 39 ++-
And use iov_iter_rw() instead.
Signed-off-by: Omar Sandoval osan...@osandov.com
---
fs/dax.c | 27 +--
fs/ext2/inode.c| 4 ++--
fs/ext4/indirect.c | 4 ++--
fs/ext4/inode.c| 2 +-
include/linux/fs.h | 4 ++--
5 files changed, 20 insertions(+), 21
Get either READ or WRITE out of iter-type.
Signed-off-by: Omar Sandoval osan...@osandov.com
---
include/linux/uio.h | 10 ++
1 file changed, 10 insertions(+)
diff --git a/include/linux/uio.h b/include/linux/uio.h
index 7188029..87a47b3 100644
--- a/include/linux/uio.h
+++