Skip to content

Commit 3926746

Browse files
Miklos Szeredibrauner
authored andcommitted
fuse: clean up fuse_dentry_tree_work()
- Change time_after64() time_before64(), since the latter is exclusively used in this file to compare dentry/inode timeout with current time. - Move the break statement from the else branch to the if branch, reducing indentation. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Link: https://patch.msgid.link/20260114145344.468856-5-mszeredi@redhat.com Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 09f7a43 commit 3926746

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

fs/fuse/dir.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -169,21 +169,21 @@ static void fuse_dentry_tree_work(struct work_struct *work)
169169
node = rb_first(&dentry_hash[i].tree);
170170
while (node) {
171171
fd = rb_entry(node, struct fuse_dentry, node);
172-
if (time_after64(get_jiffies_64(), fd->time)) {
173-
rb_erase(&fd->node, &dentry_hash[i].tree);
174-
RB_CLEAR_NODE(&fd->node);
175-
spin_lock(&fd->dentry->d_lock);
176-
/* If dentry is still referenced, let next dput release it */
177-
fd->dentry->d_flags |= DCACHE_OP_DELETE;
178-
spin_unlock(&fd->dentry->d_lock);
179-
d_dispose_if_unused(fd->dentry, &dispose);
180-
if (need_resched()) {
181-
spin_unlock(&dentry_hash[i].lock);
182-
cond_resched();
183-
spin_lock(&dentry_hash[i].lock);
184-
}
185-
} else
172+
if (!time_before64(fd->time, get_jiffies_64()))
186173
break;
174+
175+
rb_erase(&fd->node, &dentry_hash[i].tree);
176+
RB_CLEAR_NODE(&fd->node);
177+
spin_lock(&fd->dentry->d_lock);
178+
/* If dentry is still referenced, let next dput release it */
179+
fd->dentry->d_flags |= DCACHE_OP_DELETE;
180+
spin_unlock(&fd->dentry->d_lock);
181+
d_dispose_if_unused(fd->dentry, &dispose);
182+
if (need_resched()) {
183+
spin_unlock(&dentry_hash[i].lock);
184+
cond_resched();
185+
spin_lock(&dentry_hash[i].lock);
186+
}
187187
node = rb_first(&dentry_hash[i].tree);
188188
}
189189
spin_unlock(&dentry_hash[i].lock);

0 commit comments

Comments
 (0)