Lines Matching refs:push_items
2711 int push_items = 0; in push_node_left() local
2718 push_items = BTRFS_NODEPTRS_PER_BLOCK(fs_info) - dst_nritems; in push_node_left()
2725 if (push_items <= 0) in push_node_left()
2729 push_items = min(src_nritems, push_items); in push_node_left()
2730 if (push_items < src_nritems) { in push_node_left()
2734 if (src_nritems - push_items < 8) { in push_node_left()
2735 if (push_items <= 8) in push_node_left()
2737 push_items -= 8; in push_node_left()
2741 push_items = min(src_nritems - 8, push_items); in push_node_left()
2749 ret = btrfs_tree_mod_log_eb_copy(dst, src, dst_nritems, 0, push_items); in push_node_left()
2757 push_items * sizeof(struct btrfs_key_ptr)); in push_node_left()
2759 if (push_items < src_nritems) { in push_node_left()
2765 btrfs_node_key_ptr_offset(src, push_items), in push_node_left()
2766 (src_nritems - push_items) * in push_node_left()
2769 btrfs_set_header_nritems(src, src_nritems - push_items); in push_node_left()
2770 btrfs_set_header_nritems(dst, dst_nritems + push_items); in push_node_left()
2791 int push_items = 0; in balance_node_right() local
2802 push_items = BTRFS_NODEPTRS_PER_BLOCK(fs_info) - dst_nritems; in balance_node_right()
2803 if (push_items <= 0) in balance_node_right()
2814 if (max_push < push_items) in balance_node_right()
2815 push_items = max_push; in balance_node_right()
2828 memmove_extent_buffer(dst, btrfs_node_key_ptr_offset(dst, push_items), in balance_node_right()
2833 ret = btrfs_tree_mod_log_eb_copy(dst, src, 0, src_nritems - push_items, in balance_node_right()
2834 push_items); in balance_node_right()
2841 btrfs_node_key_ptr_offset(src, src_nritems - push_items), in balance_node_right()
2842 push_items * sizeof(struct btrfs_key_ptr)); in balance_node_right()
2844 btrfs_set_header_nritems(src, src_nritems - push_items); in balance_node_right()
2845 btrfs_set_header_nritems(dst, dst_nritems + push_items); in balance_node_right()
3136 int push_items = 0; in __push_leaf_right() local
3153 if (!empty && push_items > 0) { in __push_leaf_right()
3172 push_items++; in __push_leaf_right()
3179 if (push_items == 0) in __push_leaf_right()
3182 WARN_ON(!empty && push_items == left_nritems); in __push_leaf_right()
3187 push_space = btrfs_item_data_end(left, left_nritems - push_items); in __push_leaf_right()
3199 memmove_leaf_items(right, push_items, 0, right_nritems); in __push_leaf_right()
3202 copy_leaf_items(right, left, 0, left_nritems - push_items, push_items); in __push_leaf_right()
3206 right_nritems += push_items; in __push_leaf_right()
3214 left_nritems -= push_items; in __push_leaf_right()
3348 int push_items = 0; in __push_leaf_left() local
3362 if (!empty && push_items > 0) { in __push_leaf_left()
3381 push_items++; in __push_leaf_left()
3385 if (push_items == 0) { in __push_leaf_left()
3389 WARN_ON(!empty && push_items == btrfs_header_nritems(right)); in __push_leaf_left()
3392 copy_leaf_items(left, right, btrfs_header_nritems(left), 0, push_items); in __push_leaf_left()
3395 btrfs_item_offset(right, push_items - 1); in __push_leaf_left()
3398 btrfs_item_offset(right, push_items - 1), push_space); in __push_leaf_left()
3404 for (i = old_left_nritems; i < old_left_nritems + push_items; i++) { in __push_leaf_left()
3411 btrfs_set_header_nritems(left, old_left_nritems + push_items); in __push_leaf_left()
3414 if (push_items > right_nritems) in __push_leaf_left()
3415 WARN(1, KERN_CRIT "push items %d nr %u\n", push_items, in __push_leaf_left()
3418 if (push_items < right_nritems) { in __push_leaf_left()
3419 push_space = btrfs_item_offset(right, push_items - 1) - in __push_leaf_left()
3425 memmove_leaf_items(right, 0, push_items, in __push_leaf_left()
3426 btrfs_header_nritems(right) - push_items); in __push_leaf_left()
3430 right_nritems -= push_items; in __push_leaf_left()
3448 if (path->slots[0] < push_items) { in __push_leaf_left()
3457 path->slots[0] -= push_items; in __push_leaf_left()