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