diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2024-02-01 09:28:36 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2024-02-01 12:44:58 -0500 |
commit | bb060c513214aec07993946764180c17106b4344 (patch) | |
tree | e8e889f1f0324fa6864b5192070cde28ad8f724a /src/bftw.c | |
parent | b9bd5cbaf717f5613e9c093698c3af884586a975 (diff) | |
download | bfs-bb060c513214aec07993946764180c17106b4344.tar.xz |
bftw: Kill trivial bftw_queue_balance() helper
Diffstat (limited to 'src/bftw.c')
-rw-r--r-- | src/bftw.c | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -330,11 +330,6 @@ static void bftw_queue_flush(struct bftw_queue *queue) { SLIST_EXTEND(&queue->waiting, &queue->buffer); } -/** Update the queue imbalance. */ -static void bftw_queue_balance(struct bftw_queue *queue, long delta) { - queue->imbalance += delta; -} - /** Check if the queue is properly balanced for async work. */ static bool bftw_queue_balanced(const struct bftw_queue *queue) { if (queue->flags & BFTW_QBALANCE) { @@ -358,7 +353,7 @@ static void bftw_queue_detach(struct bftw_queue *queue, struct bftw_file *file) } file->ioqueued = true; - bftw_queue_balance(queue, -1); + --queue->imbalance; } /** Reattach a serviced file to the queue. */ @@ -420,7 +415,7 @@ static struct bftw_file *bftw_queue_pop(struct bftw_queue *queue) { file = SLIST_POP(&queue->waiting); if (file) { // This file will be serviced synchronously - bftw_queue_balance(queue, +1); + ++queue->imbalance; } } |