From patchwork Mon Mar 16 11:33:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 6016801 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 56959BF90F for ; Mon, 16 Mar 2015 11:35:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7DAB5204AB for ; Mon, 16 Mar 2015 11:35:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8EE26204D9 for ; Mon, 16 Mar 2015 11:35:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753744AbbCPLfY (ORCPT ); Mon, 16 Mar 2015 07:35:24 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:33307 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753688AbbCPLfN (ORCPT ); Mon, 16 Mar 2015 07:35:13 -0400 Received: by pagr17 with SMTP id r17so62569913pag.0 for ; Mon, 16 Mar 2015 04:35:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=NgC+NbioDATOS4h53rjzIH+P36WDDU1wPZsbESbUL7o=; b=lGpzqL/EYVTRXW12VEnJU3HDFuU/OgcggsiY1a9uRgoJHXBnl9zQDESzrNZB1CuYKT X9HPFLZB1kuRlSqPd7fGz1rZvU8guBx3GHH7nFwIcjgjHz2nYsDSoJPIIhvGaqqM9NEF hYUInSelAxpZ+FjCt4kEtPIl4FZYSy6uisBTOiK5Ro0k8/8NA4xgyGyhQtz/zkbCiWZE H7+lTcuHnliRShhUnGyL+/8iIcRTdIkPr7cHzE1gM+YPN+gADRbvZK4+NG5g+OyZGOs0 wNRgaVxZpm8Jfowj7EOOeqhJwSeOXC4frSAuw/Uu6Ue1NfHyyKb/5aUA5PbwfrnT7XnD JfSg== X-Gm-Message-State: ALoCoQk3QyYmnFyXziEsWrzhBeWYX6Tvvhn7zP5vRZKKBhinrLMW57T1dqgnT3vH15ZQovPRDmod X-Received: by 10.70.126.225 with SMTP id nb1mr137126264pdb.40.1426505712114; Mon, 16 Mar 2015 04:35:12 -0700 (PDT) Received: from mew.localdomain (c-76-104-211-44.hsd1.wa.comcast.net. [76.104.211.44]) by mx.google.com with ESMTPSA id ae7sm16957294pac.19.2015.03.16.04.35.10 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Mar 2015 04:35:11 -0700 (PDT) From: Omar Sandoval To: Alexander Viro , 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@lists.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 , Josef Bacik , David Sterba , "Yan Zheng" , Sage Weil , Steve French , Boaz Harrosh , Benny Halevy , Jan Kara , "Theodore Ts'o" , Andreas Dilger , Jaegeuk Kim , Changman Lee , Miklos Szeredi , Steven Whitehouse , Dave Kleikamp , Oleg Drokin , Trond Myklebust , Anna Schumaker , Ryusuke Konishi , Mark Fasheh , Joel Becker , Eric Van Hensbergen , Ron Minnich , Latchesar Ionkov , Dave Chinner , Omar Sandoval Subject: [RFC PATCH 1/5] new helper: iov_iter_rw() Date: Mon, 16 Mar 2015 04:33:49 -0700 Message-Id: <34dc78b262546e9343e0ed872232a97f5eaa5f15.1426502566.git.osandov@osandov.com> X-Mailer: git-send-email 2.3.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Get either READ or WRITE out of iter->type. Signed-off-by: Omar Sandoval --- 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 +#include #include 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