diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2023-11-07 08:00:39 +0100 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2023-11-25 08:32:13 +0100 |
commit | da549bdd15c295c24b2ee7ffe7ad0f3877fa8a87 (patch) | |
tree | 15dbab67479c82f6138f801dce00f04c357438a6 /fs/afs | |
parent | coda_flag_children(): cope with dentries turning negative (diff) | |
download | linux-da549bdd15c295c24b2ee7ffe7ad0f3877fa8a87.tar.xz linux-da549bdd15c295c24b2ee7ffe7ad0f3877fa8a87.zip |
dentry: switch the lists of children to hlist
Saves a pointer per struct dentry and actually makes the things less
clumsy. Cleaned the d_walk() and dcache_readdir() a bit by use
of hlist_for_... iterators.
A couple of new helpers - d_first_child() and d_next_sibling(),
to make the expressions less awful.
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/afs')
-rw-r--r-- | fs/afs/dynroot.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/afs/dynroot.c b/fs/afs/dynroot.c index 4d04ef2d3ae7..fe45462834cc 100644 --- a/fs/afs/dynroot.c +++ b/fs/afs/dynroot.c @@ -370,7 +370,7 @@ error: void afs_dynroot_depopulate(struct super_block *sb) { struct afs_net *net = afs_sb2net(sb); - struct dentry *root = sb->s_root, *subdir, *tmp; + struct dentry *root = sb->s_root, *subdir; /* Prevent more subdirs from being created */ mutex_lock(&net->proc_cells_lock); @@ -379,10 +379,11 @@ void afs_dynroot_depopulate(struct super_block *sb) mutex_unlock(&net->proc_cells_lock); if (root) { + struct hlist_node *n; inode_lock(root->d_inode); /* Remove all the pins for dirs created for manually added cells */ - list_for_each_entry_safe(subdir, tmp, &root->d_subdirs, d_child) { + hlist_for_each_entry_safe(subdir, n, &root->d_children, d_sib) { if (subdir->d_fsdata) { subdir->d_fsdata = NULL; dput(subdir); |