From patchwork Thu Mar 28 16:34:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13609081 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 11CE0CD1283 for ; Thu, 28 Mar 2024 16:37:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A476C6B00B0; Thu, 28 Mar 2024 12:37:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9F3DE6B00B1; Thu, 28 Mar 2024 12:37:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 86D806B00B2; Thu, 28 Mar 2024 12:37:19 -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 631DE6B00B0 for ; Thu, 28 Mar 2024 12:37:19 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 332F140C18 for ; Thu, 28 Mar 2024 16:37:19 +0000 (UTC) X-FDA: 81947002998.06.D6FC3A0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf07.hostedemail.com (Postfix) with ESMTP id 760FF40007 for ; Thu, 28 Mar 2024 16:37:16 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=DwiYD5FP; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf07.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.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=1711643836; 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=ynxqw2O6Fn8BCqwyUG55TcbJftNzL16LOIMZCwa+6jc=; b=P+8q40FGcDGTTd205xWOMjVzMQ5jEWVQ6pa3A3s6JykK8RDc3deWmz4MhEIPcPkGpmPKeb 5pJdzl8aQrj/6R1VwhVKpad3EB35cbanpA6ganZ5M8XusauVOIrdyzUWtmE1GJpVEv5upD PkxrqzzskFSsze45pEZ1raazh0lAKPY= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=DwiYD5FP; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf07.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711643836; a=rsa-sha256; cv=none; b=asQwsGKAyd/bBSiDydxhWKXN/Re2TJk5fEfKKaVnuu9Xby4nhf+qpzWtoCmUjM8VtUkvNT I0oWgSRnZTpbeaJf2NNnnOi1kVpqIb1vPaLtSUeDNmXrEP+3FIDwe+oJdKc7tCOaMNYoTM +u7WnQlWQbNAdLPeewUJBMPtAsQl/ik= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711643835; 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=ynxqw2O6Fn8BCqwyUG55TcbJftNzL16LOIMZCwa+6jc=; b=DwiYD5FPnYzOEboxIOhRQeC4bJqdbFJyNfvH9nBWHABMD859qviF1uBotRuR5xDO3BEJtU Vhr30dZ+M5KICsV8bcyenywVFvTBOQktSJrtOoFPGT3kQEeuBHpS/o6qbOnFG6GBt34W/I mzHihccFnsa2dwjx0O6YkUdB3T7BIuc= 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-502-Suy6mr8HNd28fD3IYgT4vw-1; Thu, 28 Mar 2024 12:37:07 -0400 X-MC-Unique: Suy6mr8HNd28fD3IYgT4vw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (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 AA02B383CD7A; Thu, 28 Mar 2024 16:37:06 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.146]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB8F0492BD0; Thu, 28 Mar 2024 16:37:03 +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 12/26] afs: Use alternative invalidation to using launder_folio Date: Thu, 28 Mar 2024 16:34:04 +0000 Message-ID: <20240328163424.2781320-13-dhowells@redhat.com> In-Reply-To: <20240328163424.2781320-1-dhowells@redhat.com> References: <20240328163424.2781320-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Rspamd-Queue-Id: 760FF40007 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: 5om16gik6mb1iuerey8b7k66c6xjcg47 X-HE-Tag: 1711643836-891942 X-HE-Meta: U2FsdGVkX183bdXuA205w8Kk/kJeahXCjvHiYsYsCtnZFMS0bYkk3h6s1A5JtqKNVzZ/CUhUjPrcR6eeQQUw9ec649UJ5+ygcPsBv6M41Wfq107vU/HOwhXwViiW9ansJapo4NrB+zG8H5fcI+cDmjdw+tR3AvCqUvd3jYBK7sVl5iEaMsiDIKbBUgXIBQx6nh+25GCuPSCWRSA3NRYvmoJuggSwK8PV9dGjat+HUgG9X3gei8+Ph5xVHnPfBELZBIV+v/++54sAR76CWFNXAeLW3V9u2hRih8V45MIV0hmxJayG8FMh0DyFnwrGz92HgvYvxgNZG8gV1RyA1lV1XQX5bFd8oVzZ6gHU3UklHw7JkEzFSRQdVnpc0FXAUBrbjArzYpoNoabgjcM5SAZzdmOdwcMP3mxkaKgqsTFZOpwkO6b2ZwubbpptxpdkgE1HmQSFbhGilbojvsxUgmhrGNFDiFJd1cxyiF5D/xVe64mbODK8yDTfDJZO9zEDQ4D4liC/uiPPRgySaW24DbPzAMqmvaxbt+r2kvCBjM9VEzQih2X3nKqaAQFP+L0QUjMPb3do/25d+LwdCxuj/nOXhbiwDFtZ0hik/5Tsp+uWONWjEfRz1V3z7GMAY1X+i+q2AG/zoUrItbxTHpyf6/YieCKCKZnjvOqjesGcCXznzsULUXBegzX6ur/GqDjjXubt1EIyZ7FmQQ3fXLas3YO7lyT89tHHWGkyIwuYpLkweSSpJ9skKEXFgrxD/k+SyIb1jiaHN0GZ2aUiQSfPb5q/2fit7lw4YnW1KmFXZiHcYP7IrDOfnIM9511u/pACkG1YOFmpQGBogI9Cr0uno90B6oeVGbMzEH5tUa5qYh/s1WvqP7qiqo98af+X3Y48lQIoo4cDS2XYZgxgIj+XUbWYBE4TXpYd2HdNPxvIL9EjinKATdIAcS8bLm50v5k/P+EICbAe+sPBdUSOcmur/Oz jwYA3oxD R7LepSPjCKiflsPFHSH6FPLmPh/9Q237DQThh1PJEKaH92KCVN/WK1sXkrs/gpSmYoznkDJRX7Ra+CJWOBR7Qrldj4mcWbSIyOVFQ9SBuCLJSOCwvKqnHlkjY6N/MAhQnyq8bcCtcoiSCp2QPDlcH8E2wtJUMr99F+SlRxlZObkXMwONgJnyBFqCg0COg2slQPDhX3XMCuSNxwD5MapfarniSGdCqqG8hGxL4eRThJ068b4ui5fzVmMHIi86IhbUWqCzbMJdjkpbZEeeVjHdb973bxxKX6KLkHksmAwnVebPVcjrJ4UMzf1H6iKJpI8b80bl0L4VOJklLxUAAc4KnwRpQqJ2nvKwSe0FRGCEzg4yVOXfn7CLJIIyDhZ0K7ZcYqea4/iVte3h4105nVRH+PVA9Dw== 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..1d8bbc46f734 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); else - invalidate_inode_pages2(vnode->netfs.inode.i_mapping); + filemap_invalidate_inode(&vnode->netfs.inode, false); } /* 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); }