From: Al Viro <viro@ZenIV.linux.org.uk>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [RFC PATCH 1/5] new helper: iov_iter_rw()
Date: Mon, 16 Mar 2015 17:36:05 +0000 [thread overview]
Message-ID: <20150316173605.GX29656@ZenIV.linux.org.uk> (raw)
In-Reply-To: <34dc78b262546e9343e0ed872232a97f5eaa5f15.1426502566.git.osandov@osandov.com>
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 i->type & RW_MASK;
> +}
TBH, I would turn that into a macro. Reason: indirect includes.
How about
#define iov_iter_rw(i) ((0 ? (struct iov_iter *)0 : (i))->type & RW_MASK)
Should do you all the type safety of inline function and avoids the need
to include fs.h in uio.h; _users_ of iov_iter_rw() obviously still need
fs.h, but such places always used to...
next prev parent reply other threads:[~2015-03-16 17:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-16 11:33 [Cluster-devel] [RFC PATCH 0/5] Remove rw parameter from direct_IO() Omar Sandoval
2015-03-16 11:33 ` [Cluster-devel] [RFC PATCH 1/5] new helper: iov_iter_rw() Omar Sandoval
2015-03-16 17:36 ` Al Viro [this message]
2015-03-17 9:31 ` David Sterba
2015-03-17 10:18 ` Omar Sandoval
2015-03-17 18:19 ` Al Viro
2015-03-16 11:33 ` [Cluster-devel] [RFC PATCH 2/5] Remove rw from {, __, do_}blockdev_direct_IO() Omar Sandoval
2015-03-16 11:33 ` [Cluster-devel] [RFC PATCH 3/5] Remove rw from dax_{do_,}io() Omar Sandoval
2015-03-16 11:33 ` [Cluster-devel] [RFC PATCH 4/5] direct_IO: use iov_iter_rw() instead of rw everywhere Omar Sandoval
2015-03-16 11:33 ` [Cluster-devel] [RFC PATCH 5/5] direct_IO: remove rw from a_ops->direct_IO() Omar Sandoval
2015-03-16 18:15 ` [Cluster-devel] [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=20150316173605.GX29656@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
/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).