Lines Matching refs:push_items

2824 	int push_items = 0;  in push_node_left()  local
2831 push_items = BTRFS_NODEPTRS_PER_BLOCK(fs_info) - dst_nritems; in push_node_left()
2838 if (push_items <= 0) in push_node_left()
2842 push_items = min(src_nritems, push_items); in push_node_left()
2843 if (push_items < src_nritems) { in push_node_left()
2847 if (src_nritems - push_items < 8) { in push_node_left()
2848 if (push_items <= 8) in push_node_left()
2850 push_items -= 8; in push_node_left()
2854 push_items = min(src_nritems - 8, push_items); in push_node_left()
2862 ret = btrfs_tree_mod_log_eb_copy(dst, src, dst_nritems, 0, push_items); in push_node_left()
2870 push_items * sizeof(struct btrfs_key_ptr)); in push_node_left()
2872 if (push_items < src_nritems) { in push_node_left()
2878 btrfs_node_key_ptr_offset(src, push_items), in push_node_left()
2879 (src_nritems - push_items) * in push_node_left()
2882 btrfs_set_header_nritems(src, src_nritems - push_items); in push_node_left()
2883 btrfs_set_header_nritems(dst, dst_nritems + push_items); in push_node_left()
2904 int push_items = 0; in balance_node_right() local
2915 push_items = BTRFS_NODEPTRS_PER_BLOCK(fs_info) - dst_nritems; in balance_node_right()
2916 if (push_items <= 0) in balance_node_right()
2927 if (max_push < push_items) in balance_node_right()
2928 push_items = max_push; in balance_node_right()
2941 memmove_extent_buffer(dst, btrfs_node_key_ptr_offset(dst, push_items), in balance_node_right()
2946 ret = btrfs_tree_mod_log_eb_copy(dst, src, 0, src_nritems - push_items, in balance_node_right()
2947 push_items); in balance_node_right()
2954 btrfs_node_key_ptr_offset(src, src_nritems - push_items), in balance_node_right()
2955 push_items * sizeof(struct btrfs_key_ptr)); in balance_node_right()
2957 btrfs_set_header_nritems(src, src_nritems - push_items); in balance_node_right()
2958 btrfs_set_header_nritems(dst, dst_nritems + push_items); in balance_node_right()
3246 int push_items = 0; in __push_leaf_right() local
3263 if (!empty && push_items > 0) { in __push_leaf_right()
3282 push_items++; in __push_leaf_right()
3289 if (push_items == 0) in __push_leaf_right()
3292 WARN_ON(!empty && push_items == left_nritems); in __push_leaf_right()
3297 push_space = btrfs_item_data_end(left, left_nritems - push_items); in __push_leaf_right()
3309 memmove_leaf_items(right, push_items, 0, right_nritems); in __push_leaf_right()
3312 copy_leaf_items(right, left, 0, left_nritems - push_items, push_items); in __push_leaf_right()
3316 right_nritems += push_items; in __push_leaf_right()
3324 left_nritems -= push_items; in __push_leaf_right()
3458 int push_items = 0; in __push_leaf_left() local
3472 if (!empty && push_items > 0) { in __push_leaf_left()
3491 push_items++; in __push_leaf_left()
3495 if (push_items == 0) { in __push_leaf_left()
3499 WARN_ON(!empty && push_items == btrfs_header_nritems(right)); in __push_leaf_left()
3502 copy_leaf_items(left, right, btrfs_header_nritems(left), 0, push_items); in __push_leaf_left()
3505 btrfs_item_offset(right, push_items - 1); in __push_leaf_left()
3508 btrfs_item_offset(right, push_items - 1), push_space); in __push_leaf_left()
3514 for (i = old_left_nritems; i < old_left_nritems + push_items; i++) { in __push_leaf_left()
3521 btrfs_set_header_nritems(left, old_left_nritems + push_items); in __push_leaf_left()
3524 if (push_items > right_nritems) in __push_leaf_left()
3525 WARN(1, KERN_CRIT "push items %d nr %u\n", push_items, in __push_leaf_left()
3528 if (push_items < right_nritems) { in __push_leaf_left()
3529 push_space = btrfs_item_offset(right, push_items - 1) - in __push_leaf_left()
3535 memmove_leaf_items(right, 0, push_items, in __push_leaf_left()
3536 btrfs_header_nritems(right) - push_items); in __push_leaf_left()
3540 right_nritems -= push_items; in __push_leaf_left()
3558 if (path->slots[0] < push_items) { in __push_leaf_left()
3567 path->slots[0] -= push_items; in __push_leaf_left()