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: 13298359 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08E2CEB64D7 for ; Fri, 30 Jun 2023 15:26:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9D4068E0025; Fri, 30 Jun 2023 11:26:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 95BE48E000F; Fri, 30 Jun 2023 11:26:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7FCC08E0025; Fri, 30 Jun 2023 11:26:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 6FACE8E000F for ; Fri, 30 Jun 2023 11:26:02 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 4CE7816015E for ; Fri, 30 Jun 2023 15:26:02 +0000 (UTC) X-FDA: 80959789764.23.7118F05 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf15.hostedemail.com (Postfix) with ESMTP id 6F79BA0007 for ; Fri, 30 Jun 2023 15:25:59 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Tbd3Zv1O; spf=pass (imf15.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688138760; a=rsa-sha256; cv=none; b=k2s2i4NNpEZP4qexE/+C93cyPMoLDUQTA901hN/sTSSnHE5H9o06wV/8//yZuezu5XrQeX enbpt+9Qf4Itas22gC/SRE+HUUN1tRstOS9aBpqZIg34lB6J8LueGcB1+tGWwBb78LxQzM whvORgb7W38/pPs6FU05+Zmutiq4vm8= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Tbd3Zv1O; spf=pass (imf15.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688138760; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=4Jdd9WWzw52HFg7DtTsZeyIq/lnUM49zKvJ/hNK831U=; b=kKuvReNeWvnE3Tz9iujZC8Li7liH0CPDkP7VtdKAQP3dWHm0OgV/NagAvG12tkd9o8iWgN oosEoSQYZbV0vBtsR1cHg26ApVAg4gUXTtyENowns7XhlVQx8IJnzP0M7vNL/Zz+7/sYu/ exCBkBt8FfL2mpMA6+FRVO4LQg3Rl8E= 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 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 6F79BA0007 X-Stat-Signature: iphjq38i6dnq6q938frb3ktu6krhf19c X-Rspam-User: X-HE-Tag: 1688138759-502366 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7Wf6AG9QF1HZvY1wKf+jB8tEF0PReunPevYo8wznbkIoO243CO4bh/F7n9SoAwxTO3TMVvgoaMlmzfhDmpaJWUt0o9Uy4GEbg39TrhdtruP9uVfdpACUoviupOUPJfargldNAoVf/Zs356MdSCEJ7vP+FYW9kWebzo6uSFGB33Cq02J5kO+afa63cu5O+9BEASqvLhGOiKUk7SAiMrJs6Le8H6QV3be77o+L+obpc7VTGD10N12UfJiZjje1UJbkG+Q== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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;