nfsd: simplify nfsd4_check_open_reclaim
authorJ. Bruce Fields <bfields@redhat.com>
Thu, 21 Jan 2021 22:57:44 +0000 (17:57 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Thu, 28 Jan 2021 15:55:37 +0000 (10:55 -0500)
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>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4proc.c
fs/nfsd/nfs4state.c
fs/nfsd/state.h

index 8273a99359d1de0e4911d09963aa276d63249283..21d35b0339e6d5f995e17be30bcf5946e4176d0b 100644 (file)
@@ -428,8 +428,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;
index 677586d9169aaeeaf8bbe9c10434f4e949c5d23d..e55c779dee5f18ffe6542cf41d260e07877718c7 100644 (file)
@@ -7222,25 +7222,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_client(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;
index 9eae11a9d21caaa44a00e2b628856ac6afce2788..73deea35316994fae5473dd2c14138ad5811405b 100644 (file)
@@ -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 *);