diff options
author | NeilBrown <neilb@suse.de> | 2024-07-26 12:21:33 +1000 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2024-09-20 19:31:03 -0400 |
commit | 4f67d24f723b27ed50962db32718d180d0e869da (patch) | |
tree | 1c4b81e22a80c44eb763128d80c872f9a09f2449 /fs/nfsd/nfsd.h | |
parent | 9fd45c16f3e3b95b458e049c77f4d7dfef673a52 (diff) | |
download | linux-4f67d24f723b27ed50962db32718d180d0e869da.tar.gz linux-4f67d24f723b27ed50962db32718d180d0e869da.tar.bz2 linux-4f67d24f723b27ed50962db32718d180d0e869da.zip |
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>
Diffstat (limited to 'fs/nfsd/nfsd.h')
-rw-r--r-- | fs/nfsd/nfsd.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h index 369c3b3ce53e..8750ade0a7ee 100644 --- a/fs/nfsd/nfsd.h +++ b/fs/nfsd/nfsd.h @@ -118,7 +118,7 @@ int nfsd_get_nrthreads(int n, int *, struct net *); int nfsd_set_nrthreads(int n, int *, struct net *); void nfsd_shutdown_threads(struct net *net); -bool i_am_nfsd(void); +struct svc_rqst *nfsd_current_rqst(void); struct nfsdfs_client { struct kref cl_ref; @@ -159,7 +159,7 @@ extern int nfsd_max_blksize; static inline int nfsd_v4client(struct svc_rqst *rq) { - return rq->rq_prog == NFS_PROGRAM && rq->rq_vers == 4; + return rq && rq->rq_prog == NFS_PROGRAM && rq->rq_vers == 4; } static inline struct user_namespace * nfsd_user_namespace(const struct svc_rqst *rqstp) |