]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/btree_types.h
Update bcachefs sources to 95ff72a6c1 fixup! mm: Centralize & improve oom reporting...
[bcachefs-tools-debian] / libbcachefs / btree_types.h
index d8f92cc96c4f8b75a79eb4188007d42b5186560e..1e4d1fecc6bd336539025e15d7de80b3f50028a0 100644 (file)
@@ -301,6 +301,11 @@ struct btree_iter {
 #endif
 };
 
+struct btree_key_cache_freelist {
+       struct bkey_cached      *objs[16];
+       unsigned                nr;
+};
+
 struct btree_key_cache {
        struct mutex            lock;
        struct rhashtable       table;
@@ -308,8 +313,9 @@ struct btree_key_cache {
        struct list_head        freed;
        struct shrinker         shrink;
        unsigned                shrink_iter;
+       struct btree_key_cache_freelist __percpu *pcpu_freed;
 
-       size_t                  nr_freed;
+       atomic_long_t           nr_freed;
        atomic_long_t           nr_keys;
        atomic_long_t           nr_dirty;
 };
@@ -376,7 +382,7 @@ struct btree_trans_commit_hook {
        struct btree_trans_commit_hook  *next;
 };
 
-#define BTREE_TRANS_MEM_MAX    (1U << 14)
+#define BTREE_TRANS_MEM_MAX    (1U << 16)
 
 struct btree_trans {
        struct bch_fs           *c;
@@ -388,7 +394,7 @@ struct btree_trans {
        u8                      locking_btree_id;
        u8                      locking_level;
        u8                      locking_lock_type;
-       pid_t                   pid;
+       struct task_struct      *task;
        int                     srcu_idx;
 
        u8                      nr_sorted;
@@ -638,6 +644,11 @@ static inline bool btree_type_has_snapshots(enum btree_id id)
        return (1 << id) & BTREE_ID_HAS_SNAPSHOTS;
 }
 
+static inline bool btree_type_has_ptrs(enum btree_id id)
+{
+       return (1 << id) & BTREE_ID_HAS_PTRS;
+}
+
 static inline bool btree_node_type_needs_gc(enum btree_node_type type)
 {
        return BTREE_NODE_TYPE_HAS_TRIGGERS & (1U << type);