diff options
| author | Miklos Szeredi <mszeredi@redhat.com> | 2026-03-17 14:34:20 +0100 |
|---|---|---|
| committer | Miklos Szeredi <mszeredi@redhat.com> | 2026-06-15 14:06:15 +0200 |
| commit | 2b07cbc4e4865c246b5ba096def7fb9725d8cc1d (patch) | |
| tree | 74d94c07ad40e7451892824b3855aba0c74ce37e /fs/fuse/dev_uring.c | |
| parent | 4e0de84063159aa1804120c6c5493bd05be35adf (diff) | |
fuse: move background queuing related members to fuse_chan
Move:
- max_background
- num_background
- active_background
- bg_queue
- bg_lock
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse/dev_uring.c')
| -rw-r--r-- | fs/fuse/dev_uring.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c index 02b138727c9b..9c553726701e 100644 --- a/fs/fuse/dev_uring.c +++ b/fs/fuse/dev_uring.c @@ -54,7 +54,7 @@ static void fuse_uring_flush_bg(struct fuse_ring_queue *queue) struct fuse_conn *fc = ring->fc; lockdep_assert_held(&queue->lock); - lockdep_assert_held(&fc->bg_lock); + lockdep_assert_held(&fc->chan->bg_lock); /* * Allow one bg request per queue, ignoring global fc limits. @@ -62,14 +62,14 @@ static void fuse_uring_flush_bg(struct fuse_ring_queue *queue) * eliminates the need for remote queue wake-ups when global * limits are met but this queue has no more waiting requests. */ - while ((fc->active_background < fc->max_background || + while ((fc->chan->active_background < fc->chan->max_background || !queue->active_background) && (!list_empty(&queue->fuse_req_bg_queue))) { struct fuse_req *req; req = list_first_entry(&queue->fuse_req_bg_queue, struct fuse_req, list); - fc->active_background++; + fc->chan->active_background++; queue->active_background++; list_move_tail(&req->list, &queue->fuse_req_queue); @@ -89,10 +89,10 @@ static void fuse_uring_req_end(struct fuse_ring_ent *ent, struct fuse_req *req, list_del_init(&req->list); if (test_bit(FR_BACKGROUND, &req->flags)) { queue->active_background--; - spin_lock(&fc->bg_lock); + spin_lock(&fc->chan->bg_lock); fuse_request_bg_finish(fc, req); fuse_uring_flush_bg(queue); - spin_unlock(&fc->bg_lock); + spin_unlock(&fc->chan->bg_lock); } spin_unlock(&queue->lock); @@ -131,12 +131,12 @@ void fuse_uring_abort_end_requests(struct fuse_ring *ring) if (!queue) continue; - WARN_ON_ONCE(ring->fc->max_background != UINT_MAX); + WARN_ON_ONCE(ring->fc->chan->max_background != UINT_MAX); spin_lock(&queue->lock); queue->stopped = true; - spin_lock(&fc->bg_lock); + spin_lock(&fc->chan->bg_lock); fuse_uring_flush_bg(queue); - spin_unlock(&fc->bg_lock); + spin_unlock(&fc->chan->bg_lock); spin_unlock(&queue->lock); fuse_uring_abort_end_queue_requests(queue); } @@ -1370,12 +1370,12 @@ bool fuse_uring_queue_bq_req(struct fuse_req *req) ent = list_first_entry_or_null(&queue->ent_avail_queue, struct fuse_ring_ent, list); - spin_lock(&fc->bg_lock); - fc->num_background++; - if (fc->num_background == fc->max_background) + spin_lock(&fc->chan->bg_lock); + fc->chan->num_background++; + if (fc->chan->num_background == fc->chan->max_background) fc->blocked = 1; fuse_uring_flush_bg(queue); - spin_unlock(&fc->bg_lock); + spin_unlock(&fc->chan->bg_lock); /* * Due to bg_queue flush limits there might be other bg requests |
