Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp2049325lqa; Tue, 30 Apr 2024 07:05:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUFUydOfBoQQ58HqHf4bhEXPve7tqY9TY6ximrWNuPReTHfb+Jy3yjA5yqXh+S1I11dmRwBQUPMryXg9vTkVI9JK6zwuU8+MUF8Iarj3Q== X-Google-Smtp-Source: AGHT+IEjZseOajmx/AQhQIYHR3qJ0ucXDeVdvzOuAmn3AcoJDV4fG8PJHrBw9Ghyj9z45UUgBqm4 X-Received: by 2002:ac8:7f0a:0:b0:43a:cdb9:a8ef with SMTP id f10-20020ac87f0a000000b0043acdb9a8efmr8072583qtk.0.1714485941125; Tue, 30 Apr 2024 07:05:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714485941; cv=pass; d=google.com; s=arc-20160816; b=VTR2dYD0g0uaZpOMQzA2tpfWNHGFRl2ahK3E++KHQMOE9L+Bfro9jrl5V+JnoUBOhu 2rdgKrPdcAGv6JPdat/8VhJEow2g2ehvOfBlB3cX6uc6nzvGMpAefCdI6YbdCrVNcdjH AQUQy3c/lpdxS55LyT1FuLW7C4crh43XzgmKrbM+i0/NmdHaGLE9QJH9ZJrQ26rGPNFn Zc15CYeVGEnXKRiIRpZkp4kyHZHE0mr12anFjFWdTr5e+vbvkTLw32WbQp/O8VViWlK5 OlfW2PRqUGwJMp5PdTXcGUIVWSchbdwyZ7tvZuWE+oEYsu6+ddspjq+GssDm6EWnfv2e mjXA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=H9oW2wSGzdlNxSrhNqwjbv4gFKpPPpe3xHOvb2Tj7Zw=; fh=dijFYpEVp+4ijccmXeOrV1fnLJQjsqwgNfcTPuMjuvg=; b=SE9KkX2TSL1PseSWsFwUy0hXQXbFZOq0/cQNnps05fmPS54YXfMlaE9g1lxFt3MYZQ SZo2HVYAD3LijywhHxBnZ4MXNgfOfCYyLaqRDAPMr4w8dkeEKOuXkSZWuCUQuBUyrxPl Vhdcj4flCqWEG+vSUWK5CkGUoYDjoPjX+BUgSoTCThvPDJ1k50oKwkq+h//kGpR9hTlU fFk+H62nP1sr6MHxGQvBAurQmL7nEugEzYh23rHxvTFkKutKRgxt9IO5MYwaP6S9AV0k QATj2KBE39a2WOxSVt5qiQsFIZufScoQaimPa0l8AdHak4Qyi/AS01o45iUbXjRPt/md 8Onw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Z6nC1GaH; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-nfs+bounces-3083-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3083-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id u22-20020ac858d6000000b0043ae2358a20si5173670qta.265.2024.04.30.07.05.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 07:05:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-3083-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Z6nC1GaH; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-nfs+bounces-3083-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3083-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A07421C223B0 for ; Tue, 30 Apr 2024 14:05:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ADB77181311; Tue, 30 Apr 2024 14:01:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Z6nC1GaH" X-Original-To: linux-nfs@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1126F173359 for ; Tue, 30 Apr 2024 14:01:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714485706; cv=none; b=jhG5T0KleHO3K+gnJoxIuwbc+J6j8Ny4Xr3yLbgThc4dihtWwFGktK2IuzPUnJ8Od7ELrYyK8jBGYUJlQy0QWX7B0kNaNFBWvikeVI5LatzOZymDKpXKIkOSKqmEP1I01aCcb8jVoBP/SrYXV6CCylBz1VVqYxTAvUGw1E8O688= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714485706; c=relaxed/simple; bh=GIKo8wPBVs0lbC34nH0ROSEscHCk7a4dpFtL1ZHkJzM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Rq8wXQh5GCXyJUILh/9sP8d8bwxgxKeYDGVvZ+Et2oqZ0RyCDI37tIcoU3iDMdLXi5co6WZlzHDVWDr+6ciyOsfyDy/m0gp25Nh1ViGAsWWOZs3RKN0NUb8mReidzOKg0z+una12OdSv/m3N1zVz2TlJUlR8crFw4LhvTayNf88= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Z6nC1GaH; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com 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> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 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); }