From patchwork Tue Apr 30 14:00:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13649079 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 3B6A3C10F16 for ; Tue, 30 Apr 2024 14:01:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C2CFC6B00A7; Tue, 30 Apr 2024 10:01:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BBD8C6B00A9; Tue, 30 Apr 2024 10:01:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A2C486B00A8; Tue, 30 Apr 2024 10:01:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 7CCDC6B00A6 for ; Tue, 30 Apr 2024 10:01:47 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 2E73880864 for ; Tue, 30 Apr 2024 14:01:47 +0000 (UTC) X-FDA: 82066361454.09.AE2D13C Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf25.hostedemail.com (Postfix) with ESMTP id A8CD0A0012 for ; Tue, 30 Apr 2024 14:01:44 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Z6nC1GaH; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf25.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1714485704; 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=H9oW2wSGzdlNxSrhNqwjbv4gFKpPPpe3xHOvb2Tj7Zw=; b=e4g69ZI7x6TdfvHdJ9g50RPfhVdAfMMTK/IOxKuMgOjXoWPtDGtvnt9tKIs2DuCSFtswB0 NUMmliVfov1faB0u23uwHojdeUJ9Y96kbZ9OB958opPznhBLFyU2P3gidOZz4aJJenvX4q nYiRWaRKoO9NB/OSGbBs7pLsuR0hn9A= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Z6nC1GaH; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf25.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1714485704; a=rsa-sha256; cv=none; b=GwvP1salIKvr/z5yaQLJHeF/7hL4s9hO0GojBmoFDJ7QHa+22zhfHkNfEimAF6U7e+Wn2F oGsLMF6zMveIFkco8pehYQ1CloWV56AhZ4jYYyfu+YQEBideC0NsHGWFRukk3oIMgrGUoJ vcudCP8XtrGD0Uh/xOYKUiBnabAm6YI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714485704; 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=H9oW2wSGzdlNxSrhNqwjbv4gFKpPPpe3xHOvb2Tj7Zw=; b=Z6nC1GaHVQHEzuVczqe7BZFyxQe4WvCBnxf1M9d0R8ZE+FbBfeFwGUhodXbtruckgNpgGe 1PFfGn09YjQH03OEH778ia59CAPxuyESOWzlKtPL0lbBPDV6Gp4KPV433qsr4Soxk597jE +oj43kdt6MMBrkP44uTgxTAwZRSwCrM= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-3-EJoPS_fbMZ-L5ABNxd-9-w-1; Tue, 30 Apr 2024 10:01:42 -0400 X-MC-Unique: EJoPS_fbMZ-L5ABNxd-9-w-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5CC533819C68; Tue, 30 Apr 2024 14:01:40 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 549752166B31; Tue, 30 Apr 2024 14:01:37 +0000 (UTC) From: David Howells To: Christian Brauner , Jeff Layton , Gao Xiang , Dominique Martinet Cc: David Howells , Matthew Wilcox , Steve French , Marc Dionne , Paulo Alcantara , Shyam Prasad N , Tom Talpey , Eric Van Hensbergen , Ilya Dryomov , netfs@lists.linux.dev, linux-cachefs@redhat.com, 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 v2 09/22] afs: Use alternative invalidation to using launder_folio Date: Tue, 30 Apr 2024 15:00:40 +0100 Message-ID: <20240430140056.261997-10-dhowells@redhat.com> In-Reply-To: <20240430140056.261997-1-dhowells@redhat.com> References: <20240430140056.261997-1-dhowells@redhat.com> MIME-Version: 1.0 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eP6gk/Ymf02tEEZzBPwcp2i7WSaR6T3jB5Pg75ZGMNEtgzaprOcO1qWV0NjfYkRfc6CGv+233 Gtf4GQVL ZuIKsqPoYqMfkQpp0MkzweVp772dKXseTF25KX4WMHWElCD/8j3J6lakDiWP5QrVYbF2Pq2LyA5bYANuMa2uJQ1Xdg7vcNb/ayCS591xv9YGqRpLw4rpMzM+yk4nU1UoQEsL8GNL/u+7jc45S5YFlo7HK+BD+V1fUjU+9zJvORCEPYz/bEDHJewvif0CaYHzuy20WZTc0v9QZTKR49m2aWS8ptVUHiWkiaRbA4baKyK0zwDnD2BrzC59kkDU/+1qn2AzWjannZCrE3J23F2H0DibpiDx7wTE021hMTaoUHlxlfPn1hGdw/txWTJ8wIG2J+IoDeNcJXbNyOxHvahf6JhA9OBlcmCCw9SJUfX0mQg93NRDkGLb4jVNpISxHrgnP4dP+sPifpwSQYlAQH2HYXbbSzw== 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: Use writepages-based flushing invalidation instead of invalidate_inode_pages2() and ->launder_folio(). This will allow ->launder_folio() to be removed eventually. Signed-off-by: David Howells cc: Marc Dionne cc: Jeff Layton cc: linux-afs@lists.infradead.org cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org --- fs/afs/file.c | 1 - fs/afs/internal.h | 1 - fs/afs/validation.c | 4 ++-- fs/afs/write.c | 10 +++------- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/fs/afs/file.c b/fs/afs/file.c index ef2cc8f565d2..dfd8f60f5e1f 100644 --- a/fs/afs/file.c +++ b/fs/afs/file.c @@ -54,7 +54,6 @@ const struct address_space_operations afs_file_aops = { .read_folio = netfs_read_folio, .readahead = netfs_readahead, .dirty_folio = netfs_dirty_folio, - .launder_folio = netfs_launder_folio, .release_folio = netfs_release_folio, .invalidate_folio = netfs_invalidate_folio, .migrate_folio = filemap_migrate_folio, diff --git a/fs/afs/internal.h b/fs/afs/internal.h index 6ce5a612937c..b93aa026daa4 100644 --- a/fs/afs/internal.h +++ b/fs/afs/internal.h @@ -916,7 +916,6 @@ struct afs_operation { loff_t pos; loff_t size; loff_t i_size; - bool laundering; /* Laundering page, PG_writeback not set */ } store; struct { struct iattr *attr; diff --git a/fs/afs/validation.c b/fs/afs/validation.c index 32a53fc8dfb2..bef8af12ebe2 100644 --- a/fs/afs/validation.c +++ b/fs/afs/validation.c @@ -365,9 +365,9 @@ static void afs_zap_data(struct afs_vnode *vnode) * written back in a regular file and completely discard the pages in a * directory or symlink */ if (S_ISREG(vnode->netfs.inode.i_mode)) - invalidate_remote_inode(&vnode->netfs.inode); + filemap_invalidate_inode(&vnode->netfs.inode, true, 0, LLONG_MAX); else - invalidate_inode_pages2(vnode->netfs.inode.i_mapping); + filemap_invalidate_inode(&vnode->netfs.inode, false, 0, LLONG_MAX); } /* diff --git a/fs/afs/write.c b/fs/afs/write.c index 74402d95a884..1bc26466eb72 100644 --- a/fs/afs/write.c +++ b/fs/afs/write.c @@ -75,8 +75,7 @@ static void afs_store_data_success(struct afs_operation *op) op->ctime = op->file[0].scb.status.mtime_client; afs_vnode_commit_status(op, &op->file[0]); if (!afs_op_error(op)) { - if (!op->store.laundering) - afs_pages_written_back(vnode, op->store.pos, op->store.size); + afs_pages_written_back(vnode, op->store.pos, op->store.size); afs_stat_v(vnode, n_stores); atomic_long_add(op->store.size, &afs_v2net(vnode)->n_store_bytes); } @@ -91,8 +90,7 @@ static const struct afs_operation_ops afs_store_data_operation = { /* * write to a file */ -static int afs_store_data(struct afs_vnode *vnode, struct iov_iter *iter, loff_t pos, - bool laundering) +static int afs_store_data(struct afs_vnode *vnode, struct iov_iter *iter, loff_t pos) { struct afs_operation *op; struct afs_wb_key *wbk = NULL; @@ -123,7 +121,6 @@ static int afs_store_data(struct afs_vnode *vnode, struct iov_iter *iter, loff_t op->file[0].modification = true; op->store.pos = pos; op->store.size = size; - op->store.laundering = laundering; op->flags |= AFS_OPERATION_UNINTR; op->ops = &afs_store_data_operation; @@ -168,8 +165,7 @@ static void afs_upload_to_server(struct netfs_io_subrequest *subreq) subreq->rreq->debug_id, subreq->debug_index, subreq->io_iter.count); trace_netfs_sreq(subreq, netfs_sreq_trace_submit); - ret = afs_store_data(vnode, &subreq->io_iter, subreq->start, - subreq->rreq->origin == NETFS_LAUNDER_WRITE); + ret = afs_store_data(vnode, &subreq->io_iter, subreq->start); netfs_write_subrequest_terminated(subreq, ret < 0 ? ret : subreq->len, false); }