cosmetic: map_lookup_error()
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
parent
30cc2e1d32
commit
5748d17934
1 changed files with 12 additions and 7 deletions
|
|
@ -169,6 +169,17 @@ out:
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int map_lookup_error(int status, bool_t is_last_component)
|
||||||
|
{
|
||||||
|
switch (status) {
|
||||||
|
case NFS4ERR_NOENT:
|
||||||
|
if (is_last_component) return ERROR_FILE_NOT_FOUND;
|
||||||
|
else return ERROR_PATH_NOT_FOUND;
|
||||||
|
case NFS4ERR_MOVED: return ERROR_FILESYSTEM_ABSENT;
|
||||||
|
default: return nfs_to_windows_error(status, ERROR_FILE_NOT_FOUND);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static int server_lookup(
|
static int server_lookup(
|
||||||
IN nfs41_session *session,
|
IN nfs41_session *session,
|
||||||
IN nfs41_path_fh *dir,
|
IN nfs41_path_fh *dir,
|
||||||
|
|
@ -237,7 +248,6 @@ static int server_lookup(
|
||||||
path_fh_copy(&res->referral->parent, file);
|
path_fh_copy(&res->referral->parent, file);
|
||||||
res->referral->name.name = args->lookup[i].name->name;
|
res->referral->name.name = args->lookup[i].name->name;
|
||||||
res->referral->name.len = args->lookup[i].name->len;
|
res->referral->name.len = args->lookup[i].name->len;
|
||||||
return ERROR_FILESYSTEM_ABSENT;
|
|
||||||
}
|
}
|
||||||
status = res->getfh[i].status; if (status) break;
|
status = res->getfh[i].status; if (status) break;
|
||||||
status = res->getattr[i].status; if (status) break;
|
status = res->getattr[i].status; if (status) break;
|
||||||
|
|
@ -270,12 +280,7 @@ static int server_lookup(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
out:
|
out:
|
||||||
status = nfs_to_windows_error(status, ERROR_FILE_NOT_FOUND);
|
return map_lookup_error(status, i == count-1);
|
||||||
|
|
||||||
/* use PATH_NOT_FOUND for all but the last name */
|
|
||||||
if (status == ERROR_FILE_NOT_FOUND && i != count-1)
|
|
||||||
status = ERROR_PATH_NOT_FOUND;
|
|
||||||
return status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t max_lookup_components(
|
static uint32_t max_lookup_components(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue