From patchwork Fri Jun 30 15:25:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13298391 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 833B8EB64DA for ; Fri, 30 Jun 2023 15:28:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232663AbjF3P2c (ORCPT ); Fri, 30 Jun 2023 11:28:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233080AbjF3P1Q (ORCPT ); Fri, 30 Jun 2023 11:27:16 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 542284203 for ; Fri, 30 Jun 2023 08:26:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688138759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4Jdd9WWzw52HFg7DtTsZeyIq/lnUM49zKvJ/hNK831U=; b=Tbd3Zv1OK4NlKF7NtYKlcD1wwOnM+rRCOStz2x3BM5g/WFl9GlQcnQ9NqFKqQnu+/1s4c4 VwYY29tAEs77ffBQv3uO+Ndj8M0qqUZ5j7Z7agAn0rGPvvN+tIx0SomC0EUhqSUDJrC5Fh 7L99bv4xsyFlqhonvHh18jSjAQCcDDA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-636-JWUOtE-7PZaOWCY4vn-G4w-1; Fri, 30 Jun 2023 11:25:52 -0400 X-MC-Unique: JWUOtE-7PZaOWCY4vn-G4w-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 06884800B35; Fri, 30 Jun 2023 15:25:52 +0000 (UTC) Received: from warthog.procyon.org.uk.com (unknown [10.42.28.195]) by smtp.corp.redhat.com (Postfix) with ESMTP id C4B2F2166B2D; Fri, 30 Jun 2023 15:25:49 +0000 (UTC) From: David Howells To: Jens Axboe , Al Viro , Christoph Hellwig Cc: David Howells , Matthew Wilcox , Jan Kara , Jeff Layton , David Hildenbrand , Jason Gunthorpe , Logan Gunthorpe , Hillf Danton , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Christoph Hellwig , Christian Brauner Subject: [RFC PATCH 08/11] iov_iter: Drop iov_iter_rw() and fold in last user Date: Fri, 30 Jun 2023 16:25:21 +0100 Message-ID: <20230630152524.661208-9-dhowells@redhat.com> In-Reply-To: <20230630152524.661208-1-dhowells@redhat.com> References: <20230630152524.661208-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Drop the last usage of iov_iter_rw() into __iov_iter_get_pages_alloc(). Signed-off-by: David Howells cc: Christoph Hellwig cc: Jens Axboe cc: Christian Brauner cc: Alexander Viro cc: linux-block@vger.kernel.org cc: linux-fsdevel@vger.kernel.org --- include/linux/uio.h | 5 ----- lib/iov_iter.c | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/include/linux/uio.h b/include/linux/uio.h index ff81e5ccaef2..70e12f536f8f 100644 --- a/include/linux/uio.h +++ b/include/linux/uio.h @@ -136,11 +136,6 @@ static inline bool iov_iter_is_xarray(const struct iov_iter *i) return iov_iter_type(i) == ITER_XARRAY; } -static inline unsigned char iov_iter_rw(const struct iov_iter *i) -{ - return i->data_source ? WRITE : READ; -} - static inline bool user_backed_iter(const struct iov_iter *i) { return i->user_backed; diff --git a/lib/iov_iter.c b/lib/iov_iter.c index b667b1e2f688..b8c52231a6ff 100644 --- a/lib/iov_iter.c +++ b/lib/iov_iter.c @@ -1097,7 +1097,7 @@ static ssize_t __iov_iter_get_pages_alloc(struct iov_iter *i, unsigned long addr; int res; - if (iov_iter_rw(i) != WRITE) + if (i->data_source == ITER_SOURCE) gup_flags |= FOLL_WRITE; if (i->nofault) gup_flags |= FOLL_NOFAULT;