Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp943559imi; Fri, 22 Jul 2022 13:10:51 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tFI69pknUbsY1R97tUvEzn6Vf48heJ5aA3+h1atHJteyJ6LeoVa1bv59QkkuS+j12kZB3L X-Received: by 2002:a17:907:2d0b:b0:72b:978a:c6df with SMTP id gs11-20020a1709072d0b00b0072b978ac6dfmr1199164ejc.618.1658520650617; Fri, 22 Jul 2022 13:10:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658520650; cv=none; d=google.com; s=arc-20160816; b=bkoqU1xNQMUY+bOlhwO7R1dCy3mrxAPT+w9+gDiW2DI29LwcRozj6ClOl0UvbbGoY6 +/yCXUPaIDxYFlpTNfFnNg57gfHG5ydMDbDY+/8WFSLKV2ycyxMn/JXcAzR/T0ax4OyK nrBEO6p1QiONcdPpTcz+ig3z4g5mr8Gv2ihlNI6MVwGH1iTnt1RweJq74PbojaxLzKex WStnGCg17YFvsqNGINjhfBxypWo+Q/nrT01WhHO9eEX/6z/jpgDipkHiLiWzZBt2M6JI ilatakbYcCpKP2KN4tFukmsyL/pEP89Um0MqzKJlFagumqOCiHfg15kj5jeayomlu3CS +hhw== 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 :user-agent:references:in-reply-to:message-id:date:to:from:subject; bh=N1N+x8Tj2pucY8AFnv7fBRGQlseL8eXdZT5B3eA352U=; b=M4/2gBI/vMAboIWXL0yyIU2IqF19vzGNH9ISD+EI5Lp8ATJDMSI7UyfpPB9EDbMH3S FDE/k1KmOwpqpqNzXh9dgJVThH8JXxq6Nd24HXvfp6IG7uqi5EflUp8bxRI1QG3hzhP8 CErTdkZm8yir7eDX47AddgASur0Tj4Pn+CZjqyBMzfGZNpm8rQ+GGCq4jhVdafwi5ChL 124uTE/L5wySIVphexhuvq7/QrFT6ASNKEvMAXeAdq1cu7px1vRTp7VjI9K9QwOFlKg3 YiFP8KVmyY6WJFhMCkHviqpsyW0MJ4JOdZDO6R3KTMEIX264Ni+S8zVH+AkiEXXsRtYp kguQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sg12-20020a170907a40c00b00718d0604af4si8089083ejc.604.2022.07.22.13.10.22; Fri, 22 Jul 2022 13:10:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236207AbiGVUJU (ORCPT + 99 others); Fri, 22 Jul 2022 16:09:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236544AbiGVUJC (ORCPT ); Fri, 22 Jul 2022 16:09:02 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2E8CAF70E for ; Fri, 22 Jul 2022 13:09:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 457CBB81EDB for ; Fri, 22 Jul 2022 20:09:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3E9DC341C6 for ; Fri, 22 Jul 2022 20:08:58 +0000 (UTC) Subject: [PATCH v1 4/8] NFSD: Add an nfsd4_read::rd_eof field From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Fri, 22 Jul 2022 16:08:57 -0400 Message-ID: <165852053791.11198.9827634691670761329.stgit@manet.1015granger.net> In-Reply-To: <165852051841.11198.2929614302983292322.stgit@manet.1015granger.net> References: <165852051841.11198.2929614302983292322.stgit@manet.1015granger.net> User-Agent: StGit/1.5.dev2+g9ce680a5 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Refactor: Make the EOF result available in the entire NFSv4 READ path. Signed-off-by: Chuck Lever --- fs/nfsd/nfs4xdr.c | 11 +++++------ fs/nfsd/xdr4.h | 5 +++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index c9468f205dad..16ae1be1bbac 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -3879,7 +3879,6 @@ static __be32 nfsd4_encode_splice_read( struct xdr_stream *xdr = resp->xdr; struct xdr_buf *buf = xdr->buf; int status, space_left; - u32 eof; __be32 nfserr; __be32 *p = xdr->p - 2; @@ -3888,7 +3887,8 @@ static __be32 nfsd4_encode_splice_read( return nfserr_resource; nfserr = nfsd_splice_read(read->rd_rqstp, read->rd_fhp, - file, read->rd_offset, &maxcount, &eof); + file, read->rd_offset, &maxcount, + &read->rd_eof); read->rd_length = maxcount; if (nfserr) goto out_err; @@ -3899,7 +3899,7 @@ static __be32 nfsd4_encode_splice_read( goto out_err; } - *(p++) = htonl(eof); + *(p++) = htonl(read->rd_eof); *(p++) = htonl(maxcount); buf->page_len = maxcount; @@ -3943,7 +3943,6 @@ static __be32 nfsd4_encode_readv(struct nfsd4_compoundres *resp, struct file *file, unsigned long maxcount) { struct xdr_stream *xdr = resp->xdr; - u32 eof; int starting_len = xdr->buf->len - 8; __be32 nfserr; __be32 tmp; @@ -3955,7 +3954,7 @@ static __be32 nfsd4_encode_readv(struct nfsd4_compoundres *resp, nfserr = nfsd_readv(resp->rqstp, read->rd_fhp, file, read->rd_offset, resp->rqstp->rq_vec, read->rd_vlen, &maxcount, - &eof); + &read->rd_eof); read->rd_length = maxcount; if (nfserr) return nfserr; @@ -3963,7 +3962,7 @@ static __be32 nfsd4_encode_readv(struct nfsd4_compoundres *resp, return nfserr_io; xdr_truncate_encode(xdr, starting_len + 8 + xdr_align_size(maxcount)); - tmp = htonl(eof); + tmp = htonl(read->rd_eof); write_bytes_to_xdr_buf(xdr->buf, starting_len , &tmp, 4); tmp = htonl(maxcount); write_bytes_to_xdr_buf(xdr->buf, starting_len + 4, &tmp, 4); diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h index 7b744011f2d3..6e6a89008ce1 100644 --- a/fs/nfsd/xdr4.h +++ b/fs/nfsd/xdr4.h @@ -302,9 +302,10 @@ struct nfsd4_read { u32 rd_length; /* request */ int rd_vlen; struct nfsd_file *rd_nf; - + struct svc_rqst *rd_rqstp; /* response */ - struct svc_fh *rd_fhp; /* response */ + struct svc_fh *rd_fhp; /* response */ + u32 rd_eof; /* response */ }; struct nfsd4_readdir {