[RFC PATCH 4/5] direct_IO: use iov_iter_rw() instead of rw everywhere

2015-03-16 Thread Omar Sandoval
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

[RFC PATCH 0/5] Remove rw parameter from direct_IO()

2015-03-16 Thread Omar Sandoval
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

Re: [RFC PATCH 1/5] new helper: iov_iter_rw()

2015-03-16 Thread Al Viro
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

Re: [RFC PATCH 0/5] Remove rw parameter from direct_IO()

2015-03-16 Thread Al Viro
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.

[RFC PATCH 2/5] Remove rw from {,__,do_}blockdev_direct_IO()

2015-03-16 Thread Omar Sandoval
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 ++-

[RFC PATCH 3/5] Remove rw from dax_{do_,}io()

2015-03-16 Thread Omar Sandoval
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

[RFC PATCH 1/5] new helper: iov_iter_rw()

2015-03-16 Thread Omar Sandoval
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 +++