Lines Matching full:level

41 					 unsigned level)  in btree_node_locked_type()  argument
43 return BTREE_NODE_UNLOCKED + ((path->nodes_locked >> (level << 1)) & 3); in btree_node_locked_type()
61 static inline bool btree_node_locked(struct btree_path *path, unsigned level) in btree_node_locked() argument
63 return btree_node_locked_type(path, level) != BTREE_NODE_UNLOCKED; in btree_node_locked()
67 unsigned level, in mark_btree_node_locked_noreset() argument
74 path->nodes_locked &= ~(3U << (level << 1)); in mark_btree_node_locked_noreset()
75 path->nodes_locked |= (type + 1) << (level << 1); in mark_btree_node_locked_noreset()
79 unsigned level) in mark_btree_node_unlocked() argument
81 EBUG_ON(btree_node_write_locked(path, level)); in mark_btree_node_unlocked()
82 mark_btree_node_locked_noreset(path, level, BTREE_NODE_UNLOCKED); in mark_btree_node_unlocked()
87 unsigned level, in mark_btree_node_locked() argument
90 mark_btree_node_locked_noreset(path, level, (enum btree_node_locked_type) type); in mark_btree_node_locked()
92 path->l[level].lock_taken_time = local_clock(); in mark_btree_node_locked()
96 static inline enum six_lock_type __btree_lock_want(struct btree_path *path, int level) in __btree_lock_want() argument
98 return level < path->locks_want in __btree_lock_want()
104 btree_lock_want(struct btree_path *path, int level) in btree_lock_want() argument
106 if (level < path->level) in btree_lock_want()
108 if (level < path->locks_want) in btree_lock_want()
110 if (level == path->level) in btree_lock_want()
116 struct btree_path *path, unsigned level) in btree_trans_lock_hold_time_update() argument
120 path->l[level].lock_taken_time, in btree_trans_lock_hold_time_update()
128 struct btree_path *path, unsigned level) in btree_node_unlock() argument
130 int lock_type = btree_node_locked_type(path, level); in btree_node_unlock()
132 EBUG_ON(level >= BTREE_MAX_DEPTH); in btree_node_unlock()
136 six_unlock_type(&path->l[level].b->c.lock, lock_type); in btree_node_unlock()
137 btree_trans_lock_hold_time_update(trans, path, level); in btree_node_unlock()
139 mark_btree_node_unlocked(path, level); in btree_node_unlock()
172 EBUG_ON(path->l[b->c.level].b != b); in bch2_btree_node_unlock_write_inlined()
173 EBUG_ON(path->l[b->c.level].lock_seq != six_lock_seq(&b->c.lock)); in bch2_btree_node_unlock_write_inlined()
174 EBUG_ON(btree_node_locked_type(path, b->c.level) != SIX_LOCK_write); in bch2_btree_node_unlock_write_inlined()
176 mark_btree_node_locked_noreset(path, b->c.level, BTREE_NODE_INTENT_LOCKED); in bch2_btree_node_unlock_write_inlined()
179 linked->l[b->c.level].lock_seq++; in bch2_btree_node_unlock_write_inlined()
259 unsigned level, in btree_node_lock_increment() argument
266 if (&path->l[level].b->c == b && in btree_node_lock_increment()
267 btree_node_locked_type(path, level) >= want) { in btree_node_lock_increment()
278 unsigned level, in btree_node_lock() argument
284 EBUG_ON(level >= BTREE_MAX_DEPTH); in btree_node_lock()
288 btree_node_lock_increment(trans, b, level, (enum btree_node_locked_type) type) || in btree_node_lock()
291 path->l[b->level].lock_taken_time = local_clock(); in btree_node_lock()
306 EBUG_ON(&path->l[b->level].b->c != b); in __btree_node_lock_write()
307 EBUG_ON(path->l[b->level].lock_seq != six_lock_seq(&b->lock)); in __btree_node_lock_write()
308 EBUG_ON(!btree_node_intent_locked(path, b->level)); in __btree_node_lock_write()
315 mark_btree_node_locked_noreset(path, b->level, BTREE_NODE_WRITE_LOCKED); in __btree_node_lock_write()
343 return btree_node_locked(path, path->level) in bch2_btree_path_relock()
351 struct btree_path *path, unsigned level) in bch2_btree_node_relock() argument
353 EBUG_ON(btree_node_locked(path, level) && in bch2_btree_node_relock()
354 !btree_node_write_locked(path, level) && in bch2_btree_node_relock()
355 btree_node_locked_type(path, level) != __btree_lock_want(path, level)); in bch2_btree_node_relock()
357 return likely(btree_node_locked(path, level)) || in bch2_btree_node_relock()
358 (!IS_ERR_OR_NULL(path->l[level].b) && in bch2_btree_node_relock()
359 __bch2_btree_node_relock(trans, path, level, true)); in bch2_btree_node_relock()
363 struct btree_path *path, unsigned level) in bch2_btree_node_relock_notrace() argument
365 EBUG_ON(btree_node_locked(path, level) && in bch2_btree_node_relock_notrace()
366 !btree_node_write_locked(path, level) && in bch2_btree_node_relock_notrace()
367 btree_node_locked_type(path, level) != __btree_lock_want(path, level)); in bch2_btree_node_relock_notrace()
369 return likely(btree_node_locked(path, level)) || in bch2_btree_node_relock_notrace()
370 (!IS_ERR_OR_NULL(path->l[level].b) && in bch2_btree_node_relock_notrace()
371 __bch2_btree_node_relock(trans, path, level, false)); in bch2_btree_node_relock_notrace()
407 EBUG_ON(!btree_node_locked(path, path->level)); in btree_path_set_should_be_locked()
425 __btree_path_set_level_up(trans, path, path->level++); in btree_path_set_level_up()