Lines Matching refs:push_items
2544 int push_items = 0; in push_node_left() local
2551 push_items = BTRFS_NODEPTRS_PER_BLOCK(fs_info) - dst_nritems; in push_node_left()
2558 if (push_items <= 0) in push_node_left()
2562 push_items = min(src_nritems, push_items); in push_node_left()
2563 if (push_items < src_nritems) { in push_node_left()
2567 if (src_nritems - push_items < 8) { in push_node_left()
2568 if (push_items <= 8) in push_node_left()
2570 push_items -= 8; in push_node_left()
2574 push_items = min(src_nritems - 8, push_items); in push_node_left()
2582 ret = btrfs_tree_mod_log_eb_copy(dst, src, dst_nritems, 0, push_items); in push_node_left()
2590 push_items * sizeof(struct btrfs_key_ptr)); in push_node_left()
2592 if (push_items < src_nritems) { in push_node_left()
2598 btrfs_node_key_ptr_offset(push_items), in push_node_left()
2599 (src_nritems - push_items) * in push_node_left()
2602 btrfs_set_header_nritems(src, src_nritems - push_items); in push_node_left()
2603 btrfs_set_header_nritems(dst, dst_nritems + push_items); in push_node_left()
2624 int push_items = 0; in balance_node_right() local
2635 push_items = BTRFS_NODEPTRS_PER_BLOCK(fs_info) - dst_nritems; in balance_node_right()
2636 if (push_items <= 0) in balance_node_right()
2647 if (max_push < push_items) in balance_node_right()
2648 push_items = max_push; in balance_node_right()
2656 ret = btrfs_tree_mod_log_insert_move(dst, push_items, 0, dst_nritems); in balance_node_right()
2658 memmove_extent_buffer(dst, btrfs_node_key_ptr_offset(push_items), in balance_node_right()
2663 ret = btrfs_tree_mod_log_eb_copy(dst, src, 0, src_nritems - push_items, in balance_node_right()
2664 push_items); in balance_node_right()
2671 btrfs_node_key_ptr_offset(src_nritems - push_items), in balance_node_right()
2672 push_items * sizeof(struct btrfs_key_ptr)); in balance_node_right()
2674 btrfs_set_header_nritems(src, src_nritems - push_items); in balance_node_right()
2675 btrfs_set_header_nritems(dst, dst_nritems + push_items); in balance_node_right()
2942 int push_items = 0; in __push_leaf_right() local
2959 if (!empty && push_items > 0) { in __push_leaf_right()
2978 push_items++; in __push_leaf_right()
2985 if (push_items == 0) in __push_leaf_right()
2988 WARN_ON(!empty && push_items == left_nritems); in __push_leaf_right()
2993 push_space = btrfs_item_data_end(left, left_nritems - push_items); in __push_leaf_right()
3009 memmove_extent_buffer(right, btrfs_item_nr_offset(push_items), in __push_leaf_right()
3015 btrfs_item_nr_offset(left_nritems - push_items), in __push_leaf_right()
3016 push_items * sizeof(struct btrfs_item)); in __push_leaf_right()
3020 right_nritems += push_items; in __push_leaf_right()
3028 left_nritems -= push_items; in __push_leaf_right()
3164 int push_items = 0; in __push_leaf_left() local
3178 if (!empty && push_items > 0) { in __push_leaf_left()
3197 push_items++; in __push_leaf_left()
3201 if (push_items == 0) { in __push_leaf_left()
3205 WARN_ON(!empty && push_items == btrfs_header_nritems(right)); in __push_leaf_left()
3211 push_items * sizeof(struct btrfs_item)); in __push_leaf_left()
3214 btrfs_item_offset(right, push_items - 1); in __push_leaf_left()
3219 btrfs_item_offset(right, push_items - 1), in __push_leaf_left()
3226 for (i = old_left_nritems; i < old_left_nritems + push_items; i++) { in __push_leaf_left()
3233 btrfs_set_header_nritems(left, old_left_nritems + push_items); in __push_leaf_left()
3236 if (push_items > right_nritems) in __push_leaf_left()
3237 WARN(1, KERN_CRIT "push items %d nr %u\n", push_items, in __push_leaf_left()
3240 if (push_items < right_nritems) { in __push_leaf_left()
3241 push_space = btrfs_item_offset(right, push_items - 1) - in __push_leaf_left()
3249 btrfs_item_nr_offset(push_items), in __push_leaf_left()
3250 (btrfs_header_nritems(right) - push_items) * in __push_leaf_left()
3255 right_nritems -= push_items; in __push_leaf_left()
3273 if (path->slots[0] < push_items) { in __push_leaf_left()
3282 path->slots[0] -= push_items; in __push_leaf_left()