btree.h (487dded86ea065317aea121bec8f1816f2f235c9) | btree.h (2a285686c109816ba71a00b9278262cf02648258) |
---|---|
1#ifndef _BCACHE_BTREE_H 2#define _BCACHE_BTREE_H 3 4/* 5 * THE BTREE: 6 * 7 * At a high level, bcache's btree is relatively standard b+ tree. All keys and 8 * pointers are in the leaves; interior nodes only have pointers to the child --- 113 unchanged lines hidden (view full) --- 122 123 /* Single bit - set when accessed, cleared by shrinker */ 124 unsigned long accessed; 125 unsigned long seq; 126 struct rw_semaphore lock; 127 struct cache_set *c; 128 struct btree *parent; 129 | 1#ifndef _BCACHE_BTREE_H 2#define _BCACHE_BTREE_H 3 4/* 5 * THE BTREE: 6 * 7 * At a high level, bcache's btree is relatively standard b+ tree. All keys and 8 * pointers are in the leaves; interior nodes only have pointers to the child --- 113 unchanged lines hidden (view full) --- 122 123 /* Single bit - set when accessed, cleared by shrinker */ 124 unsigned long accessed; 125 unsigned long seq; 126 struct rw_semaphore lock; 127 struct cache_set *c; 128 struct btree *parent; 129 |
130 struct mutex write_lock; 131 |
|
130 unsigned long flags; 131 uint16_t written; /* would be nice to kill */ 132 uint8_t level; 133 134 struct btree_keys keys; 135 136 /* For outstanding btree writes, used as a lock - protects write_idx */ 137 struct closure io; --- 93 unchanged lines hidden (view full) --- 231static inline void rw_unlock(bool w, struct btree *b) 232{ 233 if (w) 234 b->seq++; 235 (w ? up_write : up_read)(&b->lock); 236} 237 238void bch_btree_node_read_done(struct btree *); | 132 unsigned long flags; 133 uint16_t written; /* would be nice to kill */ 134 uint8_t level; 135 136 struct btree_keys keys; 137 138 /* For outstanding btree writes, used as a lock - protects write_idx */ 139 struct closure io; --- 93 unchanged lines hidden (view full) --- 233static inline void rw_unlock(bool w, struct btree *b) 234{ 235 if (w) 236 b->seq++; 237 (w ? up_write : up_read)(&b->lock); 238} 239 240void bch_btree_node_read_done(struct btree *); |
241void __bch_btree_node_write(struct btree *, struct closure *); |
|
239void bch_btree_node_write(struct btree *, struct closure *); 240 241void bch_btree_set_root(struct btree *); 242struct btree *bch_btree_node_alloc(struct cache_set *, int, bool); 243struct btree *bch_btree_node_get(struct cache_set *, struct bkey *, int, bool); 244 245int bch_btree_insert_check_key(struct btree *, struct btree_op *, 246 struct bkey *); --- 59 unchanged lines hidden --- | 242void bch_btree_node_write(struct btree *, struct closure *); 243 244void bch_btree_set_root(struct btree *); 245struct btree *bch_btree_node_alloc(struct cache_set *, int, bool); 246struct btree *bch_btree_node_get(struct cache_set *, struct bkey *, int, bool); 247 248int bch_btree_insert_check_key(struct btree *, struct btree_op *, 249 struct bkey *); --- 59 unchanged lines hidden --- |