89#define open_entry(pos) list_container(pos, nfs41_open_state, client_entry)
105 if (
open->delegation.state == deleg) {
126#define lock_entry(pos) list_container(pos, nfs41_lock_state, open_entry)
183 if (
lock->delegated) {
185 lock_out->offset =
lock->offset;
186 lock_out->length =
lock->length;
187 lock_out->exclusive =
lock->exclusive;
188 lock_out->id =
lock->id;
228 if (
open->locks.stateid.seqid) {
250 if (
open->locks.stateid.seqid == 0) {
262#pragma warning (disable : 4706)
274 if (deleg->srv_open) {
278 DWORD inbuf_len =
sizeof(
HANDLE), outbuf_len, dstatus;
280 dprintf(1,
"delegation_return: making a downcall for srv_open=%x\n",
285 eprintf(
"delegation_return: Unable to open downcall pipe %d\n",
320 &deleg->file, &stateid, try_recovery);
347 if (delegation->recalled) {
377#define deleg_entry(pos) list_container(pos, nfs41_delegation_state, client_entry)
489#ifdef DELEGATION_RETURN_ON_CONFLICT
504 dprintf(1,
"nfs41_delegate_open: updating srv_open from %x to %x\n",
526 state->delegation.state = deleg;
558 if (
open->delegation.reclaim) {
562 }
while (
open->delegation.reclaim);
566 open->delegation.reclaim = 1;
580 claim.
u.
deleg_cur.delegate_stateid = &deleg_stateid;
584 &
open->owner, &claim,
open->share_access,
open->share_deny,
598 open->delegation.reclaim = 0;
605 eprintf(
"nfs41_delegation_to_open(%p) failed with %s\n",
619 dprintf(1,
"nfs41_delegation_remove_srvopen: removing reference to "
628#ifdef DELEGATION_RETURN_ON_CONFLICT
713 dprintf(2,
"--> nfs41_delegation_recall()\n");
744 eprintf(
"nfs41_delegation_recall() failed to allocate arguments\n");
751 args->delegation = deleg;
757 eprintf(
"nfs41_delegation_recall() failed to start thread\n");
762 dprintf(
DGLVL,
"<-- nfs41_delegation_recall() returning %s\n",
779 if (lhs->
len != rhs->
len)
return -1;
793 dprintf(2,
"--> nfs41_delegation_getattr()\n");
822 dprintf(
DGLVL,
"<-- nfs41_delegation_getattr() returning %s\n",
849 if (deleg->revoked) {
852 }
else if (deleg->state.recalled) {
922 if (
state->ref_count > 1)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
#define InterlockedIncrement
#define InterlockedDecrement
static void list_remove(struct list_entry *entry)
#define list_container(entry, type, field)
#define list_for_each(entry, head)
#define list_for_each_tmp(entry, tmp, head)
int(* list_compare_fn)(const struct list_entry *, const void *)
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
static struct list_entry * list_search(const struct list_entry *head, const void *value, list_compare_fn compare)
static void list_init(struct list_entry *head)
void path_fh_init(OUT nfs41_path_fh *file, IN nfs41_abs_path *path)
bool_t last_component(IN const char *path, IN const char *path_end, OUT nfs41_component *component)
void get_nfs_time(OUT nfstime4 *nfs_time)
int safe_write(unsigned char **pos, uint32_t *remaining, void *src, uint32_t src_len)
void fh_copy(OUT nfs41_fh *dst, IN const nfs41_fh *src)
void abs_path_copy(OUT nfs41_abs_path *dst, IN const nfs41_abs_path *src)
void eprintf(LPCSTR format,...)
const char * nfs_error_string(int status)
static nfs41_open_state * deleg_open_find(IN struct client_state *state, IN const nfs41_delegation_state *deleg)
static int delegation_flush_locks(IN nfs41_open_state *open, IN bool_t try_recovery)
static int deleg_file_cmp(const struct list_entry *entry, const void *value)
int nfs41_delegation_getattr(IN nfs41_client *client, IN const nfs41_fh *fh, IN const bitmap4 *attr_request, OUT nfs41_file_info *info)
void nfs41_client_delegation_free(IN nfs41_client *client)
static int delegation_truncate(IN nfs41_delegation_state *deleg, IN nfs41_client *client, IN stateid_arg *stateid, IN nfs41_file_info *info)
static bool_t delegation_compatible(IN enum open_delegation_type4 type, IN uint32_t create, IN uint32_t access, IN uint32_t deny)
int nfs41_delegation_to_open(IN nfs41_open_state *open, IN bool_t try_recovery)
static int deleg_stateid_cmp(const struct list_entry *entry, const void *value)
static void delegation_remove(IN nfs41_client *client, IN nfs41_delegation_state *deleg)
static int delegation_return(IN nfs41_client *client, IN nfs41_delegation_state *deleg, IN bool_t truncate, IN bool_t try_recovery)
void nfs41_delegation_deref(IN nfs41_delegation_state *state)
static unsigned int WINAPI delegation_recall_thread(void *args)
static int deleg_fh_cmp(const struct list_entry *entry, const void *value)
int nfs41_delegate_open(IN nfs41_open_state *state, IN uint32_t create, IN OPTIONAL nfs41_file_info *createattrs, OUT nfs41_file_info *info)
int nfs41_delegation_return(IN nfs41_session *session, IN nfs41_path_fh *file, IN enum open_delegation_type4 access, IN bool_t truncate)
int nfs41_client_delegation_recovery(IN nfs41_client *client)
int nfs41_delegation_recall(IN nfs41_client *client, IN nfs41_fh *fh, IN const stateid4 *stateid, IN bool_t truncate)
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 int delegation_create(IN const nfs41_path_fh *parent, IN const nfs41_path_fh *file, IN const open_delegation4 *delegation, OUT nfs41_delegation_state **deleg_out)
static void deleg_lock_update(IN nfs41_open_state *open, IN const nfs41_lock_state *source)
void nfs41_delegation_ref(IN nfs41_delegation_state *state)
static bool_t has_delegated_locks(IN nfs41_open_state *open)
static int open_deleg_cmp(const struct list_entry *entry, const void *value)
int nfs41_client_delegation_return_lru(IN nfs41_client *client)
static int delegation_find(IN nfs41_client *client, IN const void *value, IN list_compare_fn cmp, OUT nfs41_delegation_state **deleg_out)
void nfs41_delegation_remove_srvopen(IN nfs41_session *session, IN nfs41_path_fh *file)
static bool_t deleg_lock_find(IN nfs41_open_state *open, OUT nfs41_lock_state *lock_out)
static int delegation_recovery_status(IN nfs41_delegation_state *deleg)
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
#define INVALID_HANDLE_VALUE
VOID WINAPI ReleaseSRWLockShared(PSRWLOCK Lock)
VOID WINAPI AcquireSRWLockExclusive(PSRWLOCK Lock)
VOID WINAPI AcquireSRWLockShared(PSRWLOCK Lock)
VOID WINAPI ReleaseSRWLockExclusive(PSRWLOCK Lock)
VOID WINAPI InitializeSRWLock(PSRWLOCK Lock)
VOID WINAPI WakeAllConditionVariable(PCONDITION_VARIABLE ConditionVariable)
BOOL WINAPI SleepConditionVariableSRW(PCONDITION_VARIABLE ConditionVariable, PSRWLOCK Lock, DWORD Timeout, ULONG Flags)
VOID WINAPI InitializeConditionVariable(PCONDITION_VARIABLE ConditionVariable)
GLuint GLuint GLsizei GLenum type
GLuint GLuint GLsizei count
GLuint GLsizei GLsizei * length
GLuint GLint GLboolean GLint GLenum access
#define memcpy(s1, s2, n)
static const struct access_res create[16]
#define cmp(status, error)
int nfs41_attr_cache_lookup(IN struct nfs41_name_cache *cache, IN uint64_t fileid, OUT nfs41_file_info *info_out)
static __inline struct nfs41_name_cache * client_name_cache(IN nfs41_client *client)
void nfs41_root_ref(IN nfs41_root *root)
void nfs41_root_deref(IN nfs41_root *root)
#define client_entry(pos)
static __inline void nfs41_superblock_supported_attrs(IN const nfs41_superblock *superblock, IN OUT bitmap4 *attrs)
void nfs41_open_state_deref(IN nfs41_open_state *state)
void nfs41_open_state_ref(IN nfs41_open_state *state)
@ FATTR4_WORD1_TIME_CREATE
@ FATTR4_WORD1_TIME_MODIFY_SET
#define NFS4_STATEID_OTHER
#define IOCTL_NFS41_INVALCACHE
#define NFS41_USER_DEVICE_NAME_A
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)
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)
int nfs41_delegreturn(IN nfs41_session *session, IN nfs41_path_fh *file, IN stateid_arg *stateid, IN bool_t try_recovery)
int nfs41_setattr(IN nfs41_session *session, IN nfs41_path_fh *file, IN stateid_arg *stateid, IN nfs41_file_info *info)
int nfs41_delegpurge(IN nfs41_session *session)
@ OPEN4_SHARE_ACCESS_WRITE
_CRTIMP uintptr_t __cdecl _beginthreadex(_In_opt_ void *_Security, _In_ unsigned _StackSize, _In_ unsigned(__stdcall *_StartAddress)(void *), _In_opt_ void *_ArgList, _In_ unsigned _InitFlag, _Out_opt_ unsigned *_ThrdAddr)
PULONG MinorVersion OPTIONAL
struct __nfs41_root * root
enum delegation_status status
struct __nfs41_superblock * superblock
unsigned char fh[NFS4_FHSIZE]
struct __open_claim4::@44::__open_claim_deleg_cur deleg_cur
union __open_claim4::@44 u
enum open_delegation_type4 type
unsigned char other[NFS4_STATEID_OTHER]
nfs41_delegation_state * delegation
nfs41_delegation_state * delegation
DWORD WINAPI GetLastError(void)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)