From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D04734685; Tue, 10 Jun 2025 20:57:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749589062; cv=none; b=W2dd7ZKBmeyk1Y8xhxZ+8M0uCmg0uWWuQe+jXA1AbnT00LczQl9P5r48Derzngr8W/f8BvvkhoYhGMn09VMBqPBd8kB8BxIYKtSuBK0oC3WM2WFAf4h+eNp0/svKrg5DIaHz4UGXJOjL6kVQTeAu1aUc7gZ2rVMDZiqjckO2TDA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749589062; c=relaxed/simple; bh=/yv8szRb5hW8GuAinjhoyBcmVqsyXaAYGwfWkaYRLEg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=N6bVRUp8B6F4M8eds9c9rCDzt3B6rmCgoKoJzBSRaJ03/JktZvEHnkyRIMCZohTgQwB3XL9Gq0+5hJlAHKhGPe6Dsg+2atstmwFdqkto95OEmAzyMvdlnx+wd8iD+1Sv8nxXS6euU9sDfbOTjn4PfG1KOoju9m8tbPdg3nexpTY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FCITZYoN; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FCITZYoN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6DFC5C4CEF0; Tue, 10 Jun 2025 20:57:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1749589062; bh=/yv8szRb5hW8GuAinjhoyBcmVqsyXaAYGwfWkaYRLEg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FCITZYoNeqAs6BxHePXMzhTnV0XeJfk3L7HCkFWcvCsH9N44n4HBRe9wmyCs+L1GD bqgRjV5b5KU4Xq9m9uRCReojZSG+aRB6ijzWMokfcY9mGBnxsR3U3ZoCuN/RpIBHYq lnksKNJacAzuYQjJvkZhIe3uU/TeR7GrJsABwkXDd5RE51GYA5BDsIakYv0wU3X6wy omMwD9Q3PjhK3d/ursWd56patZwbhT7kZYs/wrP4t7IOkvqB0HR2zpsoZ2tnkjmz5/ /xwyNJsKgxSvjnCWNDmlI7TjtKwQJcz54WJLMihhzQ8WRexpkoADERNlBRjBH30in+ og+JIX5s8CNzA== From: Mike Snitzer To: Chuck Lever , Jeff Layton Cc: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, Jens Axboe Subject: [PATCH 3/6] NFSD: pass nfsd_file to nfsd_iter_read() Date: Tue, 10 Jun 2025 16:57:34 -0400 Message-ID: <20250610205737.63343-4-snitzer@kernel.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20250610205737.63343-1-snitzer@kernel.org> References: <20250610205737.63343-1-snitzer@kernel.org> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Prepares for nfsd_iter_read() to use DIO alignment stored in nfsd_file. Signed-off-by: Mike Snitzer --- fs/nfsd/nfs4xdr.c | 8 ++++---- fs/nfsd/vfs.c | 7 ++++--- fs/nfsd/vfs.h | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 9ceeb2d10c01..7ec6d951a284 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -4479,7 +4479,7 @@ static __be32 nfsd4_encode_splice_read( static __be32 nfsd4_encode_readv(struct nfsd4_compoundres *resp, struct nfsd4_read *read, - struct file *file, unsigned long maxcount) + unsigned long maxcount) { struct xdr_stream *xdr = resp->xdr; unsigned int base = xdr->buf->page_len & ~PAGE_MASK; @@ -4490,7 +4490,7 @@ static __be32 nfsd4_encode_readv(struct nfsd4_compoundres *resp, if (xdr_reserve_space_vec(xdr, maxcount) < 0) return nfserr_resource; - nfserr = nfsd_iter_read(resp->rqstp, read->rd_fhp, file, + nfserr = nfsd_iter_read(resp->rqstp, read->rd_fhp, read->rd_nf, read->rd_offset, &maxcount, base, &read->rd_eof); read->rd_length = maxcount; @@ -4537,7 +4537,7 @@ nfsd4_encode_read(struct nfsd4_compoundres *resp, __be32 nfserr, if (file->f_op->splice_read && splice_ok) nfserr = nfsd4_encode_splice_read(resp, read, file, maxcount); else - nfserr = nfsd4_encode_readv(resp, read, file, maxcount); + nfserr = nfsd4_encode_readv(resp, read, maxcount); if (nfserr) { xdr_truncate_encode(xdr, eof_offset); return nfserr; @@ -5433,7 +5433,7 @@ nfsd4_encode_read_plus_data(struct nfsd4_compoundres *resp, if (file->f_op->splice_read && splice_ok) nfserr = nfsd4_encode_splice_read(resp, read, file, maxcount); else - nfserr = nfsd4_encode_readv(resp, read, file, maxcount); + nfserr = nfsd4_encode_readv(resp, read, maxcount); if (nfserr) return nfserr; diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 8dccbb4d78f9..e7cc8c6dfbad 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -1068,7 +1068,7 @@ __be32 nfsd_splice_read(struct svc_rqst *rqstp, struct svc_fh *fhp, * nfsd_iter_read - Perform a VFS read using an iterator * @rqstp: RPC transaction context * @fhp: file handle of file to be read - * @file: opened struct file of file to be read + * @nf: opened struct nfsd_file of file to be read * @offset: starting byte offset * @count: IN: requested number of bytes; OUT: number of bytes read * @base: offset in first page of read buffer @@ -1081,9 +1081,10 @@ __be32 nfsd_splice_read(struct svc_rqst *rqstp, struct svc_fh *fhp, * returned. */ __be32 nfsd_iter_read(struct svc_rqst *rqstp, struct svc_fh *fhp, - struct file *file, loff_t offset, unsigned long *count, + struct nfsd_file *nf, loff_t offset, unsigned long *count, unsigned int base, u32 *eof) { + struct file *file = nf->nf_file; unsigned long v, total; struct iov_iter iter; loff_t ppos = offset; @@ -1311,7 +1312,7 @@ __be32 nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp, if (file->f_op->splice_read && nfsd_read_splice_ok(rqstp)) err = nfsd_splice_read(rqstp, fhp, file, offset, count, eof); else - err = nfsd_iter_read(rqstp, fhp, file, offset, count, 0, eof); + err = nfsd_iter_read(rqstp, fhp, nf, offset, count, 0, eof); nfsd_file_put(nf); trace_nfsd_read_done(rqstp, fhp, offset, *count); diff --git a/fs/nfsd/vfs.h b/fs/nfsd/vfs.h index e3de3a295704..09ed36fe5fd2 100644 --- a/fs/nfsd/vfs.h +++ b/fs/nfsd/vfs.h @@ -121,7 +121,7 @@ __be32 nfsd_splice_read(struct svc_rqst *rqstp, struct svc_fh *fhp, unsigned long *count, u32 *eof); __be32 nfsd_iter_read(struct svc_rqst *rqstp, struct svc_fh *fhp, - struct file *file, loff_t offset, + struct nfsd_file *nf, loff_t offset, unsigned long *count, unsigned int base, u32 *eof); bool nfsd_read_splice_ok(struct svc_rqst *rqstp); -- 2.44.0