From: Omar Sandoval <osandov@osandov.com>
To: Alexander Viro <viro@zeniv.linux.org.uk>,
linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org,
ceph-devel@vger.kernel.org, linux-cifs@vger.kernel.org,
osd-dev@open-osd.org, linux-ext4@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net,
fuse-devel@lists.sourceforge.net, cluster-devel@redhat.com,
jfs-discussion@lists.sourceforge.net, HPDD-discuss@ml01.01.org,
linux-nfs@vger.kernel.org, linux-nilfs@vger.kernel.org,
ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org,
v9fs-developer@lists.sourceforge.net, xfs@oss.sgi.com
Cc: linux-kernel@vger.kernel.org, Chris Mason <clm@fb.com>,
Josef Bacik <jbacik@fb.com>, David Sterba <dsterba@suse.cz>,
"Yan Zheng" <zyan@redhat.com>, Sage Weil <sage@redhat.com>,
Steve French <sfrench@samba.org>,
Boaz Harrosh <ooo@electrozaur.com>,
Benny Halevy <bhalevy@primarydata.com>, Jan Kara <jack@suse.cz>,
"Theodore Ts'o" <tytso@mit.edu>,
Andreas Dilger <adilger.kernel@dilger.ca>,
Jaegeuk Kim <jaegeuk@kernel.org>,
Changman Lee <cm224.lee@samsung.com>,
Miklos Szeredi <miklos@szeredi.hu>,
Steven Whitehouse <swhiteho@redhat.com>,
Dave Kleikamp <shaggy@kernel.org>,
Oleg Drokin <oleg.drokin@intel.com>,
Trond Myklebust <trond.myklebust@primarydata.com>,
Anna Schumaker <anna.schumaker@netapp.com>,
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>,
Mark Fasheh <mfasheh@suse.com>, Joel Becker <jlbec@evilplan.org>,
Eric Van Hensbergen <ericvh@gmail.com>,
Ron Minnich <rminnich@sandia.gov>,
Latchesar Ionkov <lucho@ionkov.net>,
Dave Chinner <david@fromorbit.com>,
Omar Sandoval <osandov@osandov.com>
Subject: [RFC PATCH 1/5] new helper: iov_iter_rw()
Date: Mon, 16 Mar 2015 04:33:49 -0700 [thread overview]
Message-ID: <34dc78b262546e9343e0ed872232a97f5eaa5f15.1426502566.git.osandov@osandov.com> (raw)
In-Reply-To: <cover.1426502566.git.osandov@osandov.com>
In-Reply-To: <cover.1426502566.git.osandov@osandov.com>
Get either READ or WRITE out of iter->type.
Signed-off-by: Omar Sandoval <osandov@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
+++ b/include/linux/uio.h
@@ -10,6 +10,7 @@
#define __LINUX_UIO_H
#include <linux/kernel.h>
+#include <linux/fs.h>
#include <uapi/linux/uio.h>
struct page;
@@ -111,6 +112,15 @@ static inline bool iter_is_iovec(struct iov_iter *i)
}
/*
+ * 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 i->type & RW_MASK;
+}
+
+/*
* Cap the iov_iter by given limit; note that the second argument is
* *not* the new size - it's upper limit for such. Passing it a value
* greater than the amount of data in iov_iter is fine - it'll just do
--
2.3.3
next prev parent reply other threads:[~2015-03-16 11:37 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-16 11:33 [RFC PATCH 0/5] Remove rw parameter from direct_IO() Omar Sandoval
2015-03-16 11:33 ` Omar Sandoval [this message]
2015-03-16 17:36 ` [RFC PATCH 1/5] new helper: iov_iter_rw() Al Viro
2015-03-17 1:20 ` [RFC PATCH v2 " Omar Sandoval
2015-03-17 9:31 ` [RFC PATCH " David Sterba
2015-03-17 10:18 ` Omar Sandoval
2015-03-17 18:19 ` Al Viro
2015-03-17 21:04 ` [RFC PATCH v3 " Omar Sandoval
2015-03-18 13:42 ` David Sterba
2015-03-16 11:33 ` [RFC PATCH 2/5] Remove rw from {,__,do_}blockdev_direct_IO() Omar Sandoval
2015-03-16 11:33 ` [RFC PATCH 3/5] Remove rw from dax_{do_,}io() Omar Sandoval
2015-03-16 11:33 ` [RFC PATCH 4/5] direct_IO: use iov_iter_rw() instead of rw everywhere Omar Sandoval
2015-03-16 11:33 ` [RFC PATCH 5/5] direct_IO: remove rw from a_ops->direct_IO() Omar Sandoval
2015-03-16 18:15 ` [RFC PATCH 0/5] Remove rw parameter from direct_IO() Al Viro
2015-04-05 16:27 ` Al Viro
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=34dc78b262546e9343e0ed872232a97f5eaa5f15.1426502566.git.osandov@osandov.com \
--to=osandov@osandov.com \
--cc=HPDD-discuss@ml01.01.org \
--cc=adilger.kernel@dilger.ca \
--cc=anna.schumaker@netapp.com \
--cc=bhalevy@primarydata.com \
--cc=ceph-devel@vger.kernel.org \
--cc=clm@fb.com \
--cc=cluster-devel@redhat.com \
--cc=cm224.lee@samsung.com \
--cc=david@fromorbit.com \
--cc=dsterba@suse.cz \
--cc=ericvh@gmail.com \
--cc=fuse-devel@lists.sourceforge.net \
--cc=jack@suse.cz \
--cc=jaegeuk@kernel.org \
--cc=jbacik@fb.com \
--cc=jfs-discussion@lists.sourceforge.net \
--cc=jlbec@evilplan.org \
--cc=konishi.ryusuke@lab.ntt.co.jp \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=linux-nilfs@vger.kernel.org \
--cc=lucho@ionkov.net \
--cc=mfasheh@suse.com \
--cc=miklos@szeredi.hu \
--cc=ocfs2-devel@oss.oracle.com \
--cc=oleg.drokin@intel.com \
--cc=ooo@electrozaur.com \
--cc=osd-dev@open-osd.org \
--cc=reiserfs-devel@vger.kernel.org \
--cc=rminnich@sandia.gov \
--cc=sage@redhat.com \
--cc=sfrench@samba.org \
--cc=shaggy@kernel.org \
--cc=swhiteho@redhat.com \
--cc=trond.myklebust@primarydata.com \
--cc=tytso@mit.edu \
--cc=v9fs-developer@lists.sourceforge.net \
--cc=viro@zeniv.linux.org.uk \
--cc=xfs@oss.sgi.com \
--cc=zyan@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).