diff options
author | Kirill Tkhai <ktkhai@virtuozzo.com> | 2018-11-08 12:05:31 +0300 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2019-02-13 13:15:13 +0100 |
commit | 5e0fed717a383ce6e894334cffe7a2acc9dc17b9 (patch) | |
tree | 97787d49561272c7529dd5df01cd30e696c0b936 /fs/fuse/dev.c | |
parent | 217316a601016d0d2913290070e6338576ae73f6 (diff) | |
download | linux-5e0fed717a383ce6e894334cffe7a2acc9dc17b9.tar.bz2 |
fuse: Wake up req->waitq of only if not background
Currently, we wait on req->waitq in request_wait_answer() function only,
and it's never used for background requests. Since wake_up() is not a
light-weight macros, instead of this, it unfolds in really called function,
which makes locking operations taking some cpu cycles, let's avoid its call
for the case we definitely know it's completely useless.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse/dev.c')
-rw-r--r-- | fs/fuse/dev.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 74171d568621..0a69656402e5 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -468,8 +468,11 @@ static void request_end(struct fuse_conn *fc, struct fuse_req *req) fc->active_background--; flush_bg_queue(fc); spin_unlock(&fc->bg_lock); + } else { + /* Wake up waiter sleeping in request_wait_answer() */ + wake_up(&req->waitq); } - wake_up(&req->waitq); + if (req->end) req->end(fc, req); put_request: |