2023-05-29 02:09:43

by lijun

[permalink] [raw]
Subject: [PATCH] FUSE: dev: Change the posiion of spin_lock

just list_del need spin_lock ,so the spin_lock should be close to
"list_del(&req->list)", this may add a little benefit.

Signed-off-by: lijun <[email protected]>
---
fs/fuse/dev.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 1a8f82f478cb..c3a0a04ea9b4 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -388,16 +388,15 @@ static void request_wait_answer(struct fuse_req *req)
if (!err)
return;

- spin_lock(&fiq->lock);
/* Request is not yet in userspace, bail out */
if (test_bit(FR_PENDING, &req->flags)) {
+ spin_lock(&fiq->lock);
list_del(&req->list);
spin_unlock(&fiq->lock);
__fuse_put_request(req);
req->out.h.error = -EINTR;
return;
}
- spin_unlock(&fiq->lock);
}

/*
--
2.34.1