nfsd: use nfsd_v4client() in nfsd_breaker_owns_lease()
authorNeilBrown <neilb@suse.de>
Fri, 26 Jul 2024 02:21:33 +0000 (12:21 +1000)
committerChuck Lever <chuck.lever@oracle.com>
Fri, 20 Sep 2024 23:31:03 +0000 (19:31 -0400)
commit4f67d24f723b27ed50962db32718d180d0e869da
tree1c4b81e22a80c44eb763128d80c872f9a09f2449
parent9fd45c16f3e3b95b458e049c77f4d7dfef673a52
nfsd: use nfsd_v4client() in nfsd_breaker_owns_lease()

nfsd_breaker_owns_lease() currently open-codes the same test that
nfsd_v4client() performs.

With this patch we use nfsd_v4client() instead.

Also as i_am_nfsd() is only used in combination with kthread_data(),
replace it with nfsd_current_rqst() which combines the two and returns a
valid svc_rqst, or NULL.

The test for NULL is moved into nfsd_v4client() for code clarity.

Signed-off-by: NeilBrown <neilb@suse.de>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4state.c
fs/nfsd/nfsd.h
fs/nfsd/nfssvc.c