recovery: operations take stateid_arg instead of stateid4
operations that require a stateid now take stateid_arg for recovery information. these operations include close, setattr, lock/unlock, layoutget, and read/write (including pnfs) nfs41_open_stateid_arg() locks nfs41_open_state and copies its stateid into a stateid_arg nfs41_lock_stateid_arg() locks nfs41_open_state.last_lock and copies its stateid into a stateid_arg; if there is no lock state, it falls back to nfs41_open_stateid_arg() pnfs_read/write() now take nfs41_open_state so they can generate stateid_args Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
parent
d59d17c3b4
commit
3ecd38e414
12 changed files with 205 additions and 227 deletions
|
|
@ -94,6 +94,17 @@ void nfs41_open_state_deref(
|
|||
free(state);
|
||||
}
|
||||
|
||||
void nfs41_open_stateid_arg(
|
||||
IN nfs41_open_state *state,
|
||||
OUT stateid_arg *arg)
|
||||
{
|
||||
AcquireSRWLockShared(&state->lock);
|
||||
memcpy(&arg->stateid, &state->stateid, sizeof(stateid4));
|
||||
ReleaseSRWLockShared(&state->lock);
|
||||
arg->type = STATEID_OPEN;
|
||||
arg->open = state;
|
||||
}
|
||||
|
||||
|
||||
/* client list of associated open state */
|
||||
static void client_state_add(
|
||||
|
|
@ -491,7 +502,10 @@ static void cancel_open(IN nfs41_upcall *upcall)
|
|||
goto out; /* if handle_open() failed, the state was already freed */
|
||||
|
||||
if (state->do_close) {
|
||||
status = nfs41_close(state->session, state);
|
||||
stateid_arg stateid;
|
||||
nfs41_open_stateid_arg(state, &stateid);
|
||||
|
||||
status = nfs41_close(state->session, &state->file, &stateid);
|
||||
if (status)
|
||||
dprintf(1, "cancel_open: nfs41_close() failed with %s\n",
|
||||
nfs_error_string(status));
|
||||
|
|
@ -569,7 +583,10 @@ static int handle_close(nfs41_upcall *upcall)
|
|||
}
|
||||
|
||||
if (state->do_close) {
|
||||
status = nfs41_close(state->session, state);
|
||||
stateid_arg stateid;
|
||||
nfs41_open_stateid_arg(state, &stateid);
|
||||
|
||||
status = nfs41_close(state->session, &state->file, &stateid);
|
||||
if (status) {
|
||||
dprintf(1, "nfs41_close() failed with error %s.\n",
|
||||
nfs_error_string(status));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue