Lines Matching refs:nritems

603 		       int nritems)  in __tree_mod_log_free_eb()  argument
608 for (i = nritems - 1; i >= 0; i--) { in __tree_mod_log_free_eb()
611 for (j = nritems - 1; j > i; j--) in __tree_mod_log_free_eb()
627 int nritems = 0; in tree_mod_log_insert_root() local
635 nritems = btrfs_header_nritems(old_root); in tree_mod_log_insert_root()
636 tm_list = kcalloc(nritems, sizeof(struct tree_mod_elem *), in tree_mod_log_insert_root()
642 for (i = 0; i < nritems; i++) { in tree_mod_log_insert_root()
668 ret = __tree_mod_log_free_eb(fs_info, tm_list, nritems); in tree_mod_log_insert_root()
681 for (i = 0; i < nritems; i++) in tree_mod_log_insert_root()
829 int nritems = 0; in tree_mod_log_free_eb() local
839 nritems = btrfs_header_nritems(eb); in tree_mod_log_free_eb()
840 tm_list = kcalloc(nritems, sizeof(struct tree_mod_elem *), GFP_NOFS); in tree_mod_log_free_eb()
844 for (i = 0; i < nritems; i++) { in tree_mod_log_free_eb()
856 ret = __tree_mod_log_free_eb(eb->fs_info, tm_list, nritems); in tree_mod_log_free_eb()
865 for (i = 0; i < nritems; i++) in tree_mod_log_free_eb()
2253 u32 nritems; in reada_for_search() local
2280 nritems = btrfs_header_nritems(node); in reada_for_search()
2290 if (nr >= nritems) in reada_for_search()
2314 int nritems; in reada_for_balance() local
2325 nritems = btrfs_header_nritems(parent); in reada_for_balance()
2341 if (slot + 1 < nritems) { in reada_for_balance()
2389 u32 nritems; in unlock_up() local
2391 nritems = btrfs_header_nritems(t); in unlock_up()
2392 if (nritems < 1 || path->slots[i] >= nritems - 1) { in unlock_up()
3499 int nritems; in insert_ptr() local
3505 nritems = btrfs_header_nritems(lower); in insert_ptr()
3506 BUG_ON(slot > nritems); in insert_ptr()
3507 BUG_ON(nritems == BTRFS_NODEPTRS_PER_BLOCK(fs_info)); in insert_ptr()
3508 if (slot != nritems) { in insert_ptr()
3511 nritems - slot); in insert_ptr()
3517 (nritems - slot) * sizeof(struct btrfs_key_ptr)); in insert_ptr()
3528 btrfs_set_header_nritems(lower, nritems + 1); in insert_ptr()
3636 int nritems = btrfs_header_nritems(l); in leaf_space_used() local
3637 int end = min(nritems, start + nr) - 1; in leaf_space_used()
3660 int nritems = btrfs_header_nritems(leaf); in btrfs_leaf_free_space() local
3663 ret = BTRFS_LEAF_DATA_SIZE(fs_info) - leaf_space_used(leaf, 0, nritems); in btrfs_leaf_free_space()
3669 leaf_space_used(leaf, 0, nritems), nritems); in btrfs_leaf_free_space()
4135 int slot, int mid, int nritems) in copy_for_split() argument
4145 nritems = nritems - mid; in copy_for_split()
4146 btrfs_set_header_nritems(right, nritems); in copy_for_split()
4151 nritems * sizeof(struct btrfs_item)); in copy_for_split()
4160 for (i = 0; i < nritems; i++) { in copy_for_split()
4211 u32 nritems; in push_for_double_split() local
4229 nritems = btrfs_header_nritems(path->nodes[0]); in push_for_double_split()
4234 if (path->slots[0] == 0 || path->slots[0] == nritems) in push_for_double_split()
4271 u32 nritems; in split_leaf() local
4325 nritems = btrfs_header_nritems(l); in split_leaf()
4326 mid = (nritems + 1) / 2; in split_leaf()
4329 if (nritems == 1 || in split_leaf()
4330 leaf_space_used(l, mid, nritems - mid) + data_size > in split_leaf()
4332 if (slot >= nritems) { in split_leaf()
4336 if (mid != nritems && in split_leaf()
4337 leaf_space_used(l, mid, nritems - mid) + in split_leaf()
4354 if (mid != nritems && in split_leaf()
4355 leaf_space_used(l, mid, nritems - mid) + in split_leaf()
4406 copy_for_split(trans, fs_info, path, l, right, slot, mid, nritems); in split_leaf()
4502 u32 nritems; in split_item() local
4524 nritems = btrfs_header_nritems(leaf); in split_item()
4525 if (slot != nritems) { in split_item()
4529 (nritems - slot) * sizeof(struct btrfs_item)); in split_item()
4544 btrfs_set_header_nritems(leaf, nritems + 1); in split_item()
4641 u32 nritems; in btrfs_truncate_item() local
4658 nritems = btrfs_header_nritems(leaf); in btrfs_truncate_item()
4666 BUG_ON(slot >= nritems); in btrfs_truncate_item()
4672 for (i = slot; i < nritems; i++) { in btrfs_truncate_item()
4740 u32 nritems; in btrfs_extend_item() local
4751 nritems = btrfs_header_nritems(leaf); in btrfs_extend_item()
4762 if (slot >= nritems) { in btrfs_extend_item()
4765 slot, nritems); in btrfs_extend_item()
4773 for (i = slot; i < nritems; i++) { in btrfs_extend_item()
4811 u32 nritems; in setup_items_for_insert() local
4829 nritems = btrfs_header_nritems(leaf); in setup_items_for_insert()
4839 if (slot != nritems) { in setup_items_for_insert()
4852 for (i = slot; i < nritems; i++) { in setup_items_for_insert()
4863 (nritems - slot) * sizeof(struct btrfs_item)); in setup_items_for_insert()
4883 btrfs_set_header_nritems(leaf, nritems + nr); in setup_items_for_insert()
4963 u32 nritems; in del_ptr() local
4966 nritems = btrfs_header_nritems(parent); in del_ptr()
4967 if (slot != nritems - 1) { in del_ptr()
4970 nritems - slot - 1); in del_ptr()
4977 (nritems - slot - 1)); in del_ptr()
4984 nritems--; in del_ptr()
4985 btrfs_set_header_nritems(parent, nritems); in del_ptr()
4986 if (nritems == 0 && parent == root->node) { in del_ptr()
5044 u32 nritems; in btrfs_del_items() local
5055 nritems = btrfs_header_nritems(leaf); in btrfs_del_items()
5057 if (slot + nr != nritems) { in btrfs_del_items()
5065 for (i = slot + nr; i < nritems; i++) { in btrfs_del_items()
5077 (nritems - slot - nr)); in btrfs_del_items()
5079 btrfs_set_header_nritems(leaf, nritems - nr); in btrfs_del_items()
5080 nritems -= nr; in btrfs_del_items()
5083 if (nritems == 0) { in btrfs_del_items()
5092 int used = leaf_space_used(leaf, 0, nritems); in btrfs_del_items()
5253 u32 nritems; in btrfs_search_forward() local
5271 nritems = btrfs_header_nritems(cur); in btrfs_search_forward()
5277 if (slot >= nritems) in btrfs_search_forward()
5290 while (slot < nritems) { in btrfs_search_forward()
5305 if (slot >= nritems) { in btrfs_search_forward()
5369 int nritems; in tree_move_next_or_upnext() local
5370 nritems = btrfs_header_nritems(path->nodes[*level]); in tree_move_next_or_upnext()
5374 while (path->slots[*level] >= nritems) { in tree_move_next_or_upnext()
5385 nritems = btrfs_header_nritems(path->nodes[*level]); in tree_move_next_or_upnext()
5810 u32 nritems; in btrfs_next_old_leaf() local
5815 nritems = btrfs_header_nritems(path->nodes[0]); in btrfs_next_old_leaf()
5816 if (nritems == 0) in btrfs_next_old_leaf()
5819 btrfs_item_key_to_cpu(path->nodes[0], &key, nritems - 1); in btrfs_next_old_leaf()
5838 nritems = btrfs_header_nritems(path->nodes[0]); in btrfs_next_old_leaf()
5845 if (nritems > 0 && path->slots[0] < nritems - 1) { in btrfs_next_old_leaf()
5865 if (nritems > 0 && ret > 0 && path->slots[0] == nritems - 1) { in btrfs_next_old_leaf()
5987 u32 nritems; in btrfs_previous_item() local
6000 nritems = btrfs_header_nritems(leaf); in btrfs_previous_item()
6001 if (nritems == 0) in btrfs_previous_item()
6003 if (path->slots[0] == nritems) in btrfs_previous_item()
6029 u32 nritems; in btrfs_previous_extent_item() local
6042 nritems = btrfs_header_nritems(leaf); in btrfs_previous_extent_item()
6043 if (nritems == 0) in btrfs_previous_extent_item()
6045 if (path->slots[0] == nritems) in btrfs_previous_extent_item()