From: Chuck Lever <cel@kernel.org>
To: NeilBrown <neil@brown.name>, Jeff Layton <jlayton@kernel.org>,
Olga Kornievskaia <okorniev@redhat.com>,
Dai Ngo <dai.ngo@oracle.com>, Tom Talpey <tom@talpey.com>
Cc: <linux-nfs@vger.kernel.org>
Subject: [PATCH v3 34/34] SUNRPC: Remove svc_fill_symlink_pathname()
Date: Tue, 13 Oct 2026 08:49:55 -0400 [thread overview]
Message-ID: <20261013124955.316849-5-cel@kernel.org> (raw)
In-Reply-To: <20261013124955.316849-1-cel@kernel.org>
The NFSv2 and NFSv3 SYMLINK procedures copy the target pathname out
of a struct xdr_buf with nfsd_symlink_target(), so
svc_fill_symlink_pathname() has no callers left. Remove it.
Signed-off-by: Chuck Lever <cel@kernel.org>
---
include/linux/sunrpc/svc.h | 3 ---
net/sunrpc/svc.c | 50 --------------------------------------
2 files changed, 53 deletions(-)
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index a47f05fc6a12..a7039ec035fa 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -492,9 +492,6 @@ const char * svc_proc_name(const struct svc_rqst *rqstp);
int svc_encode_result_payload(struct svc_rqst *rqstp,
unsigned int offset,
unsigned int length);
-char *svc_fill_symlink_pathname(struct svc_rqst *rqstp,
- struct kvec *first, void *p,
- size_t total);
__be32 svc_generic_init_request(struct svc_rqst *rqstp,
const struct svc_program *progp,
struct svc_process_info *procinfo);
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 7e23af94a719..5c21ec585cd0 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -1883,53 +1883,3 @@ int svc_encode_result_payload(struct svc_rqst *rqstp, unsigned int offset,
length);
}
EXPORT_SYMBOL_GPL(svc_encode_result_payload);
-
-/**
- * svc_fill_symlink_pathname - Construct pathname argument for VFS symlink call
- * @rqstp: svc_rqst to operate on
- * @first: buffer containing first section of pathname
- * @p: buffer containing remaining section of pathname
- * @total: total length of the pathname argument
- *
- * The VFS symlink API demands a NUL-terminated pathname in mapped memory.
- * Returns pointer to a NUL-terminated string, or an ERR_PTR. Caller must free
- * the returned string.
- */
-char *svc_fill_symlink_pathname(struct svc_rqst *rqstp, struct kvec *first,
- void *p, size_t total)
-{
- size_t len, remaining;
- char *result, *dst;
-
- result = kmalloc(total + 1, GFP_KERNEL);
- if (!result)
- return ERR_PTR(-ESERVERFAULT);
-
- dst = result;
- remaining = total;
-
- len = min_t(size_t, total, first->iov_len);
- if (len) {
- memcpy(dst, first->iov_base, len);
- dst += len;
- remaining -= len;
- }
-
- if (remaining) {
- len = min_t(size_t, remaining, PAGE_SIZE);
- memcpy(dst, p, len);
- dst += len;
- }
-
- *dst = '\0';
-
- /* Sanity check: Linux doesn't allow the pathname argument to
- * contain a NUL byte.
- */
- if (strlen(result) != total) {
- kfree(result);
- return ERR_PTR(-EINVAL);
- }
- return result;
-}
-EXPORT_SYMBOL_GPL(svc_fill_symlink_pathname);
--
2.55.0
prev parent reply other threads:[~2026-10-13 12:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 12:49 [PATCH v3 30/34] NFSD: Refactor NFSv3 directory entry encoding Chuck Lever
2026-10-13 12:49 ` [PATCH v3 31/34] NFSD: Split struct nfsd3_readdirres Chuck Lever
2026-10-13 12:49 ` [PATCH v3 32/34] NFSD: Use xdrgen XDR functions for NFSv3 READDIR results Chuck Lever
2026-10-13 12:49 ` [PATCH v3 33/34] NFSD: Use xdrgen XDR functions for NFSv3 READDIRPLUS results Chuck Lever
2026-10-13 12:49 ` Chuck Lever [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261013124955.316849-5-cel@kernel.org \
--to=cel@kernel.org \
--cc=dai.ngo@oracle.com \
--cc=jlayton@kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neil@brown.name \
--cc=okorniev@redhat.com \
--cc=tom@talpey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox