]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fuse: clean up fuse_dentry_tree_work()
authorMiklos Szeredi <mszeredi@redhat.com>
Wed, 14 Jan 2026 14:53:41 +0000 (15:53 +0100)
committerChristian Brauner <brauner@kernel.org>
Fri, 16 Jan 2026 18:15:14 +0000 (19:15 +0100)
- 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>
fs/fuse/dir.c

index 93bde5b8c181dbee298d61bb6becec4a236b1f28..def2b2e1f96bf062d1a781a22c830f80659c4b59 100644 (file)
@@ -169,21 +169,21 @@ static void fuse_dentry_tree_work(struct work_struct *work)
                node = rb_first(&dentry_hash[i].tree);
                while (node) {
                        fd = rb_entry(node, struct fuse_dentry, node);
-                       if (time_after64(get_jiffies_64(), fd->time)) {
-                               rb_erase(&fd->node, &dentry_hash[i].tree);
-                               RB_CLEAR_NODE(&fd->node);
-                               spin_lock(&fd->dentry->d_lock);
-                               /* If dentry is still referenced, let next dput release it */
-                               fd->dentry->d_flags |= DCACHE_OP_DELETE;
-                               spin_unlock(&fd->dentry->d_lock);
-                               d_dispose_if_unused(fd->dentry, &dispose);
-                               if (need_resched()) {
-                                       spin_unlock(&dentry_hash[i].lock);
-                                       cond_resched();
-                                       spin_lock(&dentry_hash[i].lock);
-                               }
-                       } else
+                       if (!time_before64(fd->time, get_jiffies_64()))
                                break;
+
+                       rb_erase(&fd->node, &dentry_hash[i].tree);
+                       RB_CLEAR_NODE(&fd->node);
+                       spin_lock(&fd->dentry->d_lock);
+                       /* If dentry is still referenced, let next dput release it */
+                       fd->dentry->d_flags |= DCACHE_OP_DELETE;
+                       spin_unlock(&fd->dentry->d_lock);
+                       d_dispose_if_unused(fd->dentry, &dispose);
+                       if (need_resched()) {
+                               spin_unlock(&dentry_hash[i].lock);
+                               cond_resched();
+                               spin_lock(&dentry_hash[i].lock);
+                       }
                        node = rb_first(&dentry_hash[i].tree);
                }
                spin_unlock(&dentry_hash[i].lock);