From patchwork Thu Mar 28 16:34:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13609036 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 62B1512FF63 for ; Thu, 28 Mar 2024 16:36:45 +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=1711643806; cv=none; b=Yk4prErW28K1B3f3LgOMNewHQT0ujeUYnCi6pDeO21jg/Z3/vwroPfDI6d4dv9Sm8Eja7oro+w6PAMTgdO2JTN+PYI8nLoLAIPQ/gCSThkEbdc9sgbRCsoY9Xvt+JOZD097RNFvFDTqcRKCPEmrRum/WaQ24M3B8V8MdPItJ//s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711643806; c=relaxed/simple; bh=hfTpBenYXqn/yYZgL0VekIwKOYS296pHNOKURBLP4z0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=N+FBbdV37szzJw0bT9AnZDVvODOGj0ZRhrmQbBJF/HeoxzEB9W3x+qo+1XZCTffV2XvXAoL6X15va699KdNHdlnt2r+3GzBlS2seKNlw4xyDh1d1iWBLL45+vmjqXtRld4othsEB7jgYGeLENNIY6oVdhmUs6VaJxVlUOkp7bbI= 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=OTH0kRO4; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OTH0kRO4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711643804; 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=SL4EWbx4NBAGR5Ppiq2v7C/YTDepZ3O+7v26rOrM0n0=; b=OTH0kRO4bu6vEi8yG6Rxn/PWsOg39TnbvJO26DScBhFxCim8YDtV1tvTEBZaZF9wTQdcnk nEhEFqW+Uov5feKJsgU5Etvwr6JVyTr+jkTcZQpJmrvppon7Owf2DezisN1DCFglulSfkH 5zEoUZcby0nbMdgbYs3W2kNEo2AO318= 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-221-ChXRkUr0OMqFZ7Fb17h45A-1; Thu, 28 Mar 2024 12:36:39 -0400 X-MC-Unique: ChXRkUr0OMqFZ7Fb17h45A-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (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 4165985A58C; Thu, 28 Mar 2024 16:36:34 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.146]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3C6FA111F3C6; Thu, 28 Mar 2024 16:36:31 +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 08/26] netfs: Use subreq_counter to allocate subreq debug_index values Date: Thu, 28 Mar 2024 16:34:00 +0000 Message-ID: <20240328163424.2781320-9-dhowells@redhat.com> In-Reply-To: <20240328163424.2781320-1-dhowells@redhat.com> References: <20240328163424.2781320-1-dhowells@redhat.com> Precedence: bulk X-Mailing-List: linux-cifs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 Use the subreq_counter in netfs_io_request to allocate subrequest debug_index values in read ops as well as write ops. Signed-off-by: David Howells cc: Jeff Layton cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org --- fs/netfs/io.c | 7 ++----- fs/netfs/objects.c | 1 + fs/netfs/output.c | 1 - 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/netfs/io.c b/fs/netfs/io.c index 2641238aae82..8de581ac0cfb 100644 --- a/fs/netfs/io.c +++ b/fs/netfs/io.c @@ -501,8 +501,7 @@ netfs_rreq_prepare_read(struct netfs_io_request *rreq, * Slice off a piece of a read request and submit an I/O request for it. */ static bool netfs_rreq_submit_slice(struct netfs_io_request *rreq, - struct iov_iter *io_iter, - unsigned int *_debug_index) + struct iov_iter *io_iter) { struct netfs_io_subrequest *subreq; enum netfs_io_source source; @@ -511,7 +510,6 @@ static bool netfs_rreq_submit_slice(struct netfs_io_request *rreq, if (!subreq) return false; - subreq->debug_index = (*_debug_index)++; subreq->start = rreq->start + rreq->submitted; subreq->len = io_iter->count; @@ -565,7 +563,6 @@ static bool netfs_rreq_submit_slice(struct netfs_io_request *rreq, int netfs_begin_read(struct netfs_io_request *rreq, bool sync) { struct iov_iter io_iter; - unsigned int debug_index = 0; int ret; _enter("R=%x %llx-%llx", @@ -596,7 +593,7 @@ int netfs_begin_read(struct netfs_io_request *rreq, bool sync) if (rreq->origin == NETFS_DIO_READ && rreq->start + rreq->submitted >= rreq->i_size) break; - if (!netfs_rreq_submit_slice(rreq, &io_iter, &debug_index)) + if (!netfs_rreq_submit_slice(rreq, &io_iter)) break; if (test_bit(NETFS_RREQ_BLOCKED, &rreq->flags) && test_bit(NETFS_RREQ_NONBLOCK, &rreq->flags)) diff --git a/fs/netfs/objects.c b/fs/netfs/objects.c index 72b52f070270..8acc03a64059 100644 --- a/fs/netfs/objects.c +++ b/fs/netfs/objects.c @@ -152,6 +152,7 @@ struct netfs_io_subrequest *netfs_alloc_subrequest(struct netfs_io_request *rreq INIT_LIST_HEAD(&subreq->rreq_link); refcount_set(&subreq->ref, 2); subreq->rreq = rreq; + subreq->debug_index = atomic_inc_return(&rreq->subreq_counter); netfs_get_request(rreq, netfs_rreq_trace_get_subreq); netfs_stat(&netfs_n_rh_sreq); } diff --git a/fs/netfs/output.c b/fs/netfs/output.c index fbdbb4f78234..e586396d6b72 100644 --- a/fs/netfs/output.c +++ b/fs/netfs/output.c @@ -37,7 +37,6 @@ struct netfs_io_subrequest *netfs_create_write_request(struct netfs_io_request * subreq->source = dest; subreq->start = start; subreq->len = len; - subreq->debug_index = atomic_inc_return(&wreq->subreq_counter); switch (subreq->source) { case NETFS_UPLOAD_TO_SERVER: