Skip to contentSkip to conversation

fs/nfsd: Remove the unused variable sb

PATCH In review Jiapeng Chong 2 participants 2 messages Nov 4, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs/nfsd: Remove the unused variable sb

Variable sb is not effectively used, so delete it.

fs/nfsd/nfs4state.c:7988:22: warning: variable ‘sb’ set but not used.

---
 fs/nfsd/nfs4state.c | 2 --
 1 file changed, 2 deletions(-)
fs/nfsd/nfs4state.c +0 -2
index 5d47a28ef62d..45e487bf0582 100644
@@ -7986,7 +7986,6 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
 	struct nfsd4_blocked_lock *nbl = NULL;
 	struct file_lock *file_lock = NULL;
 	struct file_lock *conflock = NULL;
-	struct super_block *sb;
 	__be32 status = 0;
 	int lkflg;
 	int err;
@@ -8006,7 +8005,6 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
 	status = fh_verify(rqstp, &cstate->current_fh, S_IFREG, 0);
 	if (status != nfs_ok)
 		return status;
-	sb = cstate->current_fh.fh_dentry->d_sb;
 
 	if (lock->lk_is_new) {
 		if (nfsd4_has_session(cstate))
Signature · 1 line
2.32.0.3.g01195cf9f
maintainer
#1 lore raw
Quoted 24 lines · Jiapeng Chong

Variable sb is not effectively used, so delete it.

fs/nfsd/nfs4state.c:7988:22: warning: variable ‘sb’ set but not used.

---
 fs/nfsd/nfs4state.c | 2 --
 1 file changed, 2 deletions(-)
fs/nfsd/nfs4state.c +0 -1
index 5d47a28ef62d..45e487bf0582 100644
@@ -7986,7 +7986,6 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
 	struct nfsd4_blocked_lock *nbl = NULL;
 	struct file_lock *file_lock = NULL;
 	struct file_lock *conflock = NULL;
-	struct super_block *sb;
 	__be32 status = 0;
 	int lkflg;
 	int err;

fs/nfsd/nfs4state.c nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, · line 8010

Quoted 7 lines
fs/nfsd/nfs4state.c +0 -1
@@ -8006,7 +8005,6 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
 	status = fh_verify(rqstp, &cstate->current_fh, S_IFREG, 0);
 	if (status != nfs_ok)
 		return status;
-	sb = cstate->current_fh.fh_dentry->d_sb;
 
 	if (lock->lk_is_new) {
 		if (nfsd4_has_session(cstate))

I would be fine with this, but there are some patches queued for v6.13 in Chuck's tree that start making use of this variable. I suggest that we don't take this one for now.

Signature · 1 line
Jeff Layton <[email protected]>