summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2026-01-14 17:53:40 +0300
committerChristian Brauner <brauner@kernel.org>2026-01-16 21:15:14 +0300
commit09f7a43ae501541030f42670351032f3c8bfa06e (patch)
treea28c8edf725d0bf284dbfa4abd968f391ad3e277
parent1e2c1af1beb395841743e240a59ab37edc9a7d33 (diff)
downloadlinux-09f7a43ae501541030f42670351032f3c8bfa06e.tar.xz
fuse: add need_resched() before unlocking bucket
In fuse_dentry_tree_work() no need to unlock/lock dentry_hash[i].lock on each iteration. Suggested-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Link: https://patch.msgid.link/20260114145344.468856-4-mszeredi@redhat.com Signed-off-by: Christian Brauner <brauner@kernel.org>
-rw-r--r--fs/fuse/dir.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index c9922af79dfa..93bde5b8c181 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -177,9 +177,11 @@ static void fuse_dentry_tree_work(struct work_struct *work)
fd->dentry->d_flags |= DCACHE_OP_DELETE;
spin_unlock(&fd->dentry->d_lock);
d_dispose_if_unused(fd->dentry, &dispose);
- spin_unlock(&dentry_hash[i].lock);
- cond_resched();
- spin_lock(&dentry_hash[i].lock);
+ if (need_resched()) {
+ spin_unlock(&dentry_hash[i].lock);
+ cond_resched();
+ spin_lock(&dentry_hash[i].lock);
+ }
} else
break;
node = rb_first(&dentry_hash[i].tree);