]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/btree_types.h
Disable pristine-tar option in gbp.conf, since there is no pristine-tar branch.
[bcachefs-tools-debian] / libbcachefs / btree_types.h
index d530307046f4cf93bdb4c4063409a9fff5e705c4..b2ebf143c3b7d648f3fe0a90d5f046b7c854323f 100644 (file)
@@ -2,12 +2,13 @@
 #ifndef _BCACHEFS_BTREE_TYPES_H
 #define _BCACHEFS_BTREE_TYPES_H
 
+#include <linux/darray_types.h>
 #include <linux/list.h>
 #include <linux/rhashtable.h>
 
+#include "bbpos_types.h"
 #include "btree_key_cache_types.h"
 #include "buckets_types.h"
-#include "darray.h"
 #include "errcode.h"
 #include "journal_types.h"
 #include "replicas_types.h"
@@ -173,6 +174,11 @@ struct btree_cache {
         */
        struct task_struct      *alloc_lock;
        struct closure_waitlist alloc_wait;
+
+       struct bbpos            pinned_nodes_start;
+       struct bbpos            pinned_nodes_end;
+       u64                     pinned_nodes_leaf_mask;
+       u64                     pinned_nodes_interior_mask;
 };
 
 struct btree_node_iter {
@@ -430,6 +436,9 @@ struct btree_trans {
        struct journal_res      journal_res;
        u64                     *journal_seq;
        struct disk_reservation *disk_res;
+
+       struct bch_fs_usage_base fs_usage_delta;
+
        unsigned                journal_u64s;
        unsigned                extra_disk_res; /* XXX kill */
        struct replicas_delta_list *fs_usage_deltas;
@@ -651,9 +660,10 @@ const char *bch2_btree_node_type_str(enum btree_node_type);
         BIT_ULL(BKEY_TYPE_inodes)|                     \
         BIT_ULL(BKEY_TYPE_stripes)|                    \
         BIT_ULL(BKEY_TYPE_reflink)|                    \
+        BIT_ULL(BKEY_TYPE_subvolumes)|                 \
         BIT_ULL(BKEY_TYPE_btree))
 
-#define BTREE_NODE_TYPE_HAS_MEM_TRIGGERS               \
+#define BTREE_NODE_TYPE_HAS_ATOMIC_TRIGGERS            \
        (BIT_ULL(BKEY_TYPE_alloc)|                      \
         BIT_ULL(BKEY_TYPE_inodes)|                     \
         BIT_ULL(BKEY_TYPE_stripes)|                    \
@@ -661,7 +671,7 @@ const char *bch2_btree_node_type_str(enum btree_node_type);
 
 #define BTREE_NODE_TYPE_HAS_TRIGGERS                   \
        (BTREE_NODE_TYPE_HAS_TRANS_TRIGGERS|            \
-        BTREE_NODE_TYPE_HAS_MEM_TRIGGERS)
+        BTREE_NODE_TYPE_HAS_ATOMIC_TRIGGERS)
 
 static inline bool btree_node_type_needs_gc(enum btree_node_type type)
 {
@@ -724,7 +734,7 @@ struct btree_root {
        __BKEY_PADDED(key, BKEY_BTREE_PTR_VAL_U64s_MAX);
        u8                      level;
        u8                      alive;
-       s                     error;
+       s16                     error;
 };
 
 enum btree_gc_coalesce_fail_reason {
@@ -738,4 +748,9 @@ enum btree_node_sibling {
        btree_next_sib,
 };
 
+struct get_locks_fail {
+       unsigned        l;
+       struct btree    *b;
+};
+
 #endif /* _BCACHEFS_BTREE_TYPES_H */