summaryrefslogtreecommitdiff
path: root/libbcachefs/alloc_types.h
diff options
context:
space:
mode:
Diffstat (limited to 'libbcachefs/alloc_types.h')
-rw-r--r--libbcachefs/alloc_types.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/libbcachefs/alloc_types.h b/libbcachefs/alloc_types.h
index 90123ff7..6b081040 100644
--- a/libbcachefs/alloc_types.h
+++ b/libbcachefs/alloc_types.h
@@ -5,12 +5,9 @@
#include <linux/spinlock.h>
#include "clock_types.h"
+#include "fifo.h"
-/*
- * There's two of these clocks, one for reads and one for writes:
- *
- * All fields protected by bucket_lock
- */
+/* There's two of these clocks, one for reads and one for writes: */
struct prio_clock {
/*
* "now" in (read/write) IO time - incremented whenever we do X amount
@@ -31,6 +28,7 @@ struct prio_clock {
int rw;
struct io_timer rescale;
+ struct mutex lock;
};
/* There is one reserve for each type of btree, one for prios and gens
@@ -43,6 +41,8 @@ enum alloc_reserve {
RESERVE_NR = 3,
};
+typedef FIFO(long) alloc_fifo;
+
/* Enough for 16 cache devices, 2 tiers and some left over for pipelining */
#define OPEN_BUCKETS_COUNT 256
#define WRITE_POINT_COUNT 32