Lines Matching refs:bh
148 static int scnprintf_block_head(char *buf, size_t size, struct buffer_head *bh) in scnprintf_block_head() argument
152 B_LEVEL(bh), B_NR_ITEMS(bh), B_FREE_SPACE(bh)); in scnprintf_block_head()
155 static int scnprintf_buffer_head(char *buf, size_t size, struct buffer_head *bh) in scnprintf_buffer_head() argument
159 bh->b_bdev, bh->b_size, in scnprintf_buffer_head()
160 (unsigned long long)bh->b_blocknr, in scnprintf_buffer_head()
161 atomic_read(&(bh->b_count)), in scnprintf_buffer_head()
162 bh->b_state, bh->b_page, in scnprintf_buffer_head()
163 buffer_uptodate(bh) ? "UPTODATE" : "!UPTODATE", in scnprintf_buffer_head()
164 buffer_dirty(bh) ? "DIRTY" : "CLEAN", in scnprintf_buffer_head()
165 buffer_locked(bh) ? "LOCKED" : "UNLOCKED"); in scnprintf_buffer_head()
442 static int print_internal(struct buffer_head *bh, int first, int last) in print_internal() argument
449 if (!B_IS_KEYS_LEVEL(bh)) in print_internal()
452 check_internal(bh); in print_internal()
456 to = B_NR_ITEMS(bh); in print_internal()
459 to = min_t(int, last, B_NR_ITEMS(bh)); in print_internal()
462 reiserfs_printk("INTERNAL NODE (%ld) contains %z\n", bh->b_blocknr, bh); in print_internal()
464 dc = B_N_CHILD(bh, from); in print_internal()
467 for (i = from, key = internal_key(bh, from), dc++; i < to; in print_internal()
477 static int print_leaf(struct buffer_head *bh, int print_mode, int first, in print_leaf() argument
485 if (!B_IS_ITEMS_LEVEL(bh)) in print_leaf()
488 check_leaf(bh); in print_leaf()
490 blkh = B_BLK_HEAD(bh); in print_leaf()
491 ih = item_head(bh, 0); in print_leaf()
496 reiserfs_printk("LEAF NODE (%ld) contains %z\n", bh->b_blocknr, bh); in print_leaf()
524 op_print_item(ih, ih_item_body(bh, ih)); in print_leaf()
546 static int print_super_block(struct buffer_head *bh) in print_super_block() argument
549 (struct reiserfs_super_block *)(bh->b_data); in print_super_block()
564 printk("%pg\'s super block is in block %llu\n", bh->b_bdev, in print_super_block()
565 (unsigned long long)bh->b_blocknr); in print_super_block()
575 skipped = bh->b_blocknr; in print_super_block()
596 static int print_desc_block(struct buffer_head *bh) in print_desc_block() argument
600 if (memcmp(get_journal_desc_magic(bh), JOURNAL_DESC_MAGIC, 8)) in print_desc_block()
603 desc = (struct reiserfs_journal_desc *)(bh->b_data); in print_desc_block()
605 (unsigned long long)bh->b_blocknr, get_desc_trans_id(desc), in print_desc_block()
611 void print_block(struct buffer_head *bh, ...) in print_block() argument
616 if (!bh) { in print_block()
621 va_start(args, bh); in print_block()
626 if (print_leaf(bh, mode, first, last)) in print_block()
627 if (print_internal(bh, first, last)) in print_block()
628 if (print_super_block(bh)) in print_block()
629 if (print_desc_block(bh)) in print_block()
632 (unsigned long long)bh->b_blocknr); in print_block()
731 static void check_leaf_block_head(struct buffer_head *bh) in check_leaf_block_head() argument
736 blkh = B_BLK_HEAD(bh); in check_leaf_block_head()
738 if (nr > (bh->b_size - BLKH_SIZE) / IH_SIZE) in check_leaf_block_head()
740 bh); in check_leaf_block_head()
741 if (blkh_free_space(blkh) > bh->b_size - BLKH_SIZE - IH_SIZE * nr) in check_leaf_block_head()
743 bh); in check_leaf_block_head()
747 static void check_internal_block_head(struct buffer_head *bh) in check_internal_block_head() argument
749 if (!(B_LEVEL(bh) > DISK_LEAF_NODE_LEVEL && B_LEVEL(bh) <= MAX_HEIGHT)) in check_internal_block_head()
750 reiserfs_panic(NULL, "vs-6025", "invalid level %z", bh); in check_internal_block_head()
752 if (B_NR_ITEMS(bh) > (bh->b_size - BLKH_SIZE) / IH_SIZE) in check_internal_block_head()
753 reiserfs_panic(NULL, "vs-6030", "invalid item number %z", bh); in check_internal_block_head()
755 if (B_FREE_SPACE(bh) != in check_internal_block_head()
756 bh->b_size - BLKH_SIZE - KEY_SIZE * B_NR_ITEMS(bh) - in check_internal_block_head()
757 DC_SIZE * (B_NR_ITEMS(bh) + 1)) in check_internal_block_head()
758 reiserfs_panic(NULL, "vs-6040", "invalid free space %z", bh); in check_internal_block_head()
762 void check_leaf(struct buffer_head *bh) in check_leaf() argument
767 if (!bh) in check_leaf()
769 check_leaf_block_head(bh); in check_leaf()
770 for (i = 0, ih = item_head(bh, 0); i < B_NR_ITEMS(bh); i++, ih++) in check_leaf()
771 op_check_item(ih, ih_item_body(bh, ih)); in check_leaf()
774 void check_internal(struct buffer_head *bh) in check_internal() argument
776 if (!bh) in check_internal()
778 check_internal_block_head(bh); in check_internal()