fixes missing inode using stat and ls -i

pull/41/head
Falk Werner 5 years ago committed by Falk Werner
parent 973f95f30b
commit 83c7feee82

@ -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;

@ -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))

Loading…
Cancel
Save