summaryrefslogtreecommitdiffstats
path: root/src/bftw.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-02-01 09:28:36 -0500
committerTavian Barnes <tavianator@tavianator.com>2024-02-01 12:44:58 -0500
commitbb060c513214aec07993946764180c17106b4344 (patch)
treee8e889f1f0324fa6864b5192070cde28ad8f724a /src/bftw.c
parentb9bd5cbaf717f5613e9c093698c3af884586a975 (diff)
downloadbfs-bb060c513214aec07993946764180c17106b4344.tar.xz
bftw: Kill trivial bftw_queue_balance() helper
Diffstat (limited to 'src/bftw.c')
-rw-r--r--src/bftw.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/bftw.c b/src/bftw.c
index c9ba67e..7b32db6 100644
--- a/src/bftw.c
+++ b/src/bftw.c
@@ -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;
}
}