diff mbox series

[4/4] nfsd: remove unused parameter of nfsd_file_mark_find_or_create

Message ID 20240823070049.3499625-5-lilingfeng3@huawei.com (mailing list archive)
State New
Headers show
Series nfsd: fix some comments and code cleanup | expand

Commit Message

Li Lingfeng Aug. 23, 2024, 7 a.m. UTC
Commit 427f5f83a319 ("NFSD: Ensure nf_inode is never dereferenced") passes
inode directly to nfsd_file_mark_find_or_create instead of getting it from
nf, so there is no need to pass nf.

Signed-off-by: Li Lingfeng <lilingfeng3@huawei.com>
---
 fs/nfsd/filecache.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jeff Layton Aug. 23, 2024, 12:09 p.m. UTC | #1
On Fri, 2024-08-23 at 15:00 +0800, Li Lingfeng wrote:
> Commit 427f5f83a319 ("NFSD: Ensure nf_inode is never dereferenced") passes
> inode directly to nfsd_file_mark_find_or_create instead of getting it from
> nf, so there is no need to pass nf.
> 
> Signed-off-by: Li Lingfeng <lilingfeng3@huawei.com>
> ---
>  fs/nfsd/filecache.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c
> index f4704f5d4086..376ec62e7794 100644
> --- a/fs/nfsd/filecache.c
> +++ b/fs/nfsd/filecache.c
> @@ -151,7 +151,7 @@ nfsd_file_mark_put(struct nfsd_file_mark *nfm)
>  }
>  
>  static struct nfsd_file_mark *
> -nfsd_file_mark_find_or_create(struct nfsd_file *nf, struct inode *inode)
> +nfsd_file_mark_find_or_create(struct inode *inode)
>  {
>  	int			err;
>  	struct fsnotify_mark	*mark;
> @@ -1074,7 +1074,7 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,
>  
>  open_file:
>  	trace_nfsd_file_alloc(nf);
> -	nf->nf_mark = nfsd_file_mark_find_or_create(nf, inode);
> +	nf->nf_mark = nfsd_file_mark_find_or_create(inode);
>  	if (nf->nf_mark) {
>  		if (file) {
>  			get_file(file);

Nice cleanup.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Chuck Lever III Aug. 23, 2024, 4:39 p.m. UTC | #2
On Fri, Aug 23, 2024 at 03:00:49PM +0800, Li Lingfeng wrote:
> Commit 427f5f83a319 ("NFSD: Ensure nf_inode is never dereferenced") passes
> inode directly to nfsd_file_mark_find_or_create instead of getting it from
> nf, so there is no need to pass nf.
> 
> [...]

Applied to nfsd-next for v6.12, thanks!

[4/4] nfsd: remove unused parameter of nfsd_file_mark_find_or_create
      commit: c78a662dfe4ea208e05c7ba78949a239e31c360d
diff mbox series

Patch

diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c
index f4704f5d4086..376ec62e7794 100644
--- a/fs/nfsd/filecache.c
+++ b/fs/nfsd/filecache.c
@@ -151,7 +151,7 @@  nfsd_file_mark_put(struct nfsd_file_mark *nfm)
 }
 
 static struct nfsd_file_mark *
-nfsd_file_mark_find_or_create(struct nfsd_file *nf, struct inode *inode)
+nfsd_file_mark_find_or_create(struct inode *inode)
 {
 	int			err;
 	struct fsnotify_mark	*mark;
@@ -1074,7 +1074,7 @@  nfsd_file_do_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,
 
 open_file:
 	trace_nfsd_file_alloc(nf);
-	nf->nf_mark = nfsd_file_mark_find_or_create(nf, inode);
+	nf->nf_mark = nfsd_file_mark_find_or_create(inode);
 	if (nf->nf_mark) {
 		if (file) {
 			get_file(file);