From patchwork Thu Dec 21 13:23:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13501937 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 B7045C35274 for ; Thu, 21 Dec 2023 13:25:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 18D498D0021; Thu, 21 Dec 2023 08:25:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0CA2B6B009B; Thu, 21 Dec 2023 08:25:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EACB98D0021; Thu, 21 Dec 2023 08:25:43 -0500 (EST) 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 D18626B009A for ; Thu, 21 Dec 2023 08:25:43 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id AE044A05FC for ; Thu, 21 Dec 2023 13:25:43 +0000 (UTC) X-FDA: 81590897766.05.C2E8081 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf07.hostedemail.com (Postfix) with ESMTP id 9DF4D4002C for ; Thu, 21 Dec 2023 13:25:41 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=WxcWG0sR; spf=pass (imf07.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.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=1703165142; 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=X8K+OvIZVFEHRX7sH3CruOEYZX1ff0eup403Lbxotk8=; b=u1odTct89R0jJXqBk8nfazuLIB3znHzVw6o7lU3TccSd/Fn7oBDkyDgEnLUXjP/nArXfpR PuCKjfghxcjmZKyuz2wdBwZf9U8WxnNhDc9IZ8tmwEan3oqRbaDJfGNqEHWZsl29QXzj3H GYwMX6qWv2uwfXGc/n2TwlwMR2VidFQ= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=WxcWG0sR; spf=pass (imf07.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1703165142; a=rsa-sha256; cv=none; b=uHwEeq6tFOojqQ5ZLZV5PtoX1jUp3J7rb8HISnzwhCnEVmHYvWbKXQmiR2x2DIBIcxMx75 QqKawxcvTnkBBGEdYf4uNOn89X7iOsY11H/zCV8KS8aoSCCiic+0ND4kOF1DTKptA/z1ss T/2AQUTLesdyGQFXCKWgHMv/dqHmMfQ= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1703165140; 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=X8K+OvIZVFEHRX7sH3CruOEYZX1ff0eup403Lbxotk8=; b=WxcWG0sR1qHsKXxmHo2kMZBQJ8eUDSXJa0E2MCBTxflI8of0MPPzNE5PeG/mSvC2prgpwp F31Xyaj10ZS6K0LzaQOTe1R1pxYzKJrdhWWl1dGch8yJ7mpg8EKW/pzdYRaQcNGcs/4ZO0 i7D8N7AuyA0ikwLVH8HP5dZmcliMc9c= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-39-Xy-IC_YbNmSx5qxFD0MfpQ-1; Thu, 21 Dec 2023 08:25:35 -0500 X-MC-Unique: Xy-IC_YbNmSx5qxFD0MfpQ-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (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 8C94A85CEA7; Thu, 21 Dec 2023 13:25:22 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.39.195.169]) by smtp.corp.redhat.com (Postfix) with ESMTP id ACF17492BC6; Thu, 21 Dec 2023 13:25:18 +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 , Eric Van Hensbergen , Ilya Dryomov , Christian Brauner , 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-fsdevel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 20/40] netfs: Add a hook to allow tell the netfs to update its i_size Date: Thu, 21 Dec 2023 13:23:15 +0000 Message-ID: <20231221132400.1601991-21-dhowells@redhat.com> In-Reply-To: <20231221132400.1601991-1-dhowells@redhat.com> References: <20231221132400.1601991-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Rsp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8xso6uHagXB7mSi30v ubZ2v480 3j7ejxpE7n3QK0/ZE04+xCnh7K9PuxnNOI+whtG+Fqg1bQS94ATYo6MVgKAEiQc1Xw8ShFUZuWCrmQUBPhmi4kiGtvqF7okRciUZZuwJkw3JVIeZBgez7fZGGMXOGqkxRRNy1fTiGs5njLdd+PrggLPvVx25zGuEE+gjzwr4FE1xcvWtGMn5/PeHDovqRnFQk1LC9cf+a6z4V9k6ZB2ED7H7iIja3C+a5wpxiPyJjM6SQ6VWCvEfrOA99jB2L43+L03sRi/wPsxfSIrdCR6db8ccAtXQCtp3oFd+oqkjC8EQfyAtyLSNJWYTaHQEBItY1o9JpEZJIrOr1rJwWVGo4cwqiNnBSvFU2v9fEDaIMxtAvqdyi6WAX6xUJyIw50MGlI7nBu0ARNgAbMkr3puPPg4YIxw== 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: 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 Reviewed-by: 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 d08bd37bc3ce..f87193fa0f16 100644 --- a/include/linux/netfs.h +++ b/include/linux/netfs.h @@ -243,6 +243,7 @@ struct netfs_request_ops { void (*free_request)(struct netfs_io_request *rreq); void (*free_subrequest)(struct netfs_io_subrequest *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); @@ -250,6 +251,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); }; /*