From patchwork Fri Oct 13 16:03:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13421159 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 0FF6ACDB47E for ; Fri, 13 Oct 2023 16:05:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9AA686B019B; Fri, 13 Oct 2023 12:05:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 959FC6B019C; Fri, 13 Oct 2023 12:05:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 822126B019D; Fri, 13 Oct 2023 12:05:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 7042E6B019B for ; Fri, 13 Oct 2023 12:05:34 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 4F9FC4031B for ; Fri, 13 Oct 2023 16:05:34 +0000 (UTC) X-FDA: 81340913388.02.498B4D7 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf09.hostedemail.com (Postfix) with ESMTP id 52A2B140032 for ; Fri, 13 Oct 2023 16:05:32 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=WbE6O7f1; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf09.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=1697213132; 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=Hms+OxujO9sLX9/qumf5gjzFiznbdtqDuL9OGzZ3468=; b=5RfOuzuptv41tKxV/90/CMedixDnn4XLVIgEsC8tyf9gwK/eR556j4CM6qONunpkcI7m6K yjD3jWCHr9X/X2b0rzwcJIwy3q5ZMUYARC54smmmpg/nrrx7m/Nla87q2jUHaAPMpR7t8n Jm+37Ls03IGbcPRWKR+XtTPcU0p1+jo= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=WbE6O7f1; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf09.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=1697213132; a=rsa-sha256; cv=none; b=WncZIocW1Cvqo0CQh2LP1cz/THqnaa131+57vp2dZLbX51k7aG7AtPyByiXTNJeDQNtV6B lYOHf/Aq1wm6g47V44KxO8zUVy2p8/Oo67p5nkPLtHchTGpzkJVFM94MmzPvvHtj7Z2Cbw 3JZaPsszpYMcZPTM2ZaBINdsGt9n1TQ= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697213131; 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=Hms+OxujO9sLX9/qumf5gjzFiznbdtqDuL9OGzZ3468=; b=WbE6O7f1Q2BNn7z+N9LoMjMu8YxjNpEl1vC204KSSSn+oN9Uap7yQCIUCzyV/oaFUvE5rp AX7lHOI/ueUdM/wcTif71n1BkHANrRQIRBu2TYDiu7DsmFsqQxIrYErKFPNxzBpt95iw0L QYSf+f2SeBOkgXGyrlSmGpduaszEHn4= 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-336-F7n1hDLgPkOovJNiv4j3xA-1; Fri, 13 Oct 2023 12:05:28 -0400 X-MC-Unique: F7n1hDLgPkOovJNiv4j3xA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (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 1006A801234; Fri, 13 Oct 2023 16:05:27 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7CCBB1C06535; Fri, 13 Oct 2023 16:05:24 +0000 (UTC) From: David Howells To: Jeff Layton , Steve French Cc: David Howells , Matthew Wilcox , Marc Dionne , Paulo Alcantara , Shyam Prasad N , Tom Talpey , Dominique Martinet , Ilya Dryomov , Christian Brauner , 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-fsdevel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-cachefs@redhat.com Subject: [RFC PATCH 18/53] netfs: Add a hook to allow tell the netfs to update its i_size Date: Fri, 13 Oct 2023 17:03:47 +0100 Message-ID: <20231013160423.2218093-19-dhowells@redhat.com> In-Reply-To: <20231013160423.2218093-1-dhowells@redhat.com> References: <20231013160423.2218093-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Rspamd-Queue-Id: 52A2B140032 X-Rspam-User: X-Rspamd-Server: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jA3XD7Lop7Eb4oRk93oOXL1eVZ4fVWLIVXPB8PAddDAFsOOPuNnErYcEb+XjvwI+22E9RlG0QW536mmSeYxYXmNdgETfDJIugO3qyXFo+dNEBgLK0Cg06D53cIF5rYRZ7J3wPHCiGwcjNVbqSvTAKoQCodjSK0Q/bEXPRNc3mLD2gC3BwVbSC4J6dB+R+Wy0BsVZGy3MH6shgt/hXVQVTRZp/sC/jax/faP60j7tCkD2ZRFMaK8S75yu4TaaSX2BLCCIITt4JmK6KSzMBayvRJ9EfQHLBgY4k1ESsVTJZE23dGkmGYlLzsrRxTOD8VnN+AnnksQGiXpPuCs8/PqKlZIBq9ntzrZpjXrNFHgxhwHvf46V7hin6fSANFSw82xpTA== 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: Add a hook for netfslib's write helpers to call to tell the network filesystem that it should update its i_size. Signed-off-by: David Howells cc: Jeff Layton cc: linux-cachefs@redhat.com cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org --- include/linux/netfs.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/netfs.h b/include/linux/netfs.h index 4115274e3129..39b3eeefa03c 100644 --- a/include/linux/netfs.h +++ b/include/linux/netfs.h @@ -250,6 +250,7 @@ struct netfs_request_ops { void (*free_subrequest)(struct netfs_io_subrequest *rreq); int (*begin_cache_operation)(struct netfs_io_request *rreq); + /* Read request handling */ void (*expand_readahead)(struct netfs_io_request *rreq); bool (*clamp_length)(struct netfs_io_subrequest *subreq); void (*issue_read)(struct netfs_io_subrequest *subreq); @@ -257,6 +258,9 @@ struct netfs_request_ops { int (*check_write_begin)(struct file *file, loff_t pos, unsigned len, struct folio **foliop, void **_fsdata); void (*done)(struct netfs_io_request *rreq); + + /* Modification handling */ + void (*update_i_size)(struct inode *inode, loff_t i_size); }; /*