diff options
author | J. Bruce Fields <bfields@redhat.com> | 2011-10-12 20:44:20 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2011-10-17 17:33:51 -0400 |
commit | bcf130f9dfbaccf91376a44b18f51ed8007840d6 (patch) | |
tree | 10968f17eca54e8316936763299694d43d1b2be8 /fs/nfsd | |
parent | 3557e43b8f78e5c2347bab31626fdb4d09220ae7 (diff) |
nfsd4: simplify process_open1 logic
No change in behavior.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4state.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index d90461eb9368..62aa91ae278b 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -2506,7 +2506,6 @@ nfsd4_process_open1(struct nfsd4_compound_state *cstate, | |||
2506 | struct nfs4_client *clp = NULL; | 2506 | struct nfs4_client *clp = NULL; |
2507 | unsigned int strhashval; | 2507 | unsigned int strhashval; |
2508 | struct nfs4_openowner *oo = NULL; | 2508 | struct nfs4_openowner *oo = NULL; |
2509 | __be32 status; | ||
2510 | 2509 | ||
2511 | if (STALE_CLIENTID(&open->op_clientid)) | 2510 | if (STALE_CLIENTID(&open->op_clientid)) |
2512 | return nfserr_stale_clientid; | 2511 | return nfserr_stale_clientid; |
@@ -2515,30 +2514,25 @@ nfsd4_process_open1(struct nfsd4_compound_state *cstate, | |||
2515 | oo = find_openstateowner_str(strhashval, open); | 2514 | oo = find_openstateowner_str(strhashval, open); |
2516 | open->op_openowner = oo; | 2515 | open->op_openowner = oo; |
2517 | if (!oo) { | 2516 | if (!oo) { |
2518 | /* Make sure the client's lease hasn't expired. */ | ||
2519 | clp = find_confirmed_client(clientid); | 2517 | clp = find_confirmed_client(clientid); |
2520 | if (clp == NULL) | 2518 | if (clp == NULL) |
2521 | return nfserr_expired; | 2519 | return nfserr_expired; |
2522 | goto renew; | 2520 | goto new_owner; |
2523 | } | 2521 | } |
2524 | if (!(oo->oo_flags & NFS4_OO_CONFIRMED)) { | 2522 | if (!(oo->oo_flags & NFS4_OO_CONFIRMED)) { |
2525 | /* Replace unconfirmed owners without checking for replay. */ | 2523 | /* Replace unconfirmed owners without checking for replay. */ |
2526 | clp = oo->oo_owner.so_client; | 2524 | clp = oo->oo_owner.so_client; |
2527 | release_openowner(oo); | 2525 | release_openowner(oo); |
2528 | open->op_openowner = NULL; | 2526 | open->op_openowner = NULL; |
2529 | goto renew; | 2527 | goto new_owner; |
2530 | } | ||
2531 | status = nfsd4_check_seqid(cstate, &oo->oo_owner, open->op_seqid); | ||
2532 | if (status) | ||
2533 | return status; | ||
2534 | renew: | ||
2535 | if (open->op_openowner == NULL) { | ||
2536 | oo = alloc_init_open_stateowner(strhashval, clp, open); | ||
2537 | if (oo == NULL) | ||
2538 | return nfserr_jukebox; | ||
2539 | open->op_openowner = oo; | ||
2540 | } | 2528 | } |
2541 | list_del_init(&oo->oo_close_lru); | 2529 | list_del_init(&oo->oo_close_lru); |
2530 | return nfsd4_check_seqid(cstate, &oo->oo_owner, open->op_seqid); | ||
2531 | new_owner: | ||
2532 | oo = alloc_init_open_stateowner(strhashval, clp, open); | ||
2533 | if (oo == NULL) | ||
2534 | return nfserr_jukebox; | ||
2535 | open->op_openowner = oo; | ||
2542 | return nfs_ok; | 2536 | return nfs_ok; |
2543 | } | 2537 | } |
2544 | 2538 | ||