33#define MAX_WRITE_RETRIES 6
37 {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}};
51 dprintf(1,
"parsing %s len=%lu offset=%llu buf=%p\n",
67 unsigned char *
p =
args->buffer;
71 if (to_rcv > maxreadsize)
72 dprintf(1,
"handle_nfs41_read: reading %d in chunks of %d\n",
79 p, &bytes_read, &
eof);
92 args->offset += bytes_read;
142 ULONG pnfs_bytes_read = 0;
147#ifdef PNFS_ENABLE_READ
154 pnfs_bytes_read =
args->out_len;
157 args->offset += pnfs_bytes_read;
158 args->buffer += pnfs_bytes_read;
159 args->len -= pnfs_bytes_read;
165 args->out_len += pnfs_bytes_read;
197 if (to_send > maxwritesize)
198 dprintf(1,
"handle_nfs41_write: writing %d in chunks of %d\n",
199 to_send, maxwritesize);
205 args->offset + reloffset, stable, &bytes_written, &verf, &
info);
209 to_send -= bytes_written;
210 len += bytes_written;
211 reloffset += bytes_written;
217 if (retries--)
goto retry_write;
218 goto out_verify_failed;
222 dprintf(1,
"sending COMMIT for offset=%d and len=%d\n",
args->offset,
len);
228 if (retries--)
goto retry_write;
229 goto out_verify_failed;
283#ifdef PNFS_ENABLE_WRITE
286 pnfs_bytes_written =
args->out_len;
289 args->offset += pnfs_bytes_written;
290 args->buffer += pnfs_bytes_written;
291 args->len -= pnfs_bytes_written;
300 args->out_len += pnfs_bytes_written;
static int marshall_rw(unsigned char *buffer, uint32_t *length, nfs41_upcall *upcall)
static int handle_write(nfs41_upcall *upcall)
const stateid4 special_read_stateid
#define MAX_WRITE_RETRIES
static int read_from_pnfs(IN nfs41_upcall *upcall, IN stateid_arg *stateid)
static int write_to_mds(IN nfs41_upcall *upcall, IN stateid_arg *stateid)
static int handle_read(nfs41_upcall *upcall)
static int write_to_pnfs(IN nfs41_upcall *upcall, IN stateid_arg *stateid)
static int parse_rw(unsigned char *buffer, uint32_t length, nfs41_upcall *upcall)
const nfs41_upcall_op nfs41_op_write
const nfs41_upcall_op nfs41_op_read
static int read_from_mds(IN nfs41_upcall *upcall, IN stateid_arg *stateid)
int safe_write(unsigned char **pos, uint32_t *remaining, void *src, uint32_t src_len)
int safe_read(unsigned char **pos, uint32_t *remaining, void *dest, uint32_t dest_len)
int nfs_to_windows_error(int status, int default_error)
uint32_t max_read_size(IN const nfs41_session *session, IN const nfs41_fh *fh)
bool_t verify_write(IN nfs41_write_verf *verf, IN OUT enum stable_how4 *stable)
bool_t verify_commit(IN nfs41_write_verf *verf)
uint32_t max_write_size(IN const nfs41_session *session, IN const nfs41_fh *fh)
const char * opcode2string(DWORD opcode)
#define ERROR_NOT_SUPPORTED
GLuint GLsizei GLsizei * length
#define memcpy(s1, s2, n)
static __inline void nfs41_superblock_getattr_mask(IN const nfs41_superblock *superblock, OUT bitmap4 *attrs)
void nfs41_open_stateid_arg(IN nfs41_open_state *state, OUT struct __stateid_arg *arg)
nfs41_updowncall_list upcall
int nfs41_read(IN nfs41_session *session, IN nfs41_path_fh *file, IN stateid_arg *stateid, IN uint64_t offset, IN uint32_t count, OUT unsigned char *data_out, OUT uint32_t *data_len_out, OUT bool_t *eof_out)
int nfs41_getattr(IN nfs41_session *session, IN OPTIONAL nfs41_path_fh *file, IN bitmap4 *attr_request, OUT nfs41_file_info *info)
int nfs41_write(IN nfs41_session *session, IN nfs41_path_fh *file, IN stateid_arg *stateid, IN unsigned char *data, IN uint32_t data_len, IN uint64_t offset, IN enum stable_how4 stable, OUT uint32_t *bytes_written, OUT nfs41_write_verf *verf, OUT nfs41_file_info *cinfo)
int nfs41_commit(IN nfs41_session *session, IN nfs41_path_fh *file, IN uint64_t offset, IN uint32_t count, IN bool_t do_getattr, OUT nfs41_write_verf *verf, OUT nfs41_file_info *cinfo)
enum pnfs_status pnfs_write(IN struct __nfs41_root *root, IN struct __nfs41_open_state *state, IN struct __stateid_arg *stateid, IN pnfs_layout_state *layout, IN uint64_t offset, IN uint64_t length, IN unsigned char *buffer, OUT ULONG *len_out, OUT nfs41_file_info *cinfo)
enum pnfs_status pnfs_layout_state_open(IN struct __nfs41_open_state *state, OUT pnfs_layout_state **layout_out)
enum pnfs_status pnfs_read(IN struct __nfs41_root *root, IN struct __nfs41_open_state *state, IN struct __stateid_arg *stateid, IN pnfs_layout_state *layout, IN uint64_t offset, IN uint64_t length, OUT unsigned char *buffer_out, OUT ULONG *len_out)
_Check_return_ _CRTIMP int __cdecl __cdecl eof(_In_ int _FileHandle)
#define ERROR_NET_WRITE_FAULT
#define ERROR_WRITE_FAULT