nfsd: Convert nfsd4_process_open1() to work with lookup_clientid()
...and have alloc_init_open_stateowner just use the cstate->clp pointer instead of passing in a clp separately. This allows us to use the cached nfs4_client pointer in the cstate instead of having to look it up again. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Jeff Layton <jlayton@primarydata.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
parent
4b24ca7d30
commit
13d6f66b08
@ -2768,10 +2768,10 @@ static void hash_openowner(struct nfs4_openowner *oo, struct nfs4_client *clp, u
|
|||||||
}
|
}
|
||||||
|
|
||||||
static struct nfs4_openowner *
|
static struct nfs4_openowner *
|
||||||
alloc_init_open_stateowner(unsigned int strhashval, struct nfs4_client *clp,
|
alloc_init_open_stateowner(unsigned int strhashval, struct nfsd4_open *open,
|
||||||
struct nfsd4_open *open,
|
|
||||||
struct nfsd4_compound_state *cstate)
|
struct nfsd4_compound_state *cstate)
|
||||||
{
|
{
|
||||||
|
struct nfs4_client *clp = cstate->clp;
|
||||||
struct nfs4_openowner *oo;
|
struct nfs4_openowner *oo;
|
||||||
|
|
||||||
oo = alloc_stateowner(openowner_slab, &open->op_owner, clp);
|
oo = alloc_stateowner(openowner_slab, &open->op_owner, clp);
|
||||||
@ -3054,10 +3054,10 @@ nfsd4_process_open1(struct nfsd4_compound_state *cstate,
|
|||||||
oo = find_openstateowner_str(strhashval, open, cstate->minorversion, nn);
|
oo = find_openstateowner_str(strhashval, open, cstate->minorversion, nn);
|
||||||
open->op_openowner = oo;
|
open->op_openowner = oo;
|
||||||
if (!oo) {
|
if (!oo) {
|
||||||
clp = find_confirmed_client(clientid, cstate->minorversion,
|
status = lookup_clientid(clientid, cstate, nn);
|
||||||
nn);
|
if (status)
|
||||||
if (clp == NULL)
|
return status;
|
||||||
return nfserr_expired;
|
clp = cstate->clp;
|
||||||
goto new_owner;
|
goto new_owner;
|
||||||
}
|
}
|
||||||
if (!(oo->oo_flags & NFS4_OO_CONFIRMED)) {
|
if (!(oo->oo_flags & NFS4_OO_CONFIRMED)) {
|
||||||
@ -3073,7 +3073,7 @@ nfsd4_process_open1(struct nfsd4_compound_state *cstate,
|
|||||||
clp = oo->oo_owner.so_client;
|
clp = oo->oo_owner.so_client;
|
||||||
goto alloc_stateid;
|
goto alloc_stateid;
|
||||||
new_owner:
|
new_owner:
|
||||||
oo = alloc_init_open_stateowner(strhashval, clp, open, cstate);
|
oo = alloc_init_open_stateowner(strhashval, open, cstate);
|
||||||
if (oo == NULL)
|
if (oo == NULL)
|
||||||
return nfserr_jukebox;
|
return nfserr_jukebox;
|
||||||
open->op_openowner = oo;
|
open->op_openowner = oo;
|
||||||
|
Loading…
Reference in New Issue
Block a user