[Devel,vz7,36/46] fuse: cleanup request_end()

Submitted by Maxim Patlasov on March 25, 2017, 2:27 a.m.

Details

Message ID 149040882476.25341.8280364545680198706.stgit@maxim-thinkpad
State New
Series "fuse: add multi-threading support"
Headers show

Commit Message

Maxim Patlasov March 25, 2017, 2:27 a.m.
Backport from ml:

commit 1e6881c36ebbfd47298c42fa82b544c4988933fa
Author: Miklos Szeredi <mszeredi@suse.cz>
Date:   Wed Jul 1 16:26:07 2015 +0200

    fuse: cleanup request_end()

    Now that we atomically test having already done everything we no longer
    need other protection.

    Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
    Reviewed-by: Ashish Samant <ashish.samant@oracle.com>

Signed-off-by: Maxim Patlasov <mpatlasov@virtuozzo.com>
---
 fs/fuse/dev.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 4d16a1c..d2ad658 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -366,14 +366,12 @@  static void request_end(struct fuse_conn *fc, struct fuse_req *req)
 __releases(fc->lock)
 {
 	struct fuse_iqueue *fiq = &fc->iq;
-	void (*end) (struct fuse_conn *, struct fuse_req *) = req->end;
 
 	if (test_and_set_bit(FR_FINISHED, &req->flags)) {
 		spin_unlock(&fc->lock);
 		return;
 	}
 
-	req->end = NULL;
 	spin_lock(&fiq->waitq.lock);
 	list_del_init(&req->intr_entry);
 	spin_unlock(&fiq->waitq.lock);
@@ -399,8 +397,8 @@  __releases(fc->lock)
 	}
 	spin_unlock(&fc->lock);
 	wake_up(&req->waitq);
-	if (end)
-		end(fc, req);
+	if (req->end)
+		req->end(fc, req);
 	fuse_put_request(fc, req);
 }