From patchwork Thu Jun 20 17:31:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13705990 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 B50D3C2BA1A for ; Thu, 20 Jun 2024 17:33:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4B3618D00C8; Thu, 20 Jun 2024 13:33:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 467498D00AF; Thu, 20 Jun 2024 13:33:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2B8608D00C8; Thu, 20 Jun 2024 13:33:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 01BF68D00AF for ; Thu, 20 Jun 2024 13:33:07 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id B08A61A04C6 for ; Thu, 20 Jun 2024 17:33:07 +0000 (UTC) X-FDA: 82251962814.21.CC49F8B Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf28.hostedemail.com (Postfix) with ESMTP id 04852C0004 for ; Thu, 20 Jun 2024 17:33:05 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=gKsvSVEP; spf=pass (imf28.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=1718904777; 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=JsgLdDMxlbFRDEl04HJEi9WqLkbVt68ZbQT1Q/QXXG4=; b=n7L4aqkVapZabi63bkUcPGoT7ESvtpRKl50tfJIswbnS4WX8bnk1GDVS576G/E2DI9vwx1 A/M6v5nyeduZ11UdA//HX+VekFoRVnz6TFdbhczY3mS5Y9FwmENonEL40UjhkXnkzqgk5S LLEulR10t0VMzCgkg6NLxjLj4GZeFn0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718904777; a=rsa-sha256; cv=none; b=ce2xsfD9i5RJ2WeUAZIhVXaN0KGUCOukPME82kauJryPBSPB5U2kfZ0zHRUjcB9uyRaHo4 GaMLmcZOfOImos7ukVaTtSo2msSW2e5G9M/oXxoguJ1hfTCWhr6bEFFBwZIWck7JDE0HoK kZxAqqYKrA2XT4pJWSSy/fthL0lorhk= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=gKsvSVEP; spf=pass (imf28.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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718904785; 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=JsgLdDMxlbFRDEl04HJEi9WqLkbVt68ZbQT1Q/QXXG4=; b=gKsvSVEPMviMKgfYg/enRA6pv2BUGpsgWX5tJGHevLF8f+Lp2KoOjPnWbU4h+dX8nc46vS IwoLDIF1dlfK4IOuoGKIVoArOoCFb5ApE18eNWHCZqRc+NBgR+EMoWs0Eb2vZjFNONW2GD BxjnHw1FV4hioQWxp4o2kbgM+a0MfL0= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-324-4DqBux0nMw2-JdVI-Ia2qg-1; Thu, 20 Jun 2024 13:32:58 -0400 X-MC-Unique: 4DqBux0nMw2-JdVI-Ia2qg-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D829719560AD; Thu, 20 Jun 2024 17:32:55 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.39.195.156]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C147319560B0; Thu, 20 Jun 2024 17:32:49 +0000 (UTC) From: David Howells To: Christian Brauner , Steve French , Matthew Wilcox Cc: David Howells , Jeff Layton , Gao Xiang , Dominique Martinet , Marc Dionne , Paulo Alcantara , Shyam Prasad N , Tom Talpey , Eric Van Hensbergen , Ilya Dryomov , netfs@lists.linux.dev, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 08/17] netfs: Delete some xarray-wangling functions that aren't used Date: Thu, 20 Jun 2024 18:31:26 +0100 Message-ID: <20240620173137.610345-9-dhowells@redhat.com> In-Reply-To: <20240620173137.610345-1-dhowells@redhat.com> References: <20240620173137.610345-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Rspamd-Queue-Id: 04852C0004 X-Stat-Signature: yoidkj9r3jtexqb15p816siuo6nrac8s X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1718904785-134113 X-HE-Meta: U2FsdGVkX1+Vhb3SlFQYsT+nRqmyodG+Cz+l2mvn8m2c+qC4tuuKfKaguWA5Kr6w8QXEYrXvudn8pT4tMPlJ23OXJNsqsWJc8W9OzInNksQgL3Sn6qBnXfLetKab/Rp5hH9wAg5DREJoFNaZSa2x27bKTjzfFKoUtXzLmL5R92NyVBF5EqByN4g9hIJynMUjvQPJvF9takakGgmIy+YL6MuTmlKiO3M/rDRFQ51X6UssmNEGIunaczTIKoij3JIR9TTxm1bp3pxwNuHYRUUcq8UKpd/hhY1T/7g0RJ/PUQcG+zUbpFuMzriN7a8ym/SJVEsp4Q794ZSqh6z+BqAjorpCzK7pE+U34rilOIYRXrwMAjFvJJcspXhw99ZgVSCplYXweuSejb/rPjkDPzviVFSbOR8dVd0BER0AmWZKcGJ26JstC/GV3rGGaSgvViYzWZnx/PM7tHVMeVS+6emAq63Eu0IzO9T1D0l08ZKyfzOAO5zJ+tM8j5Ecs/pTM28mMvwPm4QYHywquz5fX92hRcDTTj5ykyqt3u8MmWqNB/q6pY+yYiNv+Zf2M8LK+ZPDhwWCF4KVApwCKaVK3clQBbF4bHl849S8Ov05rUet/jA0TTzMl4vZr/9YymkyblDYKqVdCfsxsi/K0o+3x5CEdXT9/xbXsKObuqLRP7pMaONCFlCtrrrs8xWh+2BPmRDc0A7NizWk3XmnXjxkxE2TnyQb61NUIDWlwDuLgqnoZi7VfUXFiVnTXb60kv062NvqA8vWlCc28de7D1cCuML2xmPilJCtKcn/uHIcXYz9IcdWDILOMhj7Q07PvxQhyjisPuN8Mge4IJC6K9d3Q9tT9iGGla/oX1qgJe5QxsteqeTCKqLlWhMdhW6HZH6HHlmAVl/zekIiiXCmSrkkvyQRUpUDfSKR2XyKUJXnkDwJufY+Oqak8Zd+uMfrMcaaS+qTR7z0YW7/11tXLTQ/rdj u7DbhFpC 8yKqBcVZ4JlNqIMJ+4xXMQvejYf0bVFN5sDV0TCilZFvGm2nS/B/mzr+cLfLn7fQnC0wjJi/G3n8YGecBspkABlH1w1MBN8LEVONBmTbFuyyzFCifH1yrXbezlT6LprzsT7ffUOPXZi4IHukcudNt+wUbzwSrrDN2WdbvqnQT57lSI9b8ZRU2wPVYCreCZmFyD7LK02L3zeNgKOD09FrxYKQyp0pygHR2IyTrDMTYvwHIXHHZXs42sP6LSOvRZmxmzEDgaDdYZI56TdXm4v07GrA2NQMSFR0LBHSMtE0JWuogqsXylvuCnKAGZw1Yrfp2ov83D6+CCBoZsZr7qcN2bC3o5sKr5I5TmxJRRr2koGsL2Uk= 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: List-Subscribe: List-Unsubscribe: Delete some xarray-based buffer wangling functions that are intended for use with bounce buffering, but aren't used because bounce-buffering got deferred to a later patch series. Now, however, the intention is to use something other than an xarray to do this. Signed-off-by: David Howells cc: Jeff Layton cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org --- fs/netfs/internal.h | 9 ----- fs/netfs/misc.c | 81 --------------------------------------------- 2 files changed, 90 deletions(-) diff --git a/fs/netfs/internal.h b/fs/netfs/internal.h index 42443d99967d..a44d480a0fa2 100644 --- a/fs/netfs/internal.h +++ b/fs/netfs/internal.h @@ -63,15 +63,6 @@ static inline void netfs_proc_del_rreq(struct netfs_io_request *rreq) {} /* * misc.c */ -#define NETFS_FLAG_PUT_MARK BIT(0) -#define NETFS_FLAG_PAGECACHE_MARK BIT(1) -int netfs_xa_store_and_mark(struct xarray *xa, unsigned long index, - struct folio *folio, unsigned int flags, - gfp_t gfp_mask); -int netfs_add_folios_to_buffer(struct xarray *buffer, - struct address_space *mapping, - pgoff_t index, pgoff_t to, gfp_t gfp_mask); -void netfs_clear_buffer(struct xarray *buffer); /* * objects.c diff --git a/fs/netfs/misc.c b/fs/netfs/misc.c index bc1fc54fb724..83e644bd518f 100644 --- a/fs/netfs/misc.c +++ b/fs/netfs/misc.c @@ -8,87 +8,6 @@ #include #include "internal.h" -/* - * Attach a folio to the buffer and maybe set marks on it to say that we need - * to put the folio later and twiddle the pagecache flags. - */ -int netfs_xa_store_and_mark(struct xarray *xa, unsigned long index, - struct folio *folio, unsigned int flags, - gfp_t gfp_mask) -{ - XA_STATE_ORDER(xas, xa, index, folio_order(folio)); - -retry: - xas_lock(&xas); - for (;;) { - xas_store(&xas, folio); - if (!xas_error(&xas)) - break; - xas_unlock(&xas); - if (!xas_nomem(&xas, gfp_mask)) - return xas_error(&xas); - goto retry; - } - - if (flags & NETFS_FLAG_PUT_MARK) - xas_set_mark(&xas, NETFS_BUF_PUT_MARK); - if (flags & NETFS_FLAG_PAGECACHE_MARK) - xas_set_mark(&xas, NETFS_BUF_PAGECACHE_MARK); - xas_unlock(&xas); - return xas_error(&xas); -} - -/* - * Create the specified range of folios in the buffer attached to the read - * request. The folios are marked with NETFS_BUF_PUT_MARK so that we know that - * these need freeing later. - */ -int netfs_add_folios_to_buffer(struct xarray *buffer, - struct address_space *mapping, - pgoff_t index, pgoff_t to, gfp_t gfp_mask) -{ - struct folio *folio; - int ret; - - if (to + 1 == index) /* Page range is inclusive */ - return 0; - - do { - /* TODO: Figure out what order folio can be allocated here */ - folio = filemap_alloc_folio(readahead_gfp_mask(mapping), 0); - if (!folio) - return -ENOMEM; - folio->index = index; - ret = netfs_xa_store_and_mark(buffer, index, folio, - NETFS_FLAG_PUT_MARK, gfp_mask); - if (ret < 0) { - folio_put(folio); - return ret; - } - - index += folio_nr_pages(folio); - } while (index <= to && index != 0); - - return 0; -} - -/* - * Clear an xarray buffer, putting a ref on the folios that have - * NETFS_BUF_PUT_MARK set. - */ -void netfs_clear_buffer(struct xarray *buffer) -{ - struct folio *folio; - XA_STATE(xas, buffer, 0); - - rcu_read_lock(); - xas_for_each_marked(&xas, folio, ULONG_MAX, NETFS_BUF_PUT_MARK) { - folio_put(folio); - } - rcu_read_unlock(); - xa_destroy(buffer); -} - /** * netfs_dirty_folio - Mark folio dirty and pin a cache object for writeback * @mapping: The mapping the folio belongs to.