diff mbox series

NFSD: drop fname and flen args from nfsd_create_locked()

Message ID 166242493965.1168.6227147868888984691@noble.neil.brown.name (mailing list archive)
State New, archived
Headers show
Series NFSD: drop fname and flen args from nfsd_create_locked() | expand

Commit Message

NeilBrown Sept. 6, 2022, 12:42 a.m. UTC
nfsd_create_locked() does not use the "fname" and "flen" arguments, so
drop them from declaration and all callers.

Signed-off-by: NeilBrown <neilb@suse.de>
---
 fs/nfsd/nfsproc.c | 4 ++--
 fs/nfsd/vfs.c     | 4 ++--
 fs/nfsd/vfs.h     | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

Comments

Jeff Layton Sept. 6, 2022, 10:27 a.m. UTC | #1
On Tue, 2022-09-06 at 10:42 +1000, NeilBrown wrote:
> nfsd_create_locked() does not use the "fname" and "flen" arguments, so
> drop them from declaration and all callers.
> 
> Signed-off-by: NeilBrown <neilb@suse.de>
> ---
>  fs/nfsd/nfsproc.c | 4 ++--
>  fs/nfsd/vfs.c     | 4 ++--
>  fs/nfsd/vfs.h     | 2 +-
>  3 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c
> index 7381972f1677..9c766ac2cc68 100644
> --- a/fs/nfsd/nfsproc.c
> +++ b/fs/nfsd/nfsproc.c
> @@ -390,8 +390,8 @@ nfsd_proc_create(struct svc_rqst *rqstp)
>  	resp->status = nfs_ok;
>  	if (!inode) {
>  		/* File doesn't exist. Create it and set attrs */
> -		resp->status = nfsd_create_locked(rqstp, dirfhp, argp->name,
> -						  argp->len, &attrs, type, rdev,
> +		resp->status = nfsd_create_locked(rqstp, dirfhp,
> +						  &attrs, type, rdev,
>  						  newfhp);
>  	} else if (type == S_IFREG) {
>  		dprintk("nfsd:   existing %s, valid=%x, size=%ld\n",
> diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
> index 9f486b788ed0..528afc3be7af 100644
> --- a/fs/nfsd/vfs.c
> +++ b/fs/nfsd/vfs.c
> @@ -1252,7 +1252,7 @@ nfsd_check_ignore_resizing(struct iattr *iap)
>  /* The parent directory should already be locked: */
>  __be32
>  nfsd_create_locked(struct svc_rqst *rqstp, struct svc_fh *fhp,
> -		   char *fname, int flen, struct nfsd_attrs *attrs,
> +		   struct nfsd_attrs *attrs,
>  		   int type, dev_t rdev, struct svc_fh *resfhp)
>  {
>  	struct dentry	*dentry, *dchild;
> @@ -1379,7 +1379,7 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
>  	if (err)
>  		goto out_unlock;
>  	fh_fill_pre_attrs(fhp);
> -	err = nfsd_create_locked(rqstp, fhp, fname, flen, attrs, type,
> +	err = nfsd_create_locked(rqstp, fhp, attrs, type,
>  				 rdev, resfhp);
>  	fh_fill_post_attrs(fhp);
>  out_unlock:
> diff --git a/fs/nfsd/vfs.h b/fs/nfsd/vfs.h
> index c95cd414b4bb..0bf5c7e79abe 100644
> --- a/fs/nfsd/vfs.h
> +++ b/fs/nfsd/vfs.h
> @@ -79,7 +79,7 @@ __be32		nfsd4_clone_file_range(struct svc_rqst *rqstp,
>  				       u64 count, bool sync);
>  #endif /* CONFIG_NFSD_V4 */
>  __be32		nfsd_create_locked(struct svc_rqst *, struct svc_fh *,
> -				char *name, int len, struct nfsd_attrs *attrs,
> +				struct nfsd_attrs *attrs,
>  				int type, dev_t rdev, struct svc_fh *res);
>  __be32		nfsd_create(struct svc_rqst *, struct svc_fh *,
>  				char *name, int len, struct nfsd_attrs *attrs,


Reviewed-by: Jeff Layton <jlayton@kernel.org>
Chuck Lever Sept. 6, 2022, 3:52 p.m. UTC | #2
> On Sep 5, 2022, at 8:42 PM, NeilBrown <neilb@suse.de> wrote:
> 
> 
> nfsd_create_locked() does not use the "fname" and "flen" arguments, so
> drop them from declaration and all callers.
> 
> Signed-off-by: NeilBrown <neilb@suse.de>

Looks like this has been around since 2016. Applied to for-next
with whitespace adjustments. Thanks!


> ---
> fs/nfsd/nfsproc.c | 4 ++--
> fs/nfsd/vfs.c     | 4 ++--
> fs/nfsd/vfs.h     | 2 +-
> 3 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c
> index 7381972f1677..9c766ac2cc68 100644
> --- a/fs/nfsd/nfsproc.c
> +++ b/fs/nfsd/nfsproc.c
> @@ -390,8 +390,8 @@ nfsd_proc_create(struct svc_rqst *rqstp)
> 	resp->status = nfs_ok;
> 	if (!inode) {
> 		/* File doesn't exist. Create it and set attrs */
> -		resp->status = nfsd_create_locked(rqstp, dirfhp, argp->name,
> -						  argp->len, &attrs, type, rdev,
> +		resp->status = nfsd_create_locked(rqstp, dirfhp,
> +						  &attrs, type, rdev,
> 						  newfhp);
> 	} else if (type == S_IFREG) {
> 		dprintk("nfsd:   existing %s, valid=%x, size=%ld\n",
> diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
> index 9f486b788ed0..528afc3be7af 100644
> --- a/fs/nfsd/vfs.c
> +++ b/fs/nfsd/vfs.c
> @@ -1252,7 +1252,7 @@ nfsd_check_ignore_resizing(struct iattr *iap)
> /* The parent directory should already be locked: */
> __be32
> nfsd_create_locked(struct svc_rqst *rqstp, struct svc_fh *fhp,
> -		   char *fname, int flen, struct nfsd_attrs *attrs,
> +		   struct nfsd_attrs *attrs,
> 		   int type, dev_t rdev, struct svc_fh *resfhp)
> {
> 	struct dentry	*dentry, *dchild;
> @@ -1379,7 +1379,7 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
> 	if (err)
> 		goto out_unlock;
> 	fh_fill_pre_attrs(fhp);
> -	err = nfsd_create_locked(rqstp, fhp, fname, flen, attrs, type,
> +	err = nfsd_create_locked(rqstp, fhp, attrs, type,
> 				 rdev, resfhp);
> 	fh_fill_post_attrs(fhp);
> out_unlock:
> diff --git a/fs/nfsd/vfs.h b/fs/nfsd/vfs.h
> index c95cd414b4bb..0bf5c7e79abe 100644
> --- a/fs/nfsd/vfs.h
> +++ b/fs/nfsd/vfs.h
> @@ -79,7 +79,7 @@ __be32		nfsd4_clone_file_range(struct svc_rqst *rqstp,
> 				       u64 count, bool sync);
> #endif /* CONFIG_NFSD_V4 */
> __be32		nfsd_create_locked(struct svc_rqst *, struct svc_fh *,
> -				char *name, int len, struct nfsd_attrs *attrs,
> +				struct nfsd_attrs *attrs,
> 				int type, dev_t rdev, struct svc_fh *res);
> __be32		nfsd_create(struct svc_rqst *, struct svc_fh *,
> 				char *name, int len, struct nfsd_attrs *attrs,
> -- 
> 2.37.1
> 

--
Chuck Lever
diff mbox series

Patch

diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c
index 7381972f1677..9c766ac2cc68 100644
--- a/fs/nfsd/nfsproc.c
+++ b/fs/nfsd/nfsproc.c
@@ -390,8 +390,8 @@  nfsd_proc_create(struct svc_rqst *rqstp)
 	resp->status = nfs_ok;
 	if (!inode) {
 		/* File doesn't exist. Create it and set attrs */
-		resp->status = nfsd_create_locked(rqstp, dirfhp, argp->name,
-						  argp->len, &attrs, type, rdev,
+		resp->status = nfsd_create_locked(rqstp, dirfhp,
+						  &attrs, type, rdev,
 						  newfhp);
 	} else if (type == S_IFREG) {
 		dprintk("nfsd:   existing %s, valid=%x, size=%ld\n",
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 9f486b788ed0..528afc3be7af 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -1252,7 +1252,7 @@  nfsd_check_ignore_resizing(struct iattr *iap)
 /* The parent directory should already be locked: */
 __be32
 nfsd_create_locked(struct svc_rqst *rqstp, struct svc_fh *fhp,
-		   char *fname, int flen, struct nfsd_attrs *attrs,
+		   struct nfsd_attrs *attrs,
 		   int type, dev_t rdev, struct svc_fh *resfhp)
 {
 	struct dentry	*dentry, *dchild;
@@ -1379,7 +1379,7 @@  nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
 	if (err)
 		goto out_unlock;
 	fh_fill_pre_attrs(fhp);
-	err = nfsd_create_locked(rqstp, fhp, fname, flen, attrs, type,
+	err = nfsd_create_locked(rqstp, fhp, attrs, type,
 				 rdev, resfhp);
 	fh_fill_post_attrs(fhp);
 out_unlock:
diff --git a/fs/nfsd/vfs.h b/fs/nfsd/vfs.h
index c95cd414b4bb..0bf5c7e79abe 100644
--- a/fs/nfsd/vfs.h
+++ b/fs/nfsd/vfs.h
@@ -79,7 +79,7 @@  __be32		nfsd4_clone_file_range(struct svc_rqst *rqstp,
 				       u64 count, bool sync);
 #endif /* CONFIG_NFSD_V4 */
 __be32		nfsd_create_locked(struct svc_rqst *, struct svc_fh *,
-				char *name, int len, struct nfsd_attrs *attrs,
+				struct nfsd_attrs *attrs,
 				int type, dev_t rdev, struct svc_fh *res);
 __be32		nfsd_create(struct svc_rqst *, struct svc_fh *,
 				char *name, int len, struct nfsd_attrs *attrs,