summaryrefslogtreecommitdiff
path: root/fs/autofs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2023-11-07 02:00:39 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2023-11-25 02:32:13 -0500
commitda549bdd15c295c24b2ee7ffe7ad0f3877fa8a87 (patch)
tree15dbab67479c82f6138f801dce00f04c357438a6 /fs/autofs
parentb31559f8e471f402cd71117f35b9cde52d192138 (diff)
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/autofs')
-rw-r--r--fs/autofs/expire.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/autofs/expire.c b/fs/autofs/expire.c
index 038b3d2d9f57..39d8c84c16f4 100644
--- a/fs/autofs/expire.c
+++ b/fs/autofs/expire.c
@@ -73,12 +73,9 @@ done:
/* p->d_lock held */
static struct dentry *positive_after(struct dentry *p, struct dentry *child)
{
- if (child)
- child = list_next_entry(child, d_child);
- else
- child = list_first_entry(&p->d_subdirs, struct dentry, d_child);
+ child = child ? d_next_sibling(child) : d_first_child(p);
- list_for_each_entry_from(child, &p->d_subdirs, d_child) {
+ hlist_for_each_entry_from(child, d_sib) {
spin_lock_nested(&child->d_lock, DENTRY_D_LOCK_NESTED);
if (simple_positive(child)) {
dget_dlock(child);