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",
static bool_t recover_stateid_open(IN nfs_argop4 *argop, IN stateid_arg *stateid)
union __open_claim4::@41 u
enum nfsstat4 nfs41_free_stateid(IN nfs41_session *session, IN stateid4 *stateid)
static int recover_open(IN nfs41_session *session, IN nfs41_open_state *open, IN OUT bool_t *grace)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
BOOL WINAPI SleepConditionVariableCS(PCONDITION_VARIABLE ConditionVariable, PCRITICAL_SECTION CriticalSection, DWORD Timeout)
bool_t nfs41_recover_stateid(IN nfs41_session *session, IN nfs_argop4 *argop)
GLuint GLuint GLsizei count
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)
void eprintf(LPCSTR format,...)
void nfs41_recover_sequence_flags(IN nfs41_session *session, IN uint32_t flags)
struct list_entry delegations
static int recover_delegation_open(IN nfs41_session *session, IN nfs41_delegation_state *deleg, IN OUT bool_t *grace)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
struct __open_claim4::@41::__open_claim_null null
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)
static bool_t recover_stateid_lock(IN nfs_argop4 *argop, IN stateid_arg *stateid)
unsigned char owner[NFS4_OPAQUE_LIMIT]
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)
VOID WINAPI AcquireSRWLockShared(PSRWLOCK Lock)
#define list_for_each(entry, head)
uint32_t prev_delegate_type
bool_t nfs41_recovery_start_or_wait(IN nfs41_client *client)
#define list_container(entry, type, field)
int nfs41_client_delegation_recovery(IN nfs41_client *client)
#define client_entry(pos)
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)
struct __open_claim4::@41::__open_claim_deleg_prev deleg_prev
int nfs41_recover_session(IN nfs41_session *session, IN bool_t client_state_lost)
VOID WINAPI ReleaseSRWLockExclusive(PSRWLOCK Lock)
nfs41_delegation_state * delegation
void nfs41_recovery_finish(IN nfs41_client *client)
enum open_delegation_type4 type
int nfs41_recover_client_state(IN nfs41_session *session, IN nfs41_client *client)
int nfs41_client_renew(IN nfs41_client *client)
struct __open_claim4::@41::__open_claim_prev prev
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)
static bool_t recover_stateid_delegation(IN nfs_argop4 *argop, IN stateid_arg *stateid)
#define memcpy(s1, s2, n)
void nfs41_client_state_revoked(IN nfs41_session *session, IN nfs41_client *client, IN uint32_t revoked)
__WINE_SERVER_LIST_INLINE int list_empty(const struct list *list)
stateid_arg * lock_stateid
static int recover_delegation_want(IN nfs41_session *session, IN nfs41_delegation_state *deleg, IN OUT bool_t *grace)
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
GLuint GLint GLboolean GLint GLenum access
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)
const char * nfs_opnum_to_string(int opnum)
int nfs41_close(IN nfs41_session *session, IN nfs41_path_fh *file, IN stateid_arg *stateid)
int nfs41_session_renew(IN nfs41_session *session)
VOID WINAPI WakeAllConditionVariable(PCONDITION_VARIABLE ConditionVariable)
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
static int recover_locks(IN nfs41_session *session, IN nfs41_open_state *open, IN OUT bool_t *grace)
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)
GLuint GLuint GLsizei GLenum type
static int recover_delegation(IN nfs41_session *session, IN nfs41_delegation_state *deleg, IN OUT bool_t *grace, IN OUT bool_t *want_supported)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static SERVICE_STATUS status
enum pnfs_status pnfs_file_layout_recall(IN struct __nfs41_client *client, IN const struct cb_layoutrecall_args *recall)
enum nfsstat4 nfs41_reclaim_complete(IN nfs41_session *session)
_CRTIMP int __cdecl read(_In_ int _FileHandle, _Out_writes_bytes_(_MaxCharCount) void *_DstBuf, _In_ unsigned int _MaxCharCount)
VOID WINAPI ReleaseSRWLockShared(PSRWLOCK Lock)
VOID WINAPI AcquireSRWLockExclusive(PSRWLOCK Lock)