Lines Matching refs:push_items
3297 int push_items = 0; in push_node_left() local
3304 push_items = BTRFS_NODEPTRS_PER_BLOCK(fs_info) - dst_nritems; in push_node_left()
3311 if (push_items <= 0) in push_node_left()
3315 push_items = min(src_nritems, push_items); in push_node_left()
3316 if (push_items < src_nritems) { in push_node_left()
3320 if (src_nritems - push_items < 8) { in push_node_left()
3321 if (push_items <= 8) in push_node_left()
3323 push_items -= 8; in push_node_left()
3327 push_items = min(src_nritems - 8, push_items); in push_node_left()
3329 ret = tree_mod_log_eb_copy(dst, src, dst_nritems, 0, push_items); in push_node_left()
3337 push_items * sizeof(struct btrfs_key_ptr)); in push_node_left()
3339 if (push_items < src_nritems) { in push_node_left()
3345 btrfs_node_key_ptr_offset(push_items), in push_node_left()
3346 (src_nritems - push_items) * in push_node_left()
3349 btrfs_set_header_nritems(src, src_nritems - push_items); in push_node_left()
3350 btrfs_set_header_nritems(dst, dst_nritems + push_items); in push_node_left()
3371 int push_items = 0; in balance_node_right() local
3382 push_items = BTRFS_NODEPTRS_PER_BLOCK(fs_info) - dst_nritems; in balance_node_right()
3383 if (push_items <= 0) in balance_node_right()
3394 if (max_push < push_items) in balance_node_right()
3395 push_items = max_push; in balance_node_right()
3397 ret = tree_mod_log_insert_move(dst, push_items, 0, dst_nritems); in balance_node_right()
3399 memmove_extent_buffer(dst, btrfs_node_key_ptr_offset(push_items), in balance_node_right()
3404 ret = tree_mod_log_eb_copy(dst, src, 0, src_nritems - push_items, in balance_node_right()
3405 push_items); in balance_node_right()
3412 btrfs_node_key_ptr_offset(src_nritems - push_items), in balance_node_right()
3413 push_items * sizeof(struct btrfs_key_ptr)); in balance_node_right()
3415 btrfs_set_header_nritems(src, src_nritems - push_items); in balance_node_right()
3416 btrfs_set_header_nritems(dst, dst_nritems + push_items); in balance_node_right()
3691 int push_items = 0; in __push_leaf_right() local
3711 if (!empty && push_items > 0) { in __push_leaf_right()
3729 push_items++; in __push_leaf_right()
3736 if (push_items == 0) in __push_leaf_right()
3739 WARN_ON(!empty && push_items == left_nritems); in __push_leaf_right()
3744 push_space = btrfs_item_end_nr(left, left_nritems - push_items); in __push_leaf_right()
3760 memmove_extent_buffer(right, btrfs_item_nr_offset(push_items), in __push_leaf_right()
3766 btrfs_item_nr_offset(left_nritems - push_items), in __push_leaf_right()
3767 push_items * sizeof(struct btrfs_item)); in __push_leaf_right()
3771 right_nritems += push_items; in __push_leaf_right()
3780 left_nritems -= push_items; in __push_leaf_right()
3916 int push_items = 0; in __push_leaf_left() local
3933 if (!empty && push_items > 0) { in __push_leaf_left()
3951 push_items++; in __push_leaf_left()
3955 if (push_items == 0) { in __push_leaf_left()
3959 WARN_ON(!empty && push_items == btrfs_header_nritems(right)); in __push_leaf_left()
3965 push_items * sizeof(struct btrfs_item)); in __push_leaf_left()
3968 btrfs_item_offset_nr(right, push_items - 1); in __push_leaf_left()
3973 btrfs_item_offset_nr(right, push_items - 1), in __push_leaf_left()
3980 for (i = old_left_nritems; i < old_left_nritems + push_items; i++) { in __push_leaf_left()
3990 btrfs_set_header_nritems(left, old_left_nritems + push_items); in __push_leaf_left()
3993 if (push_items > right_nritems) in __push_leaf_left()
3994 WARN(1, KERN_CRIT "push items %d nr %u\n", push_items, in __push_leaf_left()
3997 if (push_items < right_nritems) { in __push_leaf_left()
3998 push_space = btrfs_item_offset_nr(right, push_items - 1) - in __push_leaf_left()
4006 btrfs_item_nr_offset(push_items), in __push_leaf_left()
4007 (btrfs_header_nritems(right) - push_items) * in __push_leaf_left()
4012 right_nritems -= push_items; in __push_leaf_left()
4033 if (path->slots[0] < push_items) { in __push_leaf_left()
4042 path->slots[0] -= push_items; in __push_leaf_left()