mirror of
https://github.com/containers/fuse-overlayfs.git
synced 2025-08-03 18:05:58 -04:00
main: use hash_remove instead of hash_delete
the function is deprecated in gnulib Closes: https://github.com/containers/fuse-overlayfs/issues/442 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
ce8d185c16
commit
b88a093bd4
20
main.c
20
main.c
@ -1018,7 +1018,7 @@ node_free (void *p)
|
|||||||
if (n->parent)
|
if (n->parent)
|
||||||
{
|
{
|
||||||
if (n->parent->children && hash_lookup (n->parent->children, n) == n)
|
if (n->parent->children && hash_lookup (n->parent->children, n) == n)
|
||||||
hash_delete (n->parent->children, n);
|
hash_remove (n->parent->children, n);
|
||||||
n->parent->loaded = 0;
|
n->parent->loaded = 0;
|
||||||
n->parent = NULL;
|
n->parent = NULL;
|
||||||
}
|
}
|
||||||
@ -1078,7 +1078,7 @@ drop_node_from_ino (Hash_table *inodes, struct ovl_node *node)
|
|||||||
|
|
||||||
if (ino->lookups == 0)
|
if (ino->lookups == 0)
|
||||||
{
|
{
|
||||||
hash_delete (inodes, ino);
|
hash_remove (inodes, ino);
|
||||||
inode_free (ino);
|
inode_free (ino);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1308,7 +1308,7 @@ do_forget (struct ovl_data *lo, fuse_ino_t ino, uint64_t nlookup)
|
|||||||
i->lookups -= nlookup;
|
i->lookups -= nlookup;
|
||||||
if (i->lookups <= 0)
|
if (i->lookups <= 0)
|
||||||
{
|
{
|
||||||
hash_delete (lo->inodes, i);
|
hash_remove (lo->inodes, i);
|
||||||
inode_free (i);
|
inode_free (i);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -1659,12 +1659,12 @@ insert_node (struct ovl_node *parent, struct ovl_node *item, bool replace)
|
|||||||
if (prev_parent)
|
if (prev_parent)
|
||||||
{
|
{
|
||||||
if (hash_lookup (prev_parent->children, item) == item)
|
if (hash_lookup (prev_parent->children, item) == item)
|
||||||
hash_delete (prev_parent->children, item);
|
hash_remove (prev_parent->children, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (replace)
|
if (replace)
|
||||||
{
|
{
|
||||||
old = hash_delete (parent->children, item);
|
old = hash_remove (parent->children, item);
|
||||||
if (old)
|
if (old)
|
||||||
node_free (old);
|
node_free (old);
|
||||||
}
|
}
|
||||||
@ -1787,7 +1787,7 @@ load_dir (struct ovl_data *lo, struct ovl_node *n, struct ovl_layer *layer, char
|
|||||||
continue;
|
continue;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
hash_delete (n->children, child);
|
hash_remove (n->children, child);
|
||||||
node_free (child);
|
node_free (child);
|
||||||
child = NULL;
|
child = NULL;
|
||||||
}
|
}
|
||||||
@ -3496,7 +3496,7 @@ do_rm (fuse_req_t req, fuse_ino_t parent, const char *name, bool dirp)
|
|||||||
|
|
||||||
node_set_name (&key, (char *) name);
|
node_set_name (&key, (char *) name);
|
||||||
|
|
||||||
rm = hash_delete (pnode->children, &key);
|
rm = hash_remove (pnode->children, &key);
|
||||||
fuse_lowlevel_notify_inval_inode (lo->se, node_to_inode (node), -1, 0);
|
fuse_lowlevel_notify_inval_inode (lo->se, node_to_inode (node), -1, 0);
|
||||||
if (rm)
|
if (rm)
|
||||||
{
|
{
|
||||||
@ -4623,8 +4623,8 @@ ovl_rename_exchange (fuse_req_t req, fuse_ino_t parent, const char *name,
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
rm1 = hash_delete (destpnode->children, destnode);
|
rm1 = hash_remove (destpnode->children, destnode);
|
||||||
rm2 = hash_delete (pnode->children, node);
|
rm2 = hash_remove (pnode->children, node);
|
||||||
|
|
||||||
tmp = node->path;
|
tmp = node->path;
|
||||||
node->path = destnode->path;
|
node->path = destnode->path;
|
||||||
@ -4854,7 +4854,7 @@ ovl_rename_direct (fuse_req_t req, fuse_ino_t parent, const char *name,
|
|||||||
if (delete_whiteout (lo, destfd, NULL, newname) < 0)
|
if (delete_whiteout (lo, destfd, NULL, newname) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
hash_delete (pnode->children, node);
|
hash_remove (pnode->children, node);
|
||||||
|
|
||||||
free (node->name);
|
free (node->name);
|
||||||
node_set_name (node, strdup (newname));
|
node_set_name (node, strdup (newname));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user