From patchwork Tue Mar 17 01:20:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 6026861 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 275FE9F314 for ; Tue, 17 Mar 2015 01:22:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 595272045B for ; Tue, 17 Mar 2015 01:22:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 204AD2013D for ; Tue, 17 Mar 2015 01:22:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751426AbbCQBVh (ORCPT ); Mon, 16 Mar 2015 21:21:37 -0400 Received: from mail-pa0-f49.google.com ([209.85.220.49]:35488 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751201AbbCQBVh (ORCPT ); Mon, 16 Mar 2015 21:21:37 -0400 Received: by pabyw6 with SMTP id yw6so81279184pab.2 for ; Mon, 16 Mar 2015 18:21:36 -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; bh=xa9jWc9McFMNZcTNZDODIYDNVbWP4veMUaC4UIr9Vf8=; b=hsnivgOHl9OLjHs3Sr+FyWHpcGuhFwPxtzkSeOaza0WJ6IXPtN20h+I34O1K4KHfjz NOo5wjQPPPU4a/DHZVSnMRH5v7xbKsOoDb/jp9/8PQadEeGrkT0/mEydNve3ww7LuXKu 6xxl2/I6FJDF4R7LgocK5gjy5qKCWpH+RmBiK/5fzrzLosCbwBU8f3opo8NRtQDUM8q8 JdDERDhrN/qRu4rRItHOVoKXuODY+0A3cKVzh4wjIykuh9SPmol1bAMOW8nMzAL0cUT2 b6IVisX8EAGQs6obvr4TofkPpFO0RH8iJxmUe/WDp8Uc5a1UmdqjZ/mhla7qxAwNfpWr vT4A== X-Gm-Message-State: ALoCoQl13EovZLnXr19xIdaDObDfdXIV8Nzcis3nkFcQ9QSUgmQIB8xJSv0THh81ILd6Kdwo554C X-Received: by 10.70.90.193 with SMTP id by1mr107642369pdb.135.1426555296814; Mon, 16 Mar 2015 18:21:36 -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 x4sm19340881pas.40.2015.03.16.18.21.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Mar 2015 18:21:35 -0700 (PDT) From: Omar Sandoval To: Al Viro Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Omar Sandoval Subject: [RFC PATCH v2 1/5] new helper: iov_iter_rw() Date: Mon, 16 Mar 2015 18:20:19 -0700 Message-Id: X-Mailer: git-send-email 2.3.3 In-Reply-To: <20150316173605.GX29656@ZenIV.linux.org.uk> References: <20150316173605.GX29656@ZenIV.linux.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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 --- 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