diff mbox series

[4/6] nfsd: don't take/put an extra reference when putting a file

Message ID 20230118173139.71846-5-jlayton@kernel.org (mailing list archive)
State New, archived
Headers show
Series nfsd: random cleanup and doc work | expand

Commit Message

Jeffrey Layton Jan. 18, 2023, 5:31 p.m. UTC
The last thing that filp_close does is an fput, so don't bother taking
and putting the extra reference.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/nfsd/filecache.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c
index a2bc4bd90b9a..f604dd8109e4 100644
--- a/fs/nfsd/filecache.c
+++ b/fs/nfsd/filecache.c
@@ -401,11 +401,8 @@  nfsd_file_free(struct nfsd_file *nf)
 
 	if (nf->nf_mark)
 		nfsd_file_mark_put(nf->nf_mark);
-	if (nf->nf_file) {
-		get_file(nf->nf_file);
+	if (nf->nf_file)
 		filp_close(nf->nf_file, NULL);
-		fput(nf->nf_file);
-	}
 
 	/*
 	 * If this item is still linked via nf_lru, that's a bug.