1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2024-10-27 20:44:10 +00:00

fixes missing inode using stat and ls -i

This commit is contained in:
Falk Werner 2019-05-26 16:30:01 +02:00 committed by Falk Werner
parent 973f95f30b
commit 83c7feee82
2 changed files with 4 additions and 1 deletions

View File

@ -14,6 +14,7 @@
struct wf_impl_operation_getattr_context struct wf_impl_operation_getattr_context
{ {
fuse_req_t request; fuse_req_t request;
fuse_ino_t inode;
double timeout; double timeout;
uid_t uid; uid_t uid;
gid_t gid; gid_t gid;
@ -36,6 +37,7 @@ static void wf_impl_operation_getattr_finished(
{ {
memset(&buffer, 0, sizeof(struct stat)); memset(&buffer, 0, sizeof(struct stat));
buffer.st_ino = context->inode;
buffer.st_mode = json_integer_value(mode_holder) & 0555; buffer.st_mode = json_integer_value(mode_holder) & 0555;
char const * type = json_string_value(type_holder); char const * type = json_string_value(type_holder);
if (0 == strcmp("file", type)) if (0 == strcmp("file", type))
@ -54,7 +56,6 @@ static void wf_impl_operation_getattr_finished(
buffer.st_atime = wf_impl_json_get_int(data, "atime", 0); buffer.st_atime = wf_impl_json_get_int(data, "atime", 0);
buffer.st_mtime = wf_impl_json_get_int(data, "mtime", 0); buffer.st_mtime = wf_impl_json_get_int(data, "mtime", 0);
buffer.st_ctime = wf_impl_json_get_int(data, "ctime", 0); buffer.st_ctime = wf_impl_json_get_int(data, "ctime", 0);
} }
else else
{ {
@ -87,6 +88,7 @@ void wf_impl_operation_getattr (
{ {
struct wf_impl_operation_getattr_context * getattr_context = malloc(sizeof(struct wf_impl_operation_getattr_context)); struct wf_impl_operation_getattr_context * getattr_context = malloc(sizeof(struct wf_impl_operation_getattr_context));
getattr_context->request = request; getattr_context->request = request;
getattr_context->inode = inode;
getattr_context->uid = context->uid; getattr_context->uid = context->uid;
getattr_context->gid = context->gid; getattr_context->gid = context->gid;
getattr_context->timeout = user_data->timeout; getattr_context->timeout = user_data->timeout;

View File

@ -43,6 +43,7 @@ static void wf_impl_operation_lookup_finished(
memset(&buffer, 0, sizeof(struct stat)); memset(&buffer, 0, sizeof(struct stat));
buffer.ino = json_integer_value(inode_holder); buffer.ino = json_integer_value(inode_holder);
buffer.attr.st_ino = buffer.ino;
buffer.attr.st_mode = json_integer_value(mode_holder) & 0555; buffer.attr.st_mode = json_integer_value(mode_holder) & 0555;
char const * type = json_string_value(type_holder); char const * type = json_string_value(type_holder);
if (0 == strcmp("file", type)) if (0 == strcmp("file", type))