From: "J. Bruce Fields" <bfields@redhat.com>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: linux-nfs@vger.kernel.org, "J. Bruce Fields" <bfields@redhat.com>
Subject: [PATCH 7/8] nfsd: simplify nfsd4_check_open_reclaim
Date: Tue, 19 Jan 2021 17:35:28 -0500 [thread overview]
Message-ID: <1611095729-31104-8-git-send-email-bfields@redhat.com> (raw)
In-Reply-To: <1611095729-31104-1-git-send-email-bfields@redhat.com>
From: "J. Bruce Fields" <bfields@redhat.com>
The set_client() was already taken care of by process_open1().
The comments here are mostly redundant with the code.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
---
fs/nfsd/nfs4proc.c | 3 +--
fs/nfsd/nfs4state.c | 18 +++---------------
fs/nfsd/state.h | 3 +--
3 files changed, 5 insertions(+), 19 deletions(-)
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 4727b7f03c5b..567af1f10d2c 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -423,8 +423,7 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
goto out;
break;
case NFS4_OPEN_CLAIM_PREVIOUS:
- status = nfs4_check_open_reclaim(&open->op_clientid,
- cstate, nn);
+ status = nfs4_check_open_reclaim(cstate->clp);
if (status)
goto out;
open->op_openowner->oo_flags |= NFS4_OO_CONFIRMED;
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 2c580ef6e337..860805ffde1a 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -7221,25 +7221,13 @@ nfsd4_find_reclaim_client(struct xdr_netobj name, struct nfsd_net *nn)
return NULL;
}
-/*
-* Called from OPEN. Look for clientid in reclaim list.
-*/
__be32
-nfs4_check_open_reclaim(clientid_t *clid,
- struct nfsd4_compound_state *cstate,
- struct nfsd_net *nn)
+nfs4_check_open_reclaim(struct nfs4_client *clp)
{
- __be32 status;
-
- /* find clientid in conf_id_hashtbl */
- status = set_clientid(clid, cstate, nn);
- if (status)
- return nfserr_reclaim_bad;
-
- if (test_bit(NFSD4_CLIENT_RECLAIM_COMPLETE, &cstate->clp->cl_flags))
+ if (test_bit(NFSD4_CLIENT_RECLAIM_COMPLETE, &clp->cl_flags))
return nfserr_no_grace;
- if (nfsd4_client_record_check(cstate->clp))
+ if (nfsd4_client_record_check(clp))
return nfserr_reclaim_bad;
return nfs_ok;
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h
index 9eae11a9d21c..73deea353169 100644
--- a/fs/nfsd/state.h
+++ b/fs/nfsd/state.h
@@ -649,8 +649,7 @@ void nfs4_remove_reclaim_record(struct nfs4_client_reclaim *, struct nfsd_net *)
extern void nfs4_release_reclaim(struct nfsd_net *);
extern struct nfs4_client_reclaim *nfsd4_find_reclaim_client(struct xdr_netobj name,
struct nfsd_net *nn);
-extern __be32 nfs4_check_open_reclaim(clientid_t *clid,
- struct nfsd4_compound_state *cstate, struct nfsd_net *nn);
+extern __be32 nfs4_check_open_reclaim(struct nfs4_client *);
extern void nfsd4_probe_callback(struct nfs4_client *clp);
extern void nfsd4_probe_callback_sync(struct nfs4_client *clp);
extern void nfsd4_change_callback(struct nfs4_client *clp, struct nfs4_cb_conn *);
--
2.29.2
next prev parent reply other threads:[~2021-01-19 22:40 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-19 22:35 [PATCH 0/8] miscellaneous nfsd4 state cleanup J. Bruce Fields
2021-01-19 22:35 ` [PATCH 1/8] nfsd4: simplify process_lookup1 J. Bruce Fields
2021-01-19 22:35 ` [PATCH 2/8] nfsd: simplify process_lock J. Bruce Fields
2021-01-20 21:01 ` Chuck Lever
2021-01-20 21:25 ` J. Bruce Fields
2021-01-19 22:35 ` [PATCH 3/8] nfsd: simplify nfsd_renew J. Bruce Fields
2021-01-19 22:35 ` [PATCH 4/8] nfsd: refactor lookup_clientid J. Bruce Fields
2021-01-20 21:02 ` Chuck Lever
2021-01-20 23:01 ` J. Bruce Fields
2021-01-21 1:54 ` Chuck Lever
2021-01-21 18:49 ` [PATCH 1/9] nfsd4: simplify process_lookup1 J. Bruce Fields
2021-01-21 18:49 ` [PATCH 2/9] nfsd: simplify process_lock J. Bruce Fields
2021-01-21 18:49 ` [PATCH 3/9] nfsd: simplify nfsd_renew J. Bruce Fields
2021-01-21 18:49 ` [PATCH 4/9] nfsd: rename lookup_clientid->set_client J. Bruce Fields
2021-01-21 18:49 ` [PATCH 5/9] nfsd: refactor lookup_clientid J. Bruce Fields
2021-01-21 18:49 ` [PATCH 6/9] nfsd: find_cpntf_state cleanup J. Bruce Fields
2021-01-21 18:49 ` [PATCH 7/9] nfsd: remove unused set_clientid argument J. Bruce Fields
2021-01-21 20:20 ` Chuck Lever
2021-01-21 20:42 ` J. Bruce Fields
2021-01-21 22:57 ` [PATCH v3 1/9] nfsd4: simplify process_lookup1 J. Bruce Fields
2021-01-21 22:57 ` [PATCH v3 2/9] nfsd: simplify process_lock J. Bruce Fields
2021-01-21 22:57 ` [PATCH v3 3/9] nfsd: simplify nfsd_renew J. Bruce Fields
2021-01-21 22:57 ` [PATCH v3 4/9] nfsd: rename lookup_clientid->set_client J. Bruce Fields
2021-01-21 22:57 ` [PATCH v3 5/9] nfsd: refactor set_client J. Bruce Fields
2021-01-21 22:57 ` [PATCH v3 6/9] nfsd: find_cpntf_state cleanup J. Bruce Fields
2021-01-21 22:57 ` [PATCH v3 7/9] nfsd: remove unused set_client argument J. Bruce Fields
2021-01-21 22:57 ` [PATCH v3 8/9] nfsd: simplify nfsd4_check_open_reclaim J. Bruce Fields
2021-01-21 22:57 ` [PATCH v3 9/9] nfsd: cstate->session->se_client -> cstate->clp J. Bruce Fields
2021-01-21 23:34 ` Chuck Lever
2021-01-21 18:49 ` [PATCH 8/9] nfsd: simplify nfsd4_check_open_reclaim J. Bruce Fields
2021-01-21 18:49 ` [PATCH 9/9] nfsd: cstate->session->se_client -> cstate->clp J. Bruce Fields
2021-01-19 22:35 ` [PATCH 5/8] nfsd: find_cpntf_state cleanup J. Bruce Fields
2021-01-19 22:35 ` [PATCH 6/8] nfsd: remove unused set_clientid argument J. Bruce Fields
2021-01-19 22:35 ` J. Bruce Fields [this message]
2021-01-19 22:35 ` [PATCH 8/8] nfsd: cstate->session->se_client -> cstate->clp J. Bruce Fields
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1611095729-31104-8-git-send-email-bfields@redhat.com \
--to=bfields@redhat.com \
--cc=chuck.lever@oracle.com \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).