Lines Matching refs:rb

84 	struct ocfs2_refcount_block *rb =  in ocfs2_validate_refcount_block()  local
96 rc = ocfs2_validate_meta_ecc(sb, bh->b_data, &rb->rf_check); in ocfs2_validate_refcount_block()
104 if (!OCFS2_IS_VALID_REFCOUNT_BLOCK(rb)) { in ocfs2_validate_refcount_block()
108 rb->rf_signature); in ocfs2_validate_refcount_block()
112 if (le64_to_cpu(rb->rf_blkno) != bh->b_blocknr) { in ocfs2_validate_refcount_block()
117 (unsigned long long)le64_to_cpu(rb->rf_blkno)); in ocfs2_validate_refcount_block()
121 if (le32_to_cpu(rb->rf_fs_generation) != OCFS2_SB(sb)->fs_generation) { in ocfs2_validate_refcount_block()
126 le32_to_cpu(rb->rf_fs_generation)); in ocfs2_validate_refcount_block()
460 struct ocfs2_refcount_block *rb; in ocfs2_lock_refcount_tree() local
487 rb = (struct ocfs2_refcount_block *)ref_root_bh->b_data; in ocfs2_lock_refcount_tree()
497 if (tree->rf_generation != le32_to_cpu(rb->rf_generation)) { in ocfs2_lock_refcount_tree()
569 struct ocfs2_refcount_block *rb; in ocfs2_create_refcount_tree() local
631 rb = (struct ocfs2_refcount_block *)new_bh->b_data; in ocfs2_create_refcount_tree()
632 memset(rb, 0, inode->i_sb->s_blocksize); in ocfs2_create_refcount_tree()
633 strcpy((void *)rb, OCFS2_REFCOUNT_BLOCK_SIGNATURE); in ocfs2_create_refcount_tree()
634 rb->rf_suballoc_slot = cpu_to_le16(meta_ac->ac_alloc_slot); in ocfs2_create_refcount_tree()
635 rb->rf_suballoc_loc = cpu_to_le64(suballoc_loc); in ocfs2_create_refcount_tree()
636 rb->rf_suballoc_bit = cpu_to_le16(suballoc_bit_start); in ocfs2_create_refcount_tree()
637 rb->rf_fs_generation = cpu_to_le32(osb->fs_generation); in ocfs2_create_refcount_tree()
638 rb->rf_blkno = cpu_to_le64(first_blkno); in ocfs2_create_refcount_tree()
639 rb->rf_count = cpu_to_le32(1); in ocfs2_create_refcount_tree()
640 rb->rf_records.rl_count = in ocfs2_create_refcount_tree()
643 rb->rf_generation = osb->s_next_generation++; in ocfs2_create_refcount_tree()
662 new_tree->rf_generation = le32_to_cpu(rb->rf_generation); in ocfs2_create_refcount_tree()
710 struct ocfs2_refcount_block *rb; in ocfs2_set_refcount_tree() local
743 rb = (struct ocfs2_refcount_block *)ref_root_bh->b_data; in ocfs2_set_refcount_tree()
744 le32_add_cpu(&rb->rf_count, 1); in ocfs2_set_refcount_tree()
771 struct ocfs2_refcount_block *rb; in ocfs2_remove_refcount_tree() local
790 rb = (struct ocfs2_refcount_block *)blk_bh->b_data; in ocfs2_remove_refcount_tree()
796 if (le32_to_cpu(rb->rf_count) == 1) { in ocfs2_remove_refcount_tree()
797 blk = le64_to_cpu(rb->rf_blkno); in ocfs2_remove_refcount_tree()
798 bit = le16_to_cpu(rb->rf_suballoc_bit); in ocfs2_remove_refcount_tree()
799 if (rb->rf_suballoc_loc) in ocfs2_remove_refcount_tree()
800 bg_blkno = le64_to_cpu(rb->rf_suballoc_loc); in ocfs2_remove_refcount_tree()
806 le16_to_cpu(rb->rf_suballoc_slot)); in ocfs2_remove_refcount_tree()
851 le32_add_cpu(&rb->rf_count , -1); in ocfs2_remove_refcount_tree()
854 if (!rb->rf_count) { in ocfs2_remove_refcount_tree()
891 struct ocfs2_refcount_block *rb = in ocfs2_find_refcount_rec_in_rl() local
895 for (; i < le16_to_cpu(rb->rf_records.rl_used); i++) { in ocfs2_find_refcount_rec_in_rl()
896 rec = &rb->rf_records.rl_recs[i]; in ocfs2_find_refcount_rec_in_rl()
914 if (i < le16_to_cpu(rb->rf_records.rl_used) && in ocfs2_find_refcount_rec_in_rl()
1080 struct ocfs2_refcount_block *rb = in ocfs2_get_refcount_rec() local
1083 if (!(le32_to_cpu(rb->rf_flags) & OCFS2_REFCOUNT_TREE_FL)) { in ocfs2_get_refcount_rec()
1091 el = &rb->rf_list; in ocfs2_get_refcount_rec()
1160 ocfs2_refcount_rec_adjacent(struct ocfs2_refcount_block *rb, in ocfs2_refcount_rec_adjacent() argument
1163 if ((rb->rf_records.rl_recs[index].r_refcount == in ocfs2_refcount_rec_adjacent()
1164 rb->rf_records.rl_recs[index + 1].r_refcount) && in ocfs2_refcount_rec_adjacent()
1165 (le64_to_cpu(rb->rf_records.rl_recs[index].r_cpos) + in ocfs2_refcount_rec_adjacent()
1166 le32_to_cpu(rb->rf_records.rl_recs[index].r_clusters) == in ocfs2_refcount_rec_adjacent()
1167 le64_to_cpu(rb->rf_records.rl_recs[index + 1].r_cpos))) in ocfs2_refcount_rec_adjacent()
1174 ocfs2_refcount_rec_contig(struct ocfs2_refcount_block *rb, in ocfs2_refcount_rec_contig() argument
1179 if (index < le16_to_cpu(rb->rf_records.rl_used) - 1) in ocfs2_refcount_rec_contig()
1180 ret = ocfs2_refcount_rec_adjacent(rb, index); in ocfs2_refcount_rec_contig()
1185 tmp = ocfs2_refcount_rec_adjacent(rb, index - 1); in ocfs2_refcount_rec_contig()
1198 static void ocfs2_rotate_refcount_rec_left(struct ocfs2_refcount_block *rb, in ocfs2_rotate_refcount_rec_left() argument
1201 BUG_ON(rb->rf_records.rl_recs[index].r_refcount != in ocfs2_rotate_refcount_rec_left()
1202 rb->rf_records.rl_recs[index+1].r_refcount); in ocfs2_rotate_refcount_rec_left()
1204 le32_add_cpu(&rb->rf_records.rl_recs[index].r_clusters, in ocfs2_rotate_refcount_rec_left()
1205 le32_to_cpu(rb->rf_records.rl_recs[index+1].r_clusters)); in ocfs2_rotate_refcount_rec_left()
1207 if (index < le16_to_cpu(rb->rf_records.rl_used) - 2) in ocfs2_rotate_refcount_rec_left()
1208 memmove(&rb->rf_records.rl_recs[index + 1], in ocfs2_rotate_refcount_rec_left()
1209 &rb->rf_records.rl_recs[index + 2], in ocfs2_rotate_refcount_rec_left()
1211 (le16_to_cpu(rb->rf_records.rl_used) - index - 2)); in ocfs2_rotate_refcount_rec_left()
1213 memset(&rb->rf_records.rl_recs[le16_to_cpu(rb->rf_records.rl_used) - 1], in ocfs2_rotate_refcount_rec_left()
1215 le16_add_cpu(&rb->rf_records.rl_used, -1); in ocfs2_rotate_refcount_rec_left()
1221 static void ocfs2_refcount_rec_merge(struct ocfs2_refcount_block *rb, in ocfs2_refcount_rec_merge() argument
1225 ocfs2_refcount_rec_contig(rb, index); in ocfs2_refcount_rec_merge()
1235 ocfs2_rotate_refcount_rec_left(rb, index); in ocfs2_refcount_rec_merge()
1238 ocfs2_rotate_refcount_rec_left(rb, index); in ocfs2_refcount_rec_merge()
1251 struct ocfs2_refcount_block *rb = in ocfs2_change_refcount_rec() local
1253 struct ocfs2_refcount_list *rl = &rb->rf_records; in ocfs2_change_refcount_rec()
1279 ocfs2_refcount_rec_merge(rb, index); in ocfs2_change_refcount_rec()
1466 struct ocfs2_refcount_block *rb = in ocfs2_divide_leaf_refcount_block() local
1468 struct ocfs2_refcount_list *rl = &rb->rf_records; in ocfs2_divide_leaf_refcount_block()
1674 struct ocfs2_refcount_block *rb = in ocfs2_adjust_refcount_rec() local
1678 if (!(le32_to_cpu(rb->rf_flags) & OCFS2_REFCOUNT_TREE_FL)) in ocfs2_adjust_refcount_rec()
1681 rb = (struct ocfs2_refcount_block *)ref_leaf_bh->b_data; in ocfs2_adjust_refcount_rec()
1682 old_cpos = le32_to_cpu(rb->rf_cpos); in ocfs2_adjust_refcount_rec()
1738 rb->rf_cpos = cpu_to_le32(new_cpos); in ocfs2_adjust_refcount_rec()
1757 struct ocfs2_refcount_block *rb = in ocfs2_insert_refcount_rec() local
1759 struct ocfs2_refcount_list *rf_list = &rb->rf_records; in ocfs2_insert_refcount_rec()
1762 BUG_ON(le32_to_cpu(rb->rf_flags) & OCFS2_REFCOUNT_TREE_FL); in ocfs2_insert_refcount_rec()
1784 rb = (struct ocfs2_refcount_block *)ref_leaf_bh->b_data; in ocfs2_insert_refcount_rec()
1785 rf_list = &rb->rf_records; in ocfs2_insert_refcount_rec()
1811 ocfs2_refcount_rec_merge(rb, index); in ocfs2_insert_refcount_rec()
1847 struct ocfs2_refcount_block *rb = in ocfs2_split_refcount_rec() local
1849 struct ocfs2_refcount_list *rf_list = &rb->rf_records; in ocfs2_split_refcount_rec()
1854 BUG_ON(le32_to_cpu(rb->rf_flags) & OCFS2_REFCOUNT_TREE_FL); in ocfs2_split_refcount_rec()
1914 rb = (struct ocfs2_refcount_block *)ref_leaf_bh->b_data; in ocfs2_split_refcount_rec()
1915 rf_list = &rb->rf_records; in ocfs2_split_refcount_rec()
1982 ocfs2_refcount_rec_merge(rb, index); in ocfs2_split_refcount_rec()
2095 struct ocfs2_refcount_block *rb = in ocfs2_remove_refcount_extent() local
2099 BUG_ON(rb->rf_records.rl_used); in ocfs2_remove_refcount_extent()
2104 le32_to_cpu(rb->rf_cpos)); in ocfs2_remove_refcount_extent()
2107 ret = ocfs2_remove_extent(handle, &et, le32_to_cpu(rb->rf_cpos), in ocfs2_remove_refcount_extent()
2121 le16_to_cpu(rb->rf_suballoc_slot), in ocfs2_remove_refcount_extent()
2122 le64_to_cpu(rb->rf_suballoc_loc), in ocfs2_remove_refcount_extent()
2123 le64_to_cpu(rb->rf_blkno), in ocfs2_remove_refcount_extent()
2124 le16_to_cpu(rb->rf_suballoc_bit)); in ocfs2_remove_refcount_extent()
2137 rb = (struct ocfs2_refcount_block *)ref_root_bh->b_data; in ocfs2_remove_refcount_extent()
2139 le32_add_cpu(&rb->rf_clusters, -1); in ocfs2_remove_refcount_extent()
2145 if (!rb->rf_list.l_next_free_rec) { in ocfs2_remove_refcount_extent()
2146 BUG_ON(rb->rf_clusters); in ocfs2_remove_refcount_extent()
2151 rb->rf_flags = 0; in ocfs2_remove_refcount_extent()
2152 rb->rf_parent = 0; in ocfs2_remove_refcount_extent()
2153 rb->rf_cpos = 0; in ocfs2_remove_refcount_extent()
2154 memset(&rb->rf_records, 0, sb->s_blocksize - in ocfs2_remove_refcount_extent()
2156 rb->rf_records.rl_count = in ocfs2_remove_refcount_extent()
2187 struct ocfs2_refcount_block *rb = in ocfs2_decrease_refcount_rec() local
2189 struct ocfs2_refcount_rec *rec = &rb->rf_records.rl_recs[index]; in ocfs2_decrease_refcount_rec()
2222 if (!rb->rf_records.rl_used && ref_leaf_bh != ref_root_bh) { in ocfs2_decrease_refcount_rec()
2395 struct ocfs2_refcount_block *rb; in ocfs2_calc_refcount_meta_credits() local
2415 rb = (struct ocfs2_refcount_block *) in ocfs2_calc_refcount_meta_credits()
2418 if (le16_to_cpu(rb->rf_records.rl_used) + in ocfs2_calc_refcount_meta_credits()
2420 le16_to_cpu(rb->rf_records.rl_count)) in ocfs2_calc_refcount_meta_credits()
2479 rb = (struct ocfs2_refcount_block *)prev_bh->b_data; in ocfs2_calc_refcount_meta_credits()
2481 if (le16_to_cpu(rb->rf_records.rl_used) + recs_add > in ocfs2_calc_refcount_meta_credits()
2482 le16_to_cpu(rb->rf_records.rl_count)) in ocfs2_calc_refcount_meta_credits()
2501 rb = (struct ocfs2_refcount_block *)ref_root_bh->b_data; in ocfs2_calc_refcount_meta_credits()
2502 if (le32_to_cpu(rb->rf_flags) & OCFS2_REFCOUNT_TREE_FL) { in ocfs2_calc_refcount_meta_credits()
3565 struct ocfs2_refcount_block *rb; in ocfs2_refcounted_xattr_delete_need() local
3592 rb = (struct ocfs2_refcount_block *)ref_leaf_bh->b_data; in ocfs2_refcounted_xattr_delete_need()
3601 if (le16_to_cpu(rb->rf_records.rl_used) + clusters * 2 > in ocfs2_refcounted_xattr_delete_need()
3602 le16_to_cpu(rb->rf_records.rl_count)) in ocfs2_refcounted_xattr_delete_need()
3621 rb = (struct ocfs2_refcount_block *)ref_root_bh->b_data; in ocfs2_refcounted_xattr_delete_need()
3622 if (le32_to_cpu(rb->rf_flags) & OCFS2_REFCOUNT_TREE_FL) in ocfs2_refcounted_xattr_delete_need()
4142 struct ocfs2_refcount_block *rb; in ocfs2_create_reflink_node() local
4169 rb = (struct ocfs2_refcount_block *)ref_root_bh->b_data; in ocfs2_create_reflink_node()