[Devel,vz7,06/46] fuse: fold fuse_request_send_nowait() into single caller

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

Details

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

Commit Message

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

commit f0139aa819dfc8e80f664bd08800fc48233cb94e
Author: Miklos Szeredi <mszeredi@suse.cz>
Date:   Wed Jul 1 16:25:57 2015 +0200

    fuse: fold fuse_request_send_nowait() into single caller

    And the same with fuse_request_send_nowait_locked().

    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 |   32 ++++++++++----------------------
 1 file changed, 10 insertions(+), 22 deletions(-)

Patch hide | download patch | download mbox

diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index c14e102..c2a3392 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -515,14 +515,20 @@  void fuse_request_send(struct fuse_conn *fc, struct fuse_req *req)
 }
 EXPORT_SYMBOL_GPL(fuse_request_send);
 
-static void fuse_request_send_nowait_locked(struct fuse_conn *fc,
-					    struct fuse_req *req)
+/*
+ * Called under fc->lock
+ *
+ * fc->connected must have been checked previously
+ */
+void fuse_request_send_background_locked(struct fuse_conn *fc,
+					 struct fuse_req *req)
 {
 	BUG_ON(!req->background);
 	if (!req->waiting) {
 		req->waiting = 1;
 		atomic_inc(&fc->num_waiting);
 	}
+	req->isreply = 1;
 	fc->num_background++;
 	if (fc->num_background == fc->max_background)
 		fc->blocked = 1;
@@ -535,7 +541,7 @@  static void fuse_request_send_nowait_locked(struct fuse_conn *fc,
 	flush_bg_queue(fc);
 }
 
-static void fuse_request_send_nowait(struct fuse_conn *fc, struct fuse_req *req)
+void fuse_request_send_background(struct fuse_conn *fc, struct fuse_req *req)
 {
 	BUG_ON(!req->end);
 	spin_lock(&fc->lock);
@@ -546,7 +552,7 @@  static void fuse_request_send_nowait(struct fuse_conn *fc, struct fuse_req *req)
 		req->background = 0;
 		request_end(fc, req);
 	} else if (fc->connected) {
-		fuse_request_send_nowait_locked(fc, req);
+		fuse_request_send_background_locked(fc, req);
 		spin_unlock(&fc->lock);
 	} else {
 		spin_unlock(&fc->lock);
@@ -555,12 +561,6 @@  static void fuse_request_send_nowait(struct fuse_conn *fc, struct fuse_req *req)
 		fuse_put_request(fc, req);
 	}
 }
-
-void fuse_request_send_background(struct fuse_conn *fc, struct fuse_req *req)
-{
-	req->isreply = 1;
-	fuse_request_send_nowait(fc, req);
-}
 EXPORT_SYMBOL_GPL(fuse_request_send_background);
 
 static int fuse_request_send_notify_reply(struct fuse_conn *fc,
@@ -580,18 +580,6 @@  static int fuse_request_send_notify_reply(struct fuse_conn *fc,
 	return err;
 }
 
-/*
- * Called under fc->lock
- *
- * fc->connected must have been checked previously
- */
-void fuse_request_send_background_locked(struct fuse_conn *fc,
-					 struct fuse_req *req)
-{
-	req->isreply = 1;
-	fuse_request_send_nowait_locked(fc, req);
-}
-
 void fuse_force_forget(struct file *file, u64 nodeid)
 {
 	struct inode *inode = file_inode(file);