LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Omar Sandoval <osandov@osandov.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Omar Sandoval <osandov@osandov.com>
Subject: [RFC PATCH v2 1/5] new helper: iov_iter_rw()
Date: Mon, 16 Mar 2015 18:20:19 -0700	[thread overview]
Message-ID: <c490fdcbd22c03345c8718f11a4f45b12978d131.1426553966.git.osandov@osandov.com> (raw)
In-Reply-To: <20150316173605.GX29656@ZenIV.linux.org.uk>

Get either READ or WRITE out of iter->type.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
---
Thanks, Al, this is much better. Anything else you'd like me to address
for this series?

 include/linux/uio.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/linux/uio.h b/include/linux/uio.h
index 7188029..3d80a36 100644
--- a/include/linux/uio.h
+++ b/include/linux/uio.h
@@ -111,6 +111,12 @@ 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.
+ */
+#define iov_iter_rw(i) ((0 ? (struct iov_iter *)0 : (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


  reply	other threads:[~2015-03-17  1:21 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 ` [RFC PATCH 1/5] new helper: iov_iter_rw() Omar Sandoval
2015-03-16 17:36   ` Al Viro
2015-03-17  1:20     ` Omar Sandoval [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-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=c490fdcbd22c03345c8718f11a4f45b12978d131.1426553966.git.osandov@osandov.com \
    --to=osandov@osandov.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    --subject='Re: [RFC PATCH v2 1/5] new helper: iov_iter_rw()' \
    /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

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).