diff options
author | Kirill Tkhai <ktkhai@virtuozzo.com> | 2018-07-31 06:25:25 -0400 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2018-09-28 10:43:22 -0400 |
commit | e287179afe2190faa7b97915cb89215dde5e044b (patch) | |
tree | a8c3fa4208c0b65e5524d14446def640ec5e1f09 /fs/fuse | |
parent | 88bc7d5097a11d9bdcf08ecf85c81ba998353437 (diff) |
fuse: use list_first_entry() in flush_bg_queue()
This cleanup patch makes the function to use the primitive
instead of direct dereferencing.
Also, move fiq dereferencing out of cycle, since it's
always constant.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse')
-rw-r--r-- | fs/fuse/dev.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 51eb602a435b..6a7d3b4424e1 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c | |||
@@ -353,12 +353,13 @@ void fuse_queue_forget(struct fuse_conn *fc, struct fuse_forget_link *forget, | |||
353 | 353 | ||
354 | static void flush_bg_queue(struct fuse_conn *fc) | 354 | static void flush_bg_queue(struct fuse_conn *fc) |
355 | { | 355 | { |
356 | struct fuse_iqueue *fiq = &fc->iq; | ||
357 | |||
356 | while (fc->active_background < fc->max_background && | 358 | while (fc->active_background < fc->max_background && |
357 | !list_empty(&fc->bg_queue)) { | 359 | !list_empty(&fc->bg_queue)) { |
358 | struct fuse_req *req; | 360 | struct fuse_req *req; |
359 | struct fuse_iqueue *fiq = &fc->iq; | ||
360 | 361 | ||
361 | req = list_entry(fc->bg_queue.next, struct fuse_req, list); | 362 | req = list_first_entry(&fc->bg_queue, struct fuse_req, list); |
362 | list_del(&req->list); | 363 | list_del(&req->list); |
363 | fc->active_background++; | 364 | fc->active_background++; |
364 | spin_lock(&fiq->waitq.lock); | 365 | spin_lock(&fiq->waitq.lock); |