open: clean up patch for nfs41_rpc_open()
nfs41_open() in open.c is no longer used for recovery, so made static and renamed to do_open(). renamed nfs41_rpc_open() back to nfs41_open() Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
parent
8ef3ec9247
commit
6878e71ec0
6 changed files with 18 additions and 24 deletions
|
|
@ -78,26 +78,28 @@ static int recover_open(
|
|||
claim.claim = CLAIM_PREVIOUS;
|
||||
claim.u.prev.delegate_type = OPEN_DELEGATE_NONE;
|
||||
|
||||
status = nfs41_rpc_open(session, &open->parent, &open->file,
|
||||
status = nfs41_open(session, &open->parent, &open->file,
|
||||
&open->owner, &claim, open->share_access, open->share_deny,
|
||||
OPEN4_NOCREATE, 0, 0, FALSE, &stateid.stateid, &delegation, NULL);
|
||||
|
||||
if (status == NFS4_OK) {
|
||||
/* update the open stateid on success */
|
||||
memcpy(&open->stateid, &stateid.stateid, sizeof(stateid4));
|
||||
|
||||
} else if (status == NFS4ERR_NO_GRACE) {
|
||||
if (status == NFS4ERR_NO_GRACE) {
|
||||
dprintf(1, "not in grace period, retrying a normal open\n");
|
||||
status = nfs41_open(open, OPEN4_NOCREATE, 0, 0, FALSE, NULL);
|
||||
|
||||
/* update the stateid arg with the new open->stateid */
|
||||
memcpy(&stateid.stateid, &open->stateid, sizeof(stateid4));
|
||||
claim.claim = CLAIM_NULL;
|
||||
claim.u.null.filename = &open->file.name;
|
||||
|
||||
status = nfs41_open(session, &open->parent, &open->file,
|
||||
&open->owner, &claim, open->share_access, open->share_deny,
|
||||
OPEN4_NOCREATE, 0, 0, FALSE, &stateid.stateid, &delegation, NULL);
|
||||
}
|
||||
if (status)
|
||||
goto out;
|
||||
|
||||
AcquireSRWLockExclusive(&open->lock);
|
||||
|
||||
/* update the open stateid on success */
|
||||
memcpy(&open->stateid, &stateid.stateid, sizeof(stateid4));
|
||||
|
||||
open->layout = NULL;
|
||||
stateid.type = STATEID_OPEN;
|
||||
stateid.open = open;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue