From nobody Fri Dec 19 08:02:21 2025 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 CEBF2EE01EC for ; Wed, 13 Sep 2023 16:58:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230378AbjIMQ6S (ORCPT ); Wed, 13 Sep 2023 12:58:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230359AbjIMQ6C (ORCPT ); Wed, 13 Sep 2023 12:58:02 -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 ESMTP id 93E851BE8 for ; Wed, 13 Sep 2023 09:57:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694624236; 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=p+t8ChtS3C0mCAtd18JzNSIJcCnKtYlpMvVgh9PlkwE=; b=UQPF4PWsnCasFEdyyysVTcjyKbiJexdcwJzzX/ZEtw8yAi2J7HyAlLEsyS0w3Bj21DDxBO usWo7iqC4U+uS6GwPByAIIRnq6Of9xCdJOhCrKo1rEsgVIVrBFnCtk2YANkkgGk1VxNQ3f gfbHE/BvFvLR6nsntTyYuAIJD3R+hwY= 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-542-5xC_0HubPGGLzilTHkSTMQ-1; Wed, 13 Sep 2023 12:57:13 -0400 X-MC-Unique: 5xC_0HubPGGLzilTHkSTMQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 783FB85531D; Wed, 13 Sep 2023 16:57:12 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.216]) by smtp.corp.redhat.com (Postfix) with ESMTP id D43F240C6EA8; Wed, 13 Sep 2023 16:57:10 +0000 (UTC) From: David Howells To: Al Viro , Linus Torvalds Cc: David Howells , Jens Axboe , Christoph Hellwig , Christian Brauner , David Laight , Matthew Wilcox , Jeff Layton , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 08/13] iov_iter: Remove the copy_mc flag and associated functions Date: Wed, 13 Sep 2023 17:56:43 +0100 Message-ID: <20230913165648.2570623-9-dhowells@redhat.com> In-Reply-To: <20230913165648.2570623-1-dhowells@redhat.com> References: <20230913165648.2570623-1-dhowells@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" copy_to/from_iter() now always return a short copy on MCE, so we don't need to have special handling. Signed-off-by: David Howells cc: Alexander Viro cc: Jens Axboe cc: Christoph Hellwig cc: Christian Brauner cc: Matthew Wilcox cc: Linus Torvalds cc: David Laight cc: linux-block@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org --- include/linux/uio.h | 16 ---------------- lib/iov_iter.c | 5 ----- 2 files changed, 21 deletions(-) diff --git a/include/linux/uio.h b/include/linux/uio.h index e2a248dad80b..cc250892872e 100644 --- a/include/linux/uio.h +++ b/include/linux/uio.h @@ -40,7 +40,6 @@ struct iov_iter_state { =20 struct iov_iter { u8 iter_type; - bool copy_mc; bool nofault; bool data_source; union { @@ -251,22 +250,8 @@ size_t _copy_from_iter_flushcache(void *addr, size_t b= ytes, struct iov_iter *i); =20 #ifdef CONFIG_ARCH_HAS_COPY_MC size_t _copy_mc_to_iter(const void *addr, size_t bytes, struct iov_iter *i= ); -static inline void iov_iter_set_copy_mc(struct iov_iter *i) -{ - i->copy_mc =3D true; -} - -static inline bool iov_iter_is_copy_mc(const struct iov_iter *i) -{ - return i->copy_mc; -} #else #define _copy_mc_to_iter _copy_to_iter -static inline void iov_iter_set_copy_mc(struct iov_iter *i) { } -static inline bool iov_iter_is_copy_mc(const struct iov_iter *i) -{ - return false; -} #endif =20 size_t iov_iter_zero(size_t bytes, struct iov_iter *); @@ -381,7 +366,6 @@ static inline void iov_iter_ubuf(struct iov_iter *i, un= signed int direction, WARN_ON(direction & ~(READ | WRITE)); *i =3D (struct iov_iter) { .iter_type =3D ITER_UBUF, - .copy_mc =3D false, .data_source =3D direction, .ubuf =3D buf, .count =3D count, diff --git a/lib/iov_iter.c b/lib/iov_iter.c index b574601783bc..66d2a16774fe 100644 --- a/lib/iov_iter.c +++ b/lib/iov_iter.c @@ -169,7 +169,6 @@ void iov_iter_init(struct iov_iter *i, unsigned int dir= ection, WARN_ON(direction & ~(READ | WRITE)); *i =3D (struct iov_iter) { .iter_type =3D ITER_IOVEC, - .copy_mc =3D false, .nofault =3D false, .data_source =3D direction, .__iov =3D iov, @@ -629,7 +628,6 @@ void iov_iter_kvec(struct iov_iter *i, unsigned int dir= ection, WARN_ON(direction & ~(READ | WRITE)); *i =3D (struct iov_iter){ .iter_type =3D ITER_KVEC, - .copy_mc =3D false, .data_source =3D direction, .kvec =3D kvec, .nr_segs =3D nr_segs, @@ -646,7 +644,6 @@ void iov_iter_bvec(struct iov_iter *i, unsigned int dir= ection, WARN_ON(direction & ~(READ | WRITE)); *i =3D (struct iov_iter){ .iter_type =3D ITER_BVEC, - .copy_mc =3D false, .data_source =3D direction, .bvec =3D bvec, .nr_segs =3D nr_segs, @@ -675,7 +672,6 @@ void iov_iter_xarray(struct iov_iter *i, unsigned int d= irection, BUG_ON(direction & ~1); *i =3D (struct iov_iter) { .iter_type =3D ITER_XARRAY, - .copy_mc =3D false, .data_source =3D direction, .xarray =3D xarray, .xarray_start =3D start, @@ -699,7 +695,6 @@ void iov_iter_discard(struct iov_iter *i, unsigned int = direction, size_t count) BUG_ON(direction !=3D READ); *i =3D (struct iov_iter){ .iter_type =3D ITER_DISCARD, - .copy_mc =3D false, .data_source =3D false, .count =3D count, .iov_offset =3D 0