41 if (!
client->recovery.in_recovery) {
42 dprintf(1,
"Entering recovery mode for client %llu\n",
client->clnt_id);
46 dprintf(1,
"Waiting for recovery of client %llu\n",
client->clnt_id);
47 while (
client->recovery.in_recovery)
50 dprintf(1,
"Woke up after recovery of client %llu\n",
client->clnt_id);
61 dprintf(1,
"Finished recovery for client %llu\n",
client->clnt_id);
81 client_state_lost =
TRUE;
84 goto restart_recovery;
89 }
else if (client_state_lost) {
93 goto restart_recovery;
111 if (revoked == 0 && restarted == 0)
124 }
else if (restarted) {
151 claim.
u.
prev.delegate_type = delegation->type;
177 stateid, delegation,
NULL);
197 stateid, delegation,
NULL);
213 if (
open->delegation.state) {
237 &stateid, &delegation);
247 &stateid, &delegation);
258 if (
open->delegation.state) {
265 eprintf(
"recover_open() got delegation type %u, "
275 &delegation,
FALSE, &
open->delegation.state);
330 open->locks.stateid.seqid = 0;
349 delegation.
type = deleg->state.type;
363 want_flags,
FALSE, &delegation);
375 want_flags,
FALSE, &delegation);
384 eprintf(
"recover_delegation_want() got delegation type %u, "
385 "expected %u\n", delegation.
type, deleg->state.type);
388 deleg->revoked =
FALSE;
410 delegation.
type = deleg->state.type;
443 eprintf(
"recover_delegation_open() got delegation type %u, "
444 "expected %u\n", delegation.
type, deleg->state.type);
447 deleg->revoked =
FALSE;
481 *want_supported =
FALSE;
526 deleg, &grace, &want_supported);
571 if (stateids ==
NULL)
574 if (statuses ==
NULL)
600 if (
open->locks.stateid.seqid) {
609 if (
open->layout->stateid.seqid) {
621 *stateids_out = stateids;
622 *statuses_out = statuses;
660 opens, &stateids, &statuses);
690 && stateids[
i].delegation->revoked)
692 &grace, &want_supported);
738 lock->locker.new_lock_owner = 1;
739 lock->locker.u.open_owner.open_stateid = stateid;
740 lock->locker.u.open_owner.lock_owner = &stateid->open->owner;
741 source = &stateid->open->stateid;
761 if (argop->op ==
OP_OPEN && stateid->open->do_close) {
764 }
else if (stateid->open->delegation.state) {
775 }
else if (stateid->delegation) {
798 stateid =
open->claim->u.deleg_cur.delegate_stateid;
800 stateid =
open->claim->u.deleg_cur_fh.delegate_stateid;
803 stateid =
close->stateid;
804 }
else if (argop->op ==
OP_READ) {
806 stateid =
read->stateid;
809 stateid =
write->stateid;
810 }
else if (argop->op ==
OP_LOCK) {
812 if (
lock->locker.new_lock_owner)
813 stateid =
lock->locker.u.open_owner.open_stateid;
815 stateid =
lock->locker.u.lock_owner.lock_stateid;
834 while (
session->client->recovery.in_recovery)
839 switch (stateid->
type) {
850 eprintf(
"%s can't recover stateid type %u\n",
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
#define list_container(entry, type, field)
#define list_for_each(entry, head)
static int list_empty(struct list_entry *head)
static void list_init(struct list_entry *head)
bool_t nfs41_recover_stateid(IN nfs41_session *session, IN nfs_argop4 *argop)
void nfs41_client_state_revoked(IN nfs41_session *session, IN nfs41_client *client, IN uint32_t revoked)
static uint32_t stateid_array(IN struct list_entry *delegations, IN struct list_entry *opens, OUT stateid_arg **stateids_out, OUT uint32_t **statuses_out)
int nfs41_recover_client_state(IN nfs41_session *session, IN nfs41_client *client)
void nfs41_recovery_finish(IN nfs41_client *client)
static int recover_delegation(IN nfs41_session *session, IN nfs41_delegation_state *deleg, IN OUT bool_t *grace, IN OUT bool_t *want_supported)
static int recover_locks(IN nfs41_session *session, IN nfs41_open_state *open, IN OUT bool_t *grace)
static int recover_delegation_want(IN nfs41_session *session, IN nfs41_delegation_state *deleg, IN OUT bool_t *grace)
static int recover_open_no_grace(IN nfs41_session *session, IN nfs41_path_fh *parent, IN nfs41_path_fh *file, IN state_owner4 *owner, IN uint32_t access, IN uint32_t deny, OUT stateid4 *stateid, OUT open_delegation4 *delegation)
static int recover_open(IN nfs41_session *session, IN nfs41_open_state *open, IN OUT bool_t *grace)
int nfs41_recover_session(IN nfs41_session *session, IN bool_t client_state_lost)
bool_t nfs41_recovery_start_or_wait(IN nfs41_client *client)
static int recover_delegation_open(IN nfs41_session *session, IN nfs41_delegation_state *deleg, IN OUT bool_t *grace)
static int recover_open_grace(IN nfs41_session *session, IN nfs41_path_fh *parent, IN nfs41_path_fh *file, IN state_owner4 *owner, IN uint32_t access, IN uint32_t deny, OUT stateid4 *stateid, OUT open_delegation4 *delegation)
static bool_t recover_stateid_delegation(IN nfs_argop4 *argop, IN stateid_arg *stateid)
static bool_t recover_stateid_open(IN nfs_argop4 *argop, IN stateid_arg *stateid)
void nfs41_recover_sequence_flags(IN nfs41_session *session, IN uint32_t flags)
static bool_t recover_stateid_lock(IN nfs_argop4 *argop, IN stateid_arg *stateid)
void eprintf(LPCSTR format,...)
const char * nfs_opnum_to_string(int opnum)
int nfs41_client_delegation_recovery(IN nfs41_client *client)
int nfs41_delegation_granted(IN nfs41_session *session, IN nfs41_path_fh *parent, IN nfs41_path_fh *file, IN open_delegation4 *delegation, IN bool_t try_recovery, OUT nfs41_delegation_state **deleg_out)
static const WCHAR empty[]
VOID WINAPI ReleaseSRWLockShared(PSRWLOCK Lock)
VOID WINAPI AcquireSRWLockExclusive(PSRWLOCK Lock)
VOID WINAPI AcquireSRWLockShared(PSRWLOCK Lock)
VOID WINAPI ReleaseSRWLockExclusive(PSRWLOCK Lock)
BOOL WINAPI SleepConditionVariableCS(PCONDITION_VARIABLE ConditionVariable, PCRITICAL_SECTION CriticalSection, DWORD Timeout)
VOID WINAPI WakeAllConditionVariable(PCONDITION_VARIABLE ConditionVariable)
GLuint GLuint GLsizei GLenum type
GLuint GLuint GLsizei count
GLuint GLint GLboolean GLint GLenum access
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define memcpy(s1, s2, n)
#define client_entry(pos)
int nfs41_session_renew(IN nfs41_session *session)
int nfs41_client_renew(IN nfs41_client *client)
int nfs41_open(IN nfs41_session *session, IN nfs41_path_fh *parent, IN nfs41_path_fh *file, IN state_owner4 *owner, IN open_claim4 *claim, IN uint32_t allow, IN uint32_t deny, IN uint32_t create, IN uint32_t how_mode, IN OPTIONAL nfs41_file_info *createattrs, IN bool_t try_recovery, OUT stateid4 *stateid, OUT open_delegation4 *delegation, OUT OPTIONAL nfs41_file_info *info)
enum nfsstat4 nfs41_free_stateid(IN nfs41_session *session, IN stateid4 *stateid)
int nfs41_lock(IN nfs41_session *session, IN nfs41_path_fh *file, IN state_owner4 *owner, IN uint32_t type, IN uint64_t offset, IN uint64_t length, IN bool_t reclaim, IN bool_t try_recovery, IN OUT stateid_arg *stateid)
enum nfsstat4 nfs41_test_stateid(IN nfs41_session *session, IN stateid_arg *stateid_array, IN uint32_t count, OUT uint32_t *status_array)
enum nfsstat4 nfs41_want_delegation(IN nfs41_session *session, IN nfs41_path_fh *file, IN deleg_claim4 *claim, IN uint32_t want, IN bool_t try_recovery, OUT open_delegation4 *delegation)
enum nfsstat4 nfs41_reclaim_complete(IN nfs41_session *session)
int nfs41_close(IN nfs41_session *session, IN nfs41_path_fh *file, IN stateid_arg *stateid)
@ OPEN4_SHARE_ACCESS_WANT_READ_DELEG
@ OPEN4_SHARE_ACCESS_WRITE
@ OPEN4_SHARE_ACCESS_WANT_WRITE_DELEG
@ OPEN4_SHARE_ACCESS_READ
@ SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED
@ SEQ4_STATUS_RESTART_RECLAIM_NEEDED
@ SEQ4_STATUS_ADMIN_STATE_REVOKED
@ SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED
@ SEQ4_STATUS_RECALLABLE_STATE_REVOKED
enum pnfs_status pnfs_file_layout_recall(IN struct __nfs41_client *client, IN const struct cb_layoutrecall_args *recall)
uint32_t prev_delegate_type
stateid_arg * lock_stateid
struct __open_claim4::@44::__open_claim_null null
struct __open_claim4::@44::__open_claim_prev prev
struct __open_claim4::@44::__open_claim_deleg_prev deleg_prev
union __open_claim4::@44 u
enum open_delegation_type4 type
unsigned char owner[NFS4_OPAQUE_LIMIT]
nfs41_delegation_state * delegation
struct list_entry delegations
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)