summaryrefslogtreecommitdiff
path: root/libbcachefs/quota_types.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-01-11 06:41:59 -0500
committerKent Overstreet <kent.overstreet@gmail.com>2018-01-11 07:02:08 -0500
commit4de98a2712764bceb9e0f67b1ac2f2c7862feb77 (patch)
tree94861af51e19af917d80952dfabeaa7a76901eaa /libbcachefs/quota_types.h
parentf8cbede6d18e81c804e62fd7d576310b420dcaac (diff)
Update bcachefs sources to 02ae70070a bcachefs: Allocate new btree roots lazily
Diffstat (limited to 'libbcachefs/quota_types.h')
-rw-r--r--libbcachefs/quota_types.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/libbcachefs/quota_types.h b/libbcachefs/quota_types.h
new file mode 100644
index 00000000..bcaed4ea
--- /dev/null
+++ b/libbcachefs/quota_types.h
@@ -0,0 +1,36 @@
+#ifndef _BCACHEFS_QUOTA_TYPES_H
+#define _BCACHEFS_QUOTA_TYPES_H
+
+#include <linux/generic-radix-tree.h>
+
+struct bch_qid {
+ u32 q[QTYP_NR];
+};
+
+struct memquota_counter {
+ u64 v;
+ u64 hardlimit;
+ u64 softlimit;
+ s64 timer;
+ int warns;
+ int warning_issued;
+};
+
+struct bch_memquota {
+ struct memquota_counter c[Q_COUNTERS];
+};
+
+typedef GENRADIX(struct bch_memquota) bch_memquota_table;
+
+struct quota_limit {
+ u32 timelimit;
+ u32 warnlimit;
+};
+
+struct bch_memquota_type {
+ struct quota_limit limits[Q_COUNTERS];
+ bch_memquota_table table;
+ struct mutex lock;
+};
+
+#endif /* _BCACHEFS_QUOTA_TYPES_H */