Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp441404rdb; Fri, 17 Nov 2023 03:25:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IHlafXNFJWVay++1ZZo3iE4F9z2bxd90/rWkkyyilGp1GZmN2tNxmiSo4vUl4eowMwj2KGH X-Received: by 2002:a05:6a20:3d24:b0:187:9521:92b4 with SMTP id y36-20020a056a203d2400b00187952192b4mr7199177pzi.19.1700220329607; Fri, 17 Nov 2023 03:25:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700220329; cv=none; d=google.com; s=arc-20160816; b=zRRXBkpHpMxtsUOeRa7my2zRGdCKo45jSitMq08b0Cq4fdyIxJSUXpS1PSfDyyk8Ma M55va27oAzfAj0JQhb9/cK72M3I2jeZA3QR7HA7U7Hd8Ej1BpuVMfTdysy/eEB5KubLu eQjtXdL5sd2q3sUeBMz2cW0VXfnE9ztsgnGcqcKvq8z9QxAF0VQnEMa8gpq2U4YxJdId iBLorv9/VHjU10SGvOKZ13QGmutjutq5GG1euFddo6p1vc2r2TQIH1qJ+dMwqeDbibj6 7OsyLbOVj10tvOIi6dZ3fDC22f5oK1tU8mEzJv8KYoaqfKl8TpAiaG+Kiy0E+mGfgRpJ 9bIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tmxcxjCyX6EuIuA8vnWgEiyczIWN1WCsXiLjcHiiB/c=; fh=kMe8ipV+H2zZMCwplNV8b/uzUHICYp+b9TeU6KoaKrQ=; b=AuCKyy2LBc6Rh/I2T1sa3Z0ufziSRx3T62PTPPzwNuQCXlYuiBbRmLwJijUiYZ+VKu z/2M16iUxSu0nOWzrPkCucATgpQg+w2E/EtCtbgImun90+QUyYi/I9+cPHm37xwwGvcD pSEJU9yuIrTqZCr4/lm8rvwa61I97xpdfjfZBLM0Gba+qGez0IPeE1ydfAYR8fGbrKJJ dwrE7TrbAFlBtXMsbk6PvPcqYPvfn52vJUVyC/IU6564JmAd0FNnGnvvq/3bb1padGRt guJTfMH1yKJyolb6qhwhEJUivd34RuaktZW1sy/Zhd3/8W0gwO9FUV7VFxrwZrf3nhBh wAoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VQkN6WDq; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id y67-20020a636446000000b005c1e7583b86si1767991pgb.659.2023.11.17.03.25.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 03:25:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VQkN6WDq; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 3339D8303A2E; Fri, 17 Nov 2023 03:25:25 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343584AbjKQLZ0 (ORCPT + 99 others); Fri, 17 Nov 2023 06:25:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345745AbjKQLZZ (ORCPT ); Fri, 17 Nov 2023 06:25:25 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AC1AA6 for ; Fri, 17 Nov 2023 03:25:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700220320; 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=tmxcxjCyX6EuIuA8vnWgEiyczIWN1WCsXiLjcHiiB/c=; b=VQkN6WDqNtcOmddnkhIQm5ONnzLQ8+BIlG7TvnAZdA53kkLdwswywJ9MqfqssfoVMPYld2 FpBFfNZIzHRuV7YdYnWmd7TE4j0TEWE+xOM3t4r/0dD7Ah06gtS9FvxFckJZw+on4RMCx6 F5lN6cvTNUodi4wieva3QbEqIt6IExk= 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-81-fnJpsfd5PcuVzx8h0e4HtA-1; Fri, 17 Nov 2023 06:25:17 -0500 X-MC-Unique: fnJpsfd5PcuVzx8h0e4HtA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (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 1FFF283BA86; Fri, 17 Nov 2023 11:25:17 +0000 (UTC) Received: from bcodding.csb.redhat.com (unknown [10.22.48.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8741F2026D4C; Fri, 17 Nov 2023 11:25:16 +0000 (UTC) From: Benjamin Coddington To: trond.myklebust@hammerspace.com, anna@kernel.org Cc: linux-nfs@vger.kernel.org Subject: [PATCH v2 2/2] NFS: drop unused nfs_direct_req bytes_left Date: Fri, 17 Nov 2023 06:25:14 -0500 Message-ID: <0bdf152bc69f7dcf91c9c70ffcbab92ac03682f0.1700220277.git.bcodding@redhat.com> In-Reply-To: <21a1f2a6155398965f79ed64f0bd23bf38a50367.1700220277.git.bcodding@redhat.com> References: <21a1f2a6155398965f79ed64f0bd23bf38a50367.1700220277.git.bcodding@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 17 Nov 2023 03:25:25 -0800 (PST) Now that we're calculating how large a remaining IO should be based on the current request's offset, we no longer need to track bytes_left on each struct nfs_direct_req. Drop the field, and clean up the direct request tracepoints. Signed-off-by: Benjamin Coddington --- fs/nfs/direct.c | 6 ++---- fs/nfs/internal.h | 1 - fs/nfs/nfstrace.h | 6 ++---- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 5918c67dae0d..c03926a1cc73 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c @@ -369,7 +369,6 @@ static ssize_t nfs_direct_read_schedule_iovec(struct nfs_direct_req *dreq, bytes -= req_len; requested_bytes += req_len; pos += req_len; - dreq->bytes_left -= req_len; } nfs_direct_release_pages(pagevec, npages); kvfree(pagevec); @@ -441,7 +440,7 @@ ssize_t nfs_file_direct_read(struct kiocb *iocb, struct iov_iter *iter, goto out; dreq->inode = inode; - dreq->bytes_left = dreq->max_count = count; + dreq->max_count = count; dreq->io_start = iocb->ki_pos; dreq->ctx = get_nfs_open_context(nfs_file_open_context(iocb->ki_filp)); l_ctx = nfs_get_lock_context(dreq->ctx); @@ -874,7 +873,6 @@ static ssize_t nfs_direct_write_schedule_iovec(struct nfs_direct_req *dreq, bytes -= req_len; requested_bytes += req_len; pos += req_len; - dreq->bytes_left -= req_len; if (defer) { nfs_mark_request_commit(req, NULL, &cinfo, 0); @@ -981,7 +979,7 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, struct iov_iter *iter, goto out; dreq->inode = inode; - dreq->bytes_left = dreq->max_count = count; + dreq->max_count = count; dreq->io_start = pos; dreq->ctx = get_nfs_open_context(nfs_file_open_context(iocb->ki_filp)); l_ctx = nfs_get_lock_context(dreq->ctx); diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index b1fa81c9dff6..e3722ce6722e 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h @@ -936,7 +936,6 @@ struct nfs_direct_req { loff_t io_start; /* Start offset for I/O */ ssize_t count, /* bytes actually processed */ max_count, /* max expected count */ - bytes_left, /* bytes left to be sent */ error; /* any reported error */ struct completion completion; /* wait for i/o completion */ diff --git a/fs/nfs/nfstrace.h b/fs/nfs/nfstrace.h index 4e90ca531176..03cbc3893cef 100644 --- a/fs/nfs/nfstrace.h +++ b/fs/nfs/nfstrace.h @@ -1539,7 +1539,6 @@ DECLARE_EVENT_CLASS(nfs_direct_req_class, __field(u32, fhandle) __field(loff_t, offset) __field(ssize_t, count) - __field(ssize_t, bytes_left) __field(ssize_t, error) __field(int, flags) ), @@ -1554,19 +1553,18 @@ DECLARE_EVENT_CLASS(nfs_direct_req_class, __entry->fhandle = nfs_fhandle_hash(fh); __entry->offset = dreq->io_start; __entry->count = dreq->count; - __entry->bytes_left = dreq->bytes_left; __entry->error = dreq->error; __entry->flags = dreq->flags; ), TP_printk( "error=%zd fileid=%02x:%02x:%llu fhandle=0x%08x " - "offset=%lld count=%zd bytes_left=%zd flags=%s", + "offset=%lld count=%zd flags=%s", __entry->error, MAJOR(__entry->dev), MINOR(__entry->dev), (unsigned long long)__entry->fileid, __entry->fhandle, __entry->offset, - __entry->count, __entry->bytes_left, + __entry->count, nfs_show_direct_req_flags(__entry->flags) ) ); -- 2.41.0