36#define MAX_LOOKUP_COMPONENTS 8
39#define ERROR_FILESYSTEM_ABSENT ERROR_DEVICE_REMOVED
80 args->attr_request.count = 2;
90 args->getrootattr.attr_request = &
args->attr_request;
92 res->getrootfh.fh = &
res->root.fh;
93 res->getrootattr.info = &
res->rootinfo;
95 res->referral = referral;
98 args->getattr[
i].attr_request = &
args->attr_request;
100 args->lookup[
i].name = &
res->file[
i].name;
101 res->getfh[
i].fh = &
res->file[
i].fh;
102 res->getattr[
i].info = &
res->info[
i];
167 IN const char *path_end,
179 if (parent_out) *parent_out =
NULL;
180 if (target_out) *target_out =
NULL;
193 dir->fh.fileid =
res->getrootattr.info->fileid;
204 &
res->getrootattr.obj_attributes.attrmask,
sizeof(
bitmap4));
215 }
else if (
count == 1) {
224 if (parent_out) *parent_out =
file;
235 res->referral->name.name =
args->lookup[
i].name->name;
236 res->referral->name.len =
args->lookup[
i].name->len;
245 file->fh.fileid =
res->getattr[
i].info->fileid;
253 &
res->getattr[
i].obj_attributes.attrmask,
sizeof(
bitmap4));
263 }
else if (
i ==
count-2) {
275 const uint32_t comps = (
session->fore_chan_attrs.ca_maxoperations - 4) / 3;
280 IN OUT const char **path_pos,
281 IN const char *path_end,
288 for (
i = 0;
i < max_components;
i++) {
302 IN const char *path_pos,
311 const char *path_end;
321 dir = parent_in ? parent_in : &
res.root;
324 max_components,
res.file, &
count)) {
331 if (parent_out &&
parent) {
333 parent_out->name.name = parent_out->path->path +
offset;
334 parent_out->name.len =
parent->name.len;
346 if (
dir == &
res.root && (target_out || info_out)) {
390 eprintf(
"nfs41_fs_locations() failed with %s\n",
399 eprintf(
"nfs41_root_mount_referral() failed with %d\n",
406 referral->
name.name + referral->name.len))) {
415 path_out->len = path_out->len + (
unsigned short)
strlen(rest_of_path);
418 if (session_out) *session_out =
client->session;
436 const char *path_pos, *path_end;
441 if (session_out) *session_out =
session;
451 path_pos =
path.path;
458 parent_out->fh.len = target_out->fh.len = 0;
461 &parent_out->fh, &target_out->fh, info_out, &negative);
465 if (parent_out->fh.len) {
467 if (&
parent != parent_out) {
479 &
path, path_pos, &referral, parent_out, target_out, info_out);
487 &referral, path_inout, &new_session);
494 last_component(path_inout->path, path_inout->path + path_inout->len,
499 if (session_out) *session_out = new_session;
503 parent_out, target_out, info_out, session_out);
ACPI_SIZE strlen(const char *String)
struct __nfs41_lookup_component_args nfs41_lookup_component_args
static int server_lookup(IN nfs41_session *session, IN nfs41_path_fh *dir, IN const char *path, IN const char *path_end, IN uint32_t count, IN nfs41_lookup_component_args *args, IN nfs41_lookup_component_res *res, OUT OPTIONAL nfs41_path_fh **parent_out, OUT OPTIONAL nfs41_path_fh **target_out, OUT OPTIONAL nfs41_file_info *info_out)
#define ERROR_FILESYSTEM_ABSENT
static uint32_t get_component_array(IN OUT const char **path_pos, IN const char *path_end, IN uint32_t max_components, OUT nfs41_path_fh *components, OUT uint32_t *component_count)
#define MAX_LOOKUP_COMPONENTS
static uint32_t max_lookup_components(IN const nfs41_session *session)
static int server_lookup_loop(IN nfs41_session *session, IN OPTIONAL nfs41_path_fh *parent_in, IN nfs41_abs_path *path, IN const char *path_pos, IN struct lookup_referral *referral, OUT OPTIONAL nfs41_path_fh *parent_out, OUT OPTIONAL nfs41_path_fh *target_out, OUT OPTIONAL nfs41_file_info *info_out)
static void init_component_args(IN nfs41_lookup_component_args *args, IN nfs41_lookup_component_res *res, IN nfs41_abs_path *path, IN struct lookup_referral *referral)
static int referral_resolve(IN nfs41_root *root, IN nfs41_session *session_in, IN struct lookup_referral *referral, OUT nfs41_abs_path *path_out, OUT nfs41_session **session_out)
static void referral_locations_free(IN fs_locations4 *locations)
int nfs41_lookup(IN nfs41_root *root, IN nfs41_session *session, IN OUT nfs41_abs_path *path_inout, OUT OPTIONAL nfs41_path_fh *parent_out, OUT OPTIONAL nfs41_path_fh *target_out, OUT OPTIONAL nfs41_file_info *info_out, OUT nfs41_session **session_out)
struct __nfs41_lookup_component_res nfs41_lookup_component_res
static int map_lookup_error(int status, bool_t last_component)
static int lookup_rpc(IN nfs41_session *session, IN nfs41_path_fh *dir, IN uint32_t component_count, IN nfs41_lookup_component_args *args, OUT nfs41_lookup_component_res *res)
bool_t is_last_component(IN const char *path, IN const char *path_end)
bool_t last_component(IN const char *path, IN const char *path_end, OUT nfs41_component *component)
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 path_fh_copy(OUT nfs41_path_fh *dst, IN const nfs41_path_fh *src)
int nfs_to_windows_error(int status, int default_error)
bool_t next_component(IN const char *path, IN const char *path_end, OUT nfs41_component *component)
unsigned int component_count
void eprintf(LPCSTR format,...)
const char * nfs_error_string(int status)
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)
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
__kernel_ptrdiff_t ptrdiff_t
GLuint GLuint GLsizei count
GLsizei const GLint * locations
GLenum GLenum GLuint components
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
#define location(file, line)
#define memcpy(s1, s2, n)
#define ERROR_FILE_NOT_FOUND
int nfs41_name_cache_lookup(IN struct nfs41_name_cache *cache, IN const char *path, IN const char *path_end, OUT OPTIONAL const char **remaining_path_out, OUT OPTIONAL nfs41_fh *parent_out, OUT OPTIONAL nfs41_fh *target_out, OUT OPTIONAL nfs41_file_info *info_out, OUT OPTIONAL bool_t *is_negative)
int nfs41_name_cache_insert(IN struct nfs41_name_cache *cache, IN const char *path, IN const nfs41_component *name, IN OPTIONAL const nfs41_fh *fh, IN OPTIONAL const nfs41_file_info *info, IN OPTIONAL const change_info4 *cinfo, IN enum open_delegation_type4 delegation)
static __inline struct nfs41_name_cache * session_name_cache(IN nfs41_session *session)
int nfs41_root_mount_referral(IN nfs41_root *root, IN const fs_locations4 *locations, OUT const fs_location4 **loc_out, OUT nfs41_client **client_out)
void nfs41_session_sequence(struct __nfs41_sequence_args *args, nfs41_session *session, bool_t cachethis)
int nfs41_superblock_for_fh(IN nfs41_session *session, IN const nfs41_fsid *fsid, IN const nfs41_fh *parent OPTIONAL, OUT nfs41_path_fh *file)
void compound_init(nfs41_compound *compound, nfs_argop4 *argops, nfs_resop4 *resops, const char *tag)
int compound_encode_send_decode(nfs41_session *session, nfs41_compound *compound, bool_t try_recovery)
void compound_add_op(nfs41_compound *compound, uint32_t opnum, void *arg, void *res)
int compound_error(int status)
#define NFS41_MAX_PATH_LEN
@ FATTR4_WORD1_TIME_CREATE
@ FATTR4_WORD1_TIME_MODIFY
@ FATTR4_WORD1_TIME_ACCESS
#define NFS4_OPAQUE_LIMIT
enum nfsstat4 nfs41_fs_locations(IN nfs41_session *session, IN nfs41_path_fh *parent, IN const nfs41_component *name, OUT fs_locations4 *locations)
static void server_start(server_params *par)
PULONG MinorVersion OPTIONAL
STRSAFEAPI StringCchCatA(STRSAFE_LPSTR pszDest, size_t cchDest, STRSAFE_LPCSTR pszSrc)
STRSAFEAPI StringCchCopyA(STRSAFE_LPSTR pszDest, size_t cchDest, STRSAFE_LPCSTR pszSrc)
nfs41_lookup_args lookup[MAX_LOOKUP_COMPONENTS]
nfs41_sequence_args sequence
nfs41_getattr_args getrootattr
nfs41_getattr_args getattr[MAX_LOOKUP_COMPONENTS]
nfs41_sequence_res sequence
nfs41_getattr_res getattr[MAX_LOOKUP_COMPONENTS]
nfs41_getattr_res getrootattr
nfs41_getfh_res getrootfh
nfs41_lookup_res lookup[MAX_LOOKUP_COMPONENTS]
nfs41_getfh_res getfh[MAX_LOOKUP_COMPONENTS]
struct lookup_referral * referral
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
#define ERROR_PATH_NOT_FOUND
#define ERROR_FILENAME_EXCED_RANGE