#include <windows.h>
#include <stdio.h>
#include "daemon_debug.h"
#include "delegation.h"
#include "nfs41_ops.h"
#include "upcall.h"
#include "util.h"
Go to the source code of this file.
|
static void | lock_stateid_arg (IN nfs41_open_state *state, OUT stateid_arg *arg) |
|
static void | lock_stateid_update (OUT nfs41_open_state *state, IN const stateid4 *stateid) |
|
static void | open_lock_add (IN nfs41_open_state *open, IN const stateid_arg *stateid, IN nfs41_lock_state *lock) |
|
static bool_t | open_lock_delegate (IN nfs41_open_state *open, IN nfs41_lock_state *lock) |
|
static int | lock_range_cmp (const struct list_entry *entry, const void *value) |
|
static int | open_unlock_delegate (IN nfs41_open_state *open, IN const nfs41_lock_state *input) |
|
static void | open_unlock_remove (IN nfs41_open_state *open, IN const stateid_arg *stateid, IN const nfs41_lock_state *input) |
|
static int | parse_lock (unsigned char *buffer, uint32_t length, nfs41_upcall *upcall) |
|
static __inline uint32_t | get_lock_type (BOOLEAN exclusive, BOOLEAN blocking) |
|
static int | handle_lock (nfs41_upcall *upcall) |
|
static void | cancel_lock (IN nfs41_upcall *upcall) |
|
static int | parse_unlock (unsigned char *buffer, uint32_t length, nfs41_upcall *upcall) |
|
static int | handle_unlock (nfs41_upcall *upcall) |
|
◆ LKLVL
◆ lock_entry
◆ cancel_lock()
Definition at line 266 of file lock.c.
267{
273
274 dprintf(1,
"--> cancel_lock()\n");
275
276
277
280
283
284
288
291
294
297
301}
static int open_unlock_delegate(IN nfs41_open_state *open, IN const nfs41_lock_state *input)
static void open_unlock_remove(IN nfs41_open_state *open, IN const stateid_arg *stateid, IN const nfs41_lock_state *input)
static void lock_stateid_arg(IN nfs41_open_state *state, OUT stateid_arg *arg)
int nfs_to_windows_error(int status, int default_error)
GLenum GLenum GLenum input
nfs41_updowncall_list upcall
int nfs41_unlock(IN nfs41_session *session, IN nfs41_path_fh *file, IN uint64_t offset, IN uint64_t length, IN OUT stateid_arg *stateid)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define ERROR_BAD_NET_RESP
◆ get_lock_type()
◆ handle_lock()
Definition at line 197 of file lock.c.
198{
205
206
207
208
209
212
213
218 }
222
223
229 }
230
231
232
236 goto out_free;
237 }
238
240
242
250 goto out_free;
251 }
252
253
256
260
261out_free:
264}
static void open_lock_add(IN nfs41_open_state *open, IN const stateid_arg *stateid, IN nfs41_lock_state *lock)
static __inline uint32_t get_lock_type(BOOLEAN exclusive, BOOLEAN blocking)
static bool_t open_lock_delegate(IN nfs41_open_state *open, IN nfs41_lock_state *lock)
const char * nfs_error_string(int status)
int nfs41_delegation_to_open(IN nfs41_open_state *open, IN bool_t try_recovery)
GLuint GLuint GLsizei GLenum type
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 const uint64_t NFS4_UINT64_MAX
DWORD WINAPI GetLastError(void)
#define ERROR_FILE_INVALID
◆ handle_unlock()
Definition at line 321 of file lock.c.
322{
327 unsigned char *
buf =
args->buf;
331
332 for (
i = 0;
i <
args->count;
i++) {
335
336
339
340
343 continue;
344
347
350
353
355 }
357}
int safe_read(unsigned char **pos, uint32_t *remaining, void *dest, uint32_t dest_len)
GLenum GLuint GLenum GLsizei const GLchar * buf
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
◆ lock_range_cmp()
◆ lock_stateid_arg()
Definition at line 35 of file lock.c.
38{
41
43 if (
state->locks.stateid.seqid) {
46 }
else if (
state->do_close) {
49 } else {
52 }
54}
VOID WINAPI ReleaseSRWLockShared(PSRWLOCK Lock)
VOID WINAPI AcquireSRWLockShared(PSRWLOCK Lock)
#define memcpy(s1, s2, n)
Referenced by cancel_lock(), handle_lock(), and handle_unlock().
◆ lock_stateid_update()
◆ open_lock_add()
Definition at line 70 of file lock.c.
74{
76
79
82
84}
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
static void lock_stateid_update(OUT nfs41_open_state *state, IN const stateid4 *stateid)
VOID WINAPI AcquireSRWLockExclusive(PSRWLOCK Lock)
VOID WINAPI ReleaseSRWLockExclusive(PSRWLOCK Lock)
Referenced by handle_lock().
◆ open_lock_delegate()
Definition at line 86 of file lock.c.
89{
91
93 if (
open->delegation.state) {
102 }
104 }
106
107 return delegated;
108}
enum delegation_status status
enum open_delegation_type4 type
Referenced by handle_lock().
◆ open_unlock_delegate()
Definition at line 121 of file lock.c.
124{
127
129
130
134 if (
lock->delegated) {
135
139 } else
141 }
142
145}
static void list_remove(struct list_entry *entry)
static struct list_entry * list_search(const struct list_entry *head, const void *value, list_compare_fn compare)
static int lock_range_cmp(const struct list_entry *entry, const void *value)
Referenced by cancel_lock(), and handle_unlock().
◆ open_unlock_remove()
◆ parse_lock()
Definition at line 169 of file lock.c.
170{
173
182
183 dprintf(1,
"parsing NFS41_LOCK: offset=0x%llx length=0x%llx exclusive=%u "
188}
GLuint GLsizei GLsizei * length
◆ parse_unlock()
Definition at line 305 of file lock.c.
306{
309
312
315
316 dprintf(1,
"parsing NFS41_UNLOCK: count=%u\n",
args->count);
319}
◆ nfs41_op_lock
Initial value:= {
}
static void cancel_lock(IN nfs41_upcall *upcall)
static int handle_lock(nfs41_upcall *upcall)
static int parse_lock(unsigned char *buffer, uint32_t length, nfs41_upcall *upcall)
Definition at line 360 of file lock.c.
◆ nfs41_op_unlock
Initial value:= {
}
static int handle_unlock(nfs41_upcall *upcall)
static int parse_unlock(unsigned char *buffer, uint32_t length, nfs41_upcall *upcall)
Definition at line 366 of file lock.c.