mirror of
https://github.com/containers/fuse-overlayfs.git
synced 2025-09-09 15:24:54 -04:00
main: skip lookup if the directory is fully loaded
avoid doing a lookup in the lower layers if the directory is already loaded. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
7bd251b1da
commit
216ef5ef48
5
main.c
5
main.c
@ -217,6 +217,7 @@ struct ovl_node
|
||||
unsigned int do_rmdir : 1;
|
||||
unsigned int hidden : 1;
|
||||
unsigned int whiteout : 1;
|
||||
unsigned int loaded : 1;
|
||||
};
|
||||
|
||||
struct ovl_data
|
||||
@ -905,6 +906,7 @@ node_free (void *p)
|
||||
{
|
||||
if (hash_lookup (n->parent->children, n) == n)
|
||||
hash_delete (n->parent->children, n);
|
||||
n->parent->loaded = 0;
|
||||
n->parent = NULL;
|
||||
}
|
||||
|
||||
@ -1377,6 +1379,7 @@ load_dir (struct ovl_data *lo, struct ovl_node *n, struct ovl_layer *layer, char
|
||||
break;
|
||||
}
|
||||
|
||||
n->loaded = 1;
|
||||
return n;
|
||||
}
|
||||
|
||||
@ -1480,7 +1483,7 @@ do_lookup_file (struct ovl_data *lo, fuse_ino_t parent, const char *name)
|
||||
|
||||
node_set_name (&key, (char *) name);
|
||||
node = hash_lookup (pnode->children, &key);
|
||||
if (node == NULL)
|
||||
if (node == NULL && !pnode->loaded)
|
||||
{
|
||||
int ret;
|
||||
struct ovl_layer *it;
|
||||
|
Loading…
x
Reference in New Issue
Block a user