main: report the st_ino known so far

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2022-11-30 15:46:04 +01:00
parent 5b156f97a8
commit 0d8c5480d1
No known key found for this signature in database
GPG Key ID: 67E38F7A8BA21772

11
main.c
View File

@ -944,7 +944,8 @@ rpl_stat (fuse_req_t req, struct ovl_node *node, int fd, const char *path, struc
st->st_ino = node->tmp_ino;
st->st_dev = node->tmp_dev;
if (ret == 0 && node_dirp (node))
if (node_dirp (node))
{
if (!data->static_nlink)
{
@ -961,6 +962,14 @@ rpl_stat (fuse_req_t req, struct ovl_node *node, int fd, const char *path, struc
else
st->st_nlink = 1;
}
else
{
struct ovl_node *n;
st->st_nlink = 0;
for (n = node->ino->node; n; n = n->next_link)
st->st_nlink++;
}
return ret;
}