From patchwork Fri Nov 8 17:32:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13868566 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 0F030D64073 for ; Fri, 8 Nov 2024 17:33:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8E2B46B00A8; Fri, 8 Nov 2024 12:33:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 891E16B00A9; Fri, 8 Nov 2024 12:33:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 70B6C6B00AA; Fri, 8 Nov 2024 12:33:52 -0500 (EST) 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 5174A6B00A8 for ; Fri, 8 Nov 2024 12:33:52 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 147CDA0CC1 for ; Fri, 8 Nov 2024 17:33:52 +0000 (UTC) X-FDA: 82763624286.21.68BDDC7 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf12.hostedemail.com (Postfix) with ESMTP id 86A5940008 for ; Fri, 8 Nov 2024 17:33:33 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="Lb/UnWsQ"; spf=pass (imf12.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=1731087042; 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=X3twVFG043O59vporSoGB49KW0yXOb7j0HiRw4sYWo4=; b=vNLpbHU+H0N5/ggIU5NHJkVMwpzhrS/Xml4MSeS4mFqRz7Yzlnaz7kym2kkMWbJLJgTvPr fNk+K9iOk1CG/3ep2x3mS8rJrLM+3SadLZGVVidHJm2FE+BtVCe6OArPWS+9SRtuCJwf4J IKEcQhJkRDLAaSOuBAFi3xiDqnGMGfc= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="Lb/UnWsQ"; spf=pass (imf12.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=1731087042; a=rsa-sha256; cv=none; b=2QlXZh1j7Sh0a+/Q0LwI1nX4KTbHghDQTQEV4z4tLxFLFmA+cHr6hw58xmjM1KDIAZChXs ithhsQAQKGVy++BnrQc7BETwZR8KKNw01D4qMfhvooCY24h3K6B05ig/lh0754PUe6/2Bz KBktvIzasMON2Lo2GDSkFE+XiQEfQqc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731087229; 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=X3twVFG043O59vporSoGB49KW0yXOb7j0HiRw4sYWo4=; b=Lb/UnWsQRnaZpCDojKG5e2RHcdIeykxr0jTV8h5+dtVoG6RjrMC5X3ol+1G07By5FRaBkj SxQI3632MvMW0eWfA6WCJXC2XuQju9y/Qx5i+oVymg2RmB2zWusyDvAwbg62I3VoSuHZi/ s7z+68tlbL0axtcX9kIPOpzeoBeySK4= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-357-FSV-RnZqPOKXNkdbjeBNgw-1; Fri, 08 Nov 2024 12:33:48 -0500 X-MC-Unique: FSV-RnZqPOKXNkdbjeBNgw-1 X-Mimecast-MFC-AGG-ID: FSV-RnZqPOKXNkdbjeBNgw Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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 mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 56B4C19541AE; Fri, 8 Nov 2024 17:33:45 +0000 (UTC) Received: from warthog.procyon.org.uk.com (unknown [10.42.28.231]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C24C41956054; Fri, 8 Nov 2024 17:33:38 +0000 (UTC) From: David Howells To: Christian Brauner , Steve French , Matthew Wilcox Cc: David Howells , Jeff Layton , Gao Xiang , Dominique Martinet , Marc Dionne , Paulo Alcantara , Shyam Prasad N , Tom Talpey , Eric Van Hensbergen , Ilya Dryomov , netfs@lists.linux.dev, 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, linux-cachefs@redhat.com Subject: [PATCH v4 08/33] netfs: Make netfs_advance_write() return size_t Date: Fri, 8 Nov 2024 17:32:09 +0000 Message-ID: <20241108173236.1382366-9-dhowells@redhat.com> In-Reply-To: <20241108173236.1382366-1-dhowells@redhat.com> References: <20241108173236.1382366-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 86A5940008 X-Stat-Signature: 1dwdescerbzbor8t1k9dujfpocp7qgkn X-Rspam-User: X-HE-Tag: 1731087213-694087 X-HE-Meta: U2FsdGVkX19absHY5ZIHoc6YnZGGHTRjhCdm98MZIBuptzXMTAT2i43wguYy674lSoFUbCxrJTdxtrIT5UBCKinSsu4JLwkiqDcFdz048Ag+xkhy9pA1CO5kfHsKbn04bn8hgz4T6R/H9Wj1HqikqtZraWhQww3LLyMYDWjsZp3sh1C2fGvjqky8+AyaJZpY87XPsiZSLj/3shuGWB0wHDmhC2IZXufAZY0u+MDv5mLaZ6pQvGX/AJl0XMM5ctJxmeFrWm6Nj+SV0VctclnE8rtvJoXEFoR+GoiP5Tf/Xkl0b0axvgZJjZKcbvGwvzE55kea6Q4EyUnv8bqI/oaT+amUMpXhsjOyZVPTU5MSS2L1LoVN4zDQ66r2uJNcLaotrWn6C0KRh1XqhxSdkwdC4s38YDjyndwTE7ZqFugxgPUfXaztDOeAoVkS6Elz5SR/rGgxQIFQhVvGgH+UggaUgN1BEVqZY/DwnabTy393uOFQN4xROkDO4qo63v5uMlgzRCQdgaavYR7fKKaslZh24MTf2hMihmDt/lGXKq93MRBQcpVGtrsdclsdOlgTxto0JHWs/AwSZOczpc9q3a9P7MWyZaYf3Kd7aB/9TI8NOc8j0IDOQll3zRysvQiKcQ28CUjsEkgOhXhLGw7MIYxdIIhbz1IqPuFQkXFcWqN/doaacI5o3tzuZJ2ej3pY8u8sZcpCeIuzeo3w4l4z/loUszrro9Au8y2ZZKu81nSkgwiuVVLcnImcmUdaiOpailSb0yXvnorUByqb+W6lnZQZqoH9oFCl80qqFyT9VzlGV9SbnuM5zHuOHqISPKiiAc1529FyOb/VgEZdCKuaiz76t6VeMc/m/IUXE8i+7uVEPSJlQmaRiLDgmiAaxA4lnuyKCafhBLXhL4s4DL5rRpqp/8p+IVosugZdTujPtPxrirnY0BK3wyiown03FB4FYpDA3xNDTsFM38Tw60yQVDr H4oKs6Li tw2Ey5bwX218oAV5egUZCHI9BaD0xQBTjoZ5Ub/nKN68W2LU4AcY+z/Jj/ZFHaDX5A4++7K05gipJRrtB3YTGX8MKQWSbr9t//Dnxk/eYRZsht6FeA01qDXftGmfBJFtN1SpKb4tewmQ0J6k0O80m31dpBRHYwxe74rrdS8+msSdXaMBSkNv63YyXpj9LXFGuCbEdk6hCf+JU2Yab4zv71TD8WZiDm2gED5AnshSkzs6twfzrb4mluilukJA+fAXEvqqiVAD8u85qFDvzcLQJ67tK8XGD9/T8MNR+8wP8QGbNPjuLlGKXjfIx0dn9yL8ER9mTJqyb1/BOVOLQ3W0wJ9sZ+4kP7TcBk/2ZLK/W8lCC4W7Pwhqxd0SVc6vn82gg6m4gGN+A/YojkYXeej+hKQHQ73yPLcxoIZ9RJWBhAM35zOvEnrGLKkuy8dF94bp84LH1+O1y6sjvr/Otu23uaEhZ9YWx2Q7smuk63Z8VeFZxV9i44KDOSJwsekEfX6bhbC6Wd1dyb++Mk5mKWKDptv/fGQ== 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: netfs_advance_write() calculates the amount of data it's attaching to a stream with size_t, but then returns this as an int. Switch the return value to size_t for consistency. Signed-off-by: David Howells cc: Jeff Layton cc: linux-cachefs@redhat.com cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org --- fs/netfs/internal.h | 6 +++--- fs/netfs/write_issue.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/netfs/internal.h b/fs/netfs/internal.h index ccd9058acb61..6aa2a8d49b37 100644 --- a/fs/netfs/internal.h +++ b/fs/netfs/internal.h @@ -178,9 +178,9 @@ void netfs_reissue_write(struct netfs_io_stream *stream, struct iov_iter *source); void netfs_issue_write(struct netfs_io_request *wreq, struct netfs_io_stream *stream); -int netfs_advance_write(struct netfs_io_request *wreq, - struct netfs_io_stream *stream, - loff_t start, size_t len, bool to_eof); +size_t netfs_advance_write(struct netfs_io_request *wreq, + struct netfs_io_stream *stream, + loff_t start, size_t len, bool to_eof); struct netfs_io_request *netfs_begin_writethrough(struct kiocb *iocb, size_t len); int netfs_advance_writethrough(struct netfs_io_request *wreq, struct writeback_control *wbc, struct folio *folio, size_t copied, bool to_page_end, diff --git a/fs/netfs/write_issue.c b/fs/netfs/write_issue.c index 993cc6def38e..c186221b45c0 100644 --- a/fs/netfs/write_issue.c +++ b/fs/netfs/write_issue.c @@ -271,9 +271,9 @@ void netfs_issue_write(struct netfs_io_request *wreq, * we can avoid overrunning the credits obtained (cifs) and try to parallelise * content-crypto preparation with network writes. */ -int netfs_advance_write(struct netfs_io_request *wreq, - struct netfs_io_stream *stream, - loff_t start, size_t len, bool to_eof) +size_t netfs_advance_write(struct netfs_io_request *wreq, + struct netfs_io_stream *stream, + loff_t start, size_t len, bool to_eof) { struct netfs_io_subrequest *subreq = stream->construct; size_t part;