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)
static bool_t delegation_compatible(IN enum open_delegation_type4 type, IN uint32_t create, IN uint32_t access, IN uint32_t deny)
void nfs41_open_state_deref(IN nfs41_open_state *state)
static int deleg_file_cmp(const struct list_entry *entry, const void *value)
void nfs41_open_state_ref(IN nfs41_open_state *state)
int nfs41_setattr(IN nfs41_session *session, IN nfs41_path_fh *file, IN stateid_arg *stateid, IN nfs41_file_info *info)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
static int delegation_flush_locks(IN nfs41_open_state *open, IN bool_t try_recovery)
struct __nfs41_superblock * superblock
static int delegation_truncate(IN nfs41_delegation_state *deleg, IN nfs41_client *client, IN stateid_arg *stateid, IN nfs41_file_info *info)
unsigned char other[NFS4_STATEID_OTHER]
static int open_deleg_cmp(const struct list_entry *entry, const void *value)
GLuint GLuint GLsizei count
#define NFS41_USER_DEVICE_NAME_A
void nfs41_client_delegation_free(IN nfs41_client *client)
#define INVALID_HANDLE_VALUE
DWORD WINAPI GetLastError(VOID)
static void deleg_lock_update(IN nfs41_open_state *open, IN const nfs41_lock_state *source)
int nfs41_delegation_recall(IN nfs41_client *client, IN nfs41_fh *fh, IN const stateid4 *stateid, IN bool_t truncate)
void eprintf(LPCSTR format,...)
#define NFS4_STATEID_OTHER
void nfs41_delegation_deref(IN nfs41_delegation_state *state)
int nfs41_delegpurge(IN nfs41_session *session)
#define cmp(status, error)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static void delegation_remove(IN nfs41_client *client, IN nfs41_delegation_state *deleg)
_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)
void nfs41_delegation_ref(IN nfs41_delegation_state *state)
bool_t last_component(IN const char *path, IN const char *path_end, OUT nfs41_component *component)
#define IOCTL_NFS41_INVALCACHE
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
void abs_path_copy(OUT nfs41_abs_path *dst, IN const nfs41_abs_path *src)
nfs41_delegation_state * delegation
VOID WINAPI AcquireSRWLockShared(PSRWLOCK Lock)
#define list_for_each(entry, head)
GLenum GLuint GLenum GLsizei length
VOID WINAPI InitializeConditionVariable(PCONDITION_VARIABLE ConditionVariable)
union __open_claim4::@42 u
struct __open_claim4::@42::__open_claim_deleg_cur deleg_cur
#define list_container(entry, type, field)
int nfs41_client_delegation_recovery(IN nfs41_client *client)
static __inline void nfs41_superblock_supported_attrs(IN const nfs41_superblock *superblock, IN OUT bitmap4 *attrs)
void path_fh_init(OUT nfs41_path_fh *file, IN nfs41_abs_path *path)
#define client_entry(pos)
void nfs41_root_ref(IN nfs41_root *root)
static int delegation_return(IN nfs41_client *client, IN nfs41_delegation_state *deleg, IN bool_t truncate, IN bool_t try_recovery)
static nfs41_open_state * deleg_open_find(IN struct client_state *state, IN const nfs41_delegation_state *deleg)
static int delegation_find(IN nfs41_client *client, IN const void *value, IN list_compare_fn cmp, OUT nfs41_delegation_state **deleg_out)
int nfs41_delegation_to_open(IN nfs41_open_state *open, IN bool_t try_recovery)
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
VOID WINAPI ReleaseSRWLockExclusive(PSRWLOCK Lock)
static __inline struct nfs41_name_cache * client_name_cache(IN nfs41_client *client)
static int delegation_recovery_status(IN nfs41_delegation_state *deleg)
nfs41_delegation_state * delegation
int nfs41_delegation_return(IN nfs41_session *session, IN nfs41_path_fh *file, IN enum open_delegation_type4 access, IN bool_t truncate)
enum open_delegation_type4 type
int safe_write(unsigned char **pos, uint32_t *remaining, void *src, uint32_t src_len)
const char * nfs_error_string(int status)
BOOL WINAPI SleepConditionVariableSRW(PCONDITION_VARIABLE ConditionVariable, PSRWLOCK Lock, DWORD Timeout, ULONG Flags)
void fh_copy(OUT nfs41_fh *dst, IN const nfs41_fh *src)
int nfs41_delegreturn(IN nfs41_session *session, IN nfs41_path_fh *file, IN stateid_arg *stateid, IN bool_t try_recovery)
struct __nfs41_root * root
#define InterlockedDecrement
static bool_t deleg_lock_find(IN nfs41_open_state *open, OUT nfs41_lock_state *lock_out)
int(* list_compare_fn)(const struct list_entry *, const void *)
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)
#define memcpy(s1, s2, n)
static int deleg_fh_cmp(const struct list_entry *entry, const void *value)
static struct list_entry * list_search(const struct list_entry *head, const void *value, list_compare_fn compare)
static int deleg_stateid_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)
void get_nfs_time(OUT nfstime4 *nfs_time)
unsigned char fh[NFS4_FHSIZE]
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 InterlockedIncrement
IN OUT PVCB OUT PDIRENT OUT PBCB IN BOOLEAN CreateFile
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)
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)
static bool_t has_delegated_locks(IN nfs41_open_state *open)
int nfs41_delegation_getattr(IN nfs41_client *client, IN const nfs41_fh *fh, IN const bitmap4 *attr_request, OUT nfs41_file_info *info)
enum delegation_status status
VOID WINAPI WakeAllConditionVariable(PCONDITION_VARIABLE ConditionVariable)
#define list_for_each_tmp(entry, tmp, head)
VOID WINAPI InitializeSRWLock(PSRWLOCK Lock)
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
void nfs41_delegation_remove_srvopen(IN nfs41_session *session, IN nfs41_path_fh *file)
void nfs41_root_deref(IN nfs41_root *root)
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
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static const struct access_res create[16]
int nfs41_attr_cache_lookup(IN struct nfs41_name_cache *cache, IN uint64_t fileid, OUT nfs41_file_info *info_out)
static SERVICE_STATUS status
int nfs41_client_delegation_return_lru(IN nfs41_client *client)
static unsigned int WINAPI delegation_recall_thread(void *args)
VOID WINAPI ReleaseSRWLockShared(PSRWLOCK Lock)
VOID WINAPI AcquireSRWLockExclusive(PSRWLOCK Lock)
PULONG MinorVersion OPTIONAL