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: 6017001 Return-Path: X-Original-To: patchwork-cifs-client@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 515BEBF90F for ; Mon, 16 Mar 2015 11:37:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 92805201F4 for ; Mon, 16 Mar 2015 11:37:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A8C5620437 for ; Mon, 16 Mar 2015 11:37:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754099AbbCPLgx (ORCPT ); Mon, 16 Mar 2015 07:36:53 -0400 Received: from mail-pd0-f182.google.com ([209.85.192.182]:32841 "EHLO mail-pd0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753679AbbCPLfN (ORCPT ); Mon, 16 Mar 2015 07:35:13 -0400 Received: by pdnc3 with SMTP id c3so56072738pdn.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=UNf6MBZkGO47Vnc9jwknRbOHq9Yli4jXbg6lYRdGZG/y0IF4iophdXXd/5dKM5OneK +WYGkOdHzEvGct4Ih1xJNaprjrFzS9FDeYb2+oNI+koSzviQvkfZXo2lQe9zCAMbH8M7 UAeRVSGvqSo4rCd9t3O7WY138PI34TsunSn4zM5OGo4rPobV+pQnjJeB2y0/VtbJ9ogd yYdHb9cmTyyBCQIluNEXTRBkhvpduaDYOJMyiUohSQqDyKQA56VVtKUStdNNZAIGzQp6 kd9JEsrZywuBMUfqF/Nxt30fKUZpEbHqNJX11ldzQz/CosMZEHEn5/Sr6mQHTgIUOdUA TCOQ== X-Gm-Message-State: ALoCoQluRNvtomRUu20XvRC534tkYPBzMzfJNr4E9cIUNBD9t0rli/05KDVspl7NwxxJ86e4jV1D 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-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@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=unavailable 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