From patchwork Mon Dec 16 20:40:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13910330 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 50A37E7717F for ; Mon, 16 Dec 2024 20:42:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D80FD6B00B8; Mon, 16 Dec 2024 15:42:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D65EF6B00BA; Mon, 16 Dec 2024 15:42:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C1F646B00B9; Mon, 16 Dec 2024 15:42:27 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 9EF486B00B7 for ; Mon, 16 Dec 2024 15:42:27 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 5CA51A0104 for ; Mon, 16 Dec 2024 20:42:27 +0000 (UTC) X-FDA: 82901994252.22.FD4FA19 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf25.hostedemail.com (Postfix) with ESMTP id 565DAA0005 for ; Mon, 16 Dec 2024 20:42:04 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=dT0qBgNQ; spf=pass (imf25.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=1734381723; 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=PF30MqttAq61NFCi8PPBXJ+dvrfjZ/56jbstyvCuFx4=; b=WLQKR7Xbz7+SZ9CORkiPuQrFVtUPNU7fGWeH0gG0PijLGUsS6GnR4RApFI3BMvZlela7tn oa66Q/qlFydnOk/9kt8dNsJXAoePFYuA+/THb2RtE/t7DaJ0aG6cBnl2khRvnVxN1/NYqM IehHrlFrIRVc362qJIMlj3AsQxzp4/w= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=dT0qBgNQ; spf=pass (imf25.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=1734381723; a=rsa-sha256; cv=none; b=OsGPZ9r4uWY9YlbopSEbKAH3k8MFx/+8bZdJT6tA3cB1wPmzLmRMWAxPPWOzyD+wMboBp6 AQ0/p8wwMXVdy+yfE5oUKDRQvcpafZTlupyoLNCnBKIUoKRHLi+J4HUnAodBbrC7x72Ahc nfhZ2IS0ZbXUsVwW44HnwU16lOCZLg4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1734381745; 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=PF30MqttAq61NFCi8PPBXJ+dvrfjZ/56jbstyvCuFx4=; b=dT0qBgNQ1FUkwj9vECRsdanZfbhvUqJlpeeFAQ0dUd2dM2OAfv4egOLtJtN646Qrts6JpQ tidbx5MqU7dVKE1lUhWsD5Wj1//ugPOyaVSKjb2LM6ppHT+sDiZ9Tpd7Ex7uKFjgOMOCwo WotZKUOC6aELDqovpEGAPfueZbvuyps= Received: from mx-prod-mc-01.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-671-eH3DhVTKNVybP1vuRo2esA-1; Mon, 16 Dec 2024 15:42:23 -0500 X-MC-Unique: eH3DhVTKNVybP1vuRo2esA-1 X-Mimecast-MFC-AGG-ID: eH3DhVTKNVybP1vuRo2esA Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C5B951955F40; Mon, 16 Dec 2024 20:42:20 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.48]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 32F6219560A2; Mon, 16 Dec 2024 20:42:13 +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 v5 06/32] netfs: Make netfs_advance_write() return size_t Date: Mon, 16 Dec 2024 20:40:56 +0000 Message-ID: <20241216204124.3752367-7-dhowells@redhat.com> In-Reply-To: <20241216204124.3752367-1-dhowells@redhat.com> References: <20241216204124.3752367-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Rspamd-Queue-Id: 565DAA0005 X-Rspamd-Server: rspam12 X-Stat-Signature: nyhoa3nu5e8qn6o5cqq7yz3ew99bs6hu X-Rspam-User: X-HE-Tag: 1734381724-716376 X-HE-Meta: U2FsdGVkX19Hb0k3kR0L5Zi+S+vhHCH96qbiWzFQhtEd5R3D66OEv+ctH+oaHrZRlMOT+APHxm0+tMRJ2QGGLnGN/A3GgZozBvfSfM27UUkNse++JW5JE7+ksKzOaQDPRCTjYNmUGNv5vdTjZ5DXNgKG8lRVqFop+zKpISXrJBcGrQkekFBv5Lt8StXx+Rn6C9Qx91nRDuxSd3/FZeNDEhjELHZ8WlPcfkHuA0iitSKaLy+jW63TsydTMR9enBWd4xNVXdO9PQsAxqs8U06RRGTMYJxh1EXgxQpVciRINzbwWoV8ACIirJSgznl1Vaj+UbgJDxxy31VvgPxTjNBbyMue6OMDXaHKQJaSiUbav7Mf/v0fuY5MSlRxsWqj6ONy/i7Eu6TwJVjdKHXlzuQCoiH0z/Y19mS5ekXlpOe4K+4prq0pJq5SIUQJLpOfmuQwgJtatoFxluQHT4+MPOc5V0CPvH5RHqAwo3jiKT0tc2xNvdl4jS9WRf1EvaROa36mdpyVZer4NTOVZAm5Eaz8f8ZtlLc/OMm2oNixeX8bhRqaWCWZlNKghHOF2X3W8Yu1Of/v7c0icnikDRKxUxIPK4CBCkxeAdvrBv2RR1x8kCUjVfxFtUYqEfKGG7ZYTaa4j/GXN0NrsAyzq0FdHRzUpETG4450s72YswofSZ4Wq5qWdXPGyLDt/UQThhhw1TlNorwphMck9URhzUSappuZ9fbGCGEc8XHC4oXwtXV5Y+3qeS0WKKHdBjoKTmG0vl9Odch4qt9omFvP6SIn/yYIAFnpITp+YNngeNHVAcznfd9vUCVmMj28SKDOoJkZ0wn758etPdSXOK0nkwZKmvwz1Vv5oQOTFYHs6gB/+ZkJZMzSIqoLuICVY9QXawNZcwP05ERB+1swZd9W0XYPv+ciW/rMVwvv710e3FqcM/mZSW6+gbslNXtFkk+whkYuZje0hOv4KUneIkWI0W9eUNM JzllHZe0 O9ypKbRtHOmANpnNhsPrLuC/unh9njwGdAaJ1a4rtdGtBIVd5YfO0L0E9/O7IFPsa+cmfzsjwlyNwQSuDlNGES0rCNaG5GMPsbwHh/5ukrBL8R4AP8ns06mL5CudBQ4LbE8HDNMsAyZJqKPrY1p+ihtRe9bpanrPPG1FvvPoLszPSRVRQvytIfOhPcEO6Q8SpHyiwK7fpgnRx1bR8+LByRzTueWxtaM007CVl6YEP5eGZBShpjjLSX3dUJn+842XTh4PBmuTA6ERgPdcq8j/m3XQMajo0tddQ7olS9w8HwPwSS4UsSMkkrmiJX8Ug01H+zkBb4dD/VdiaPiZ8QB5HXYDsyoiKQdCifW3y39Bfj/eJHuhhZgof0wUqaHJiSZ7LFVKnrOfR0ZdE3S8FOXnum9d+OUe46cJcxaQqolGYR5ouuQnvt3cn85Ygp0rtgpiyS7hXMBfFFCKVTRP/rrSZNeXMpWiEoNPdPL4v1uw6XpQhclc= 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 88ceba49ff69..7a14a48e62ee 100644 --- a/fs/netfs/write_issue.c +++ b/fs/netfs/write_issue.c @@ -273,9 +273,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;