Lines Matching refs:bh
19 inline int B_IS_IN_TREE(const struct buffer_head *bh) in B_IS_IN_TREE() argument
22 RFALSE(B_LEVEL(bh) > MAX_HEIGHT, in B_IS_IN_TREE()
23 "PAP-1010: block (%b) has too big level (%z)", bh, bh); in B_IS_IN_TREE()
25 return (B_LEVEL(bh) != FREE_LEVEL); in B_IS_IN_TREE()
367 struct buffer_head *bh; in pathrelse_and_restore() local
368 bh = PATH_OFFSET_PBUFFER(search_path, path_offset--); in pathrelse_and_restore()
369 reiserfs_restore_prepared_buffer(sb, bh); in pathrelse_and_restore()
370 brelse(bh); in pathrelse_and_restore()
389 static int is_leaf(char *buf, int blocksize, struct buffer_head *bh) in is_leaf() argument
409 "nr_item seems wrong: %z", bh); in is_leaf()
418 "free space seems wrong: %z", bh); in is_leaf()
464 static int is_internal(char *buf, int blocksize, struct buffer_head *bh) in is_internal() argument
483 "number of key seems wrong: %z", bh); in is_internal()
490 "free space seems wrong: %z", bh); in is_internal()
502 static int is_tree_node(struct buffer_head *bh, int level) in is_tree_node() argument
504 if (B_LEVEL(bh) != level) { in is_tree_node()
507 B_LEVEL(bh), level); in is_tree_node()
511 return is_leaf(bh->b_data, bh->b_size, bh); in is_tree_node()
513 return is_internal(bh->b_data, bh->b_size, bh); in is_tree_node()
529 struct buffer_head **bh, in search_by_key_reada() argument
536 bh[i] = sb_getblk(s, b[i]); in search_by_key_reada()
551 if (!buffer_uptodate(bh[j])) { in search_by_key_reada()
554 ll_rw_block(READA, 1, bh + j); in search_by_key_reada()
556 brelse(bh[j]); in search_by_key_reada()
592 struct buffer_head *bh; in search_by_key() local
646 if ((bh = last_element->pe_buffer = in search_by_key()
656 if (!buffer_uptodate(bh) && reada_count > 1) in search_by_key()
660 if (!buffer_uptodate(bh) && depth == -1) in search_by_key()
663 ll_rw_block(READ, 1, &bh); in search_by_key()
664 wait_on_buffer(bh); in search_by_key()
668 if (!buffer_uptodate(bh)) in search_by_key()
688 (!B_IS_IN_TREE(bh) || in search_by_key()
689 B_LEVEL(bh) != expected_level || in search_by_key()
729 if (!is_tree_node(bh, expected_level)) { in search_by_key()
732 "Fsck?", bh->b_blocknr); in search_by_key()
738 node_level = B_LEVEL(bh); in search_by_key()
740 PROC_INFO_BH_STAT(sb, bh, node_level - 1); in search_by_key()
746 retval = bin_search(key, item_head(bh, 0), in search_by_key()
747 B_NR_ITEMS(bh), in search_by_key()
776 B_N_CHILD_NUM(bh, last_element->pe_position); in search_by_key()
785 int limit = B_NR_ITEMS(bh); in search_by_key()
794 B_N_CHILD_NUM(bh, pos); in search_by_key()
803 le_key = internal_key(bh, pos); in search_by_key()
908 struct buffer_head *bh = PATH_PLAST_BUFFER(path); in comp_items() local
912 if (!B_IS_IN_TREE(bh)) in comp_items()
916 if (PATH_LAST_POSITION(path) >= B_NR_ITEMS(bh)) in comp_items()
925 #define held_by_others(bh) (atomic_read(&(bh)->b_count) > 1) argument
928 #define block_in_use(bh) (buffer_locked(bh) || (held_by_others(bh))) argument
1033 struct buffer_head *bh = PATH_PLAST_BUFFER(path); in prepare_for_delete_or_cut() local
1079 bh = PATH_PLAST_BUFFER(path); in prepare_for_delete_or_cut()
1097 unfm = (__le32 *)ih_item_body(bh, &s_ih) + pos - 1; in prepare_for_delete_or_cut()
1101 reiserfs_prepare_for_journal(sb, bh, 1); in prepare_for_delete_or_cut()
1103 journal_mark_dirty(th, bh); in prepare_for_delete_or_cut()
1129 reiserfs_restore_prepared_buffer(sb, bh); in prepare_for_delete_or_cut()
1506 struct buffer_head *bh; in unmap_buffers() local
1517 bh = head; in unmap_buffers()
1519 next = bh->b_this_page; in unmap_buffers()
1529 cur_index += bh->b_size; in unmap_buffers()
1531 reiserfs_unmap_buffer(bh); in unmap_buffers()
1533 bh = next; in unmap_buffers()
1534 } while (bh != head); in unmap_buffers()