Lines Matching refs:push_items
3191 int push_items = 0; in push_node_left() local
3198 push_items = BTRFS_NODEPTRS_PER_BLOCK(root) - dst_nritems; in push_node_left()
3205 if (push_items <= 0) in push_node_left()
3209 push_items = min(src_nritems, push_items); in push_node_left()
3210 if (push_items < src_nritems) { in push_node_left()
3214 if (src_nritems - push_items < 8) { in push_node_left()
3215 if (push_items <= 8) in push_node_left()
3217 push_items -= 8; in push_node_left()
3221 push_items = min(src_nritems - 8, push_items); in push_node_left()
3224 push_items); in push_node_left()
3232 push_items * sizeof(struct btrfs_key_ptr)); in push_node_left()
3234 if (push_items < src_nritems) { in push_node_left()
3240 btrfs_node_key_ptr_offset(push_items), in push_node_left()
3241 (src_nritems - push_items) * in push_node_left()
3244 btrfs_set_header_nritems(src, src_nritems - push_items); in push_node_left()
3245 btrfs_set_header_nritems(dst, dst_nritems + push_items); in push_node_left()
3266 int push_items = 0; in balance_node_right() local
3277 push_items = BTRFS_NODEPTRS_PER_BLOCK(root) - dst_nritems; in balance_node_right()
3278 if (push_items <= 0) in balance_node_right()
3289 if (max_push < push_items) in balance_node_right()
3290 push_items = max_push; in balance_node_right()
3292 tree_mod_log_eb_move(root->fs_info, dst, push_items, 0, dst_nritems); in balance_node_right()
3293 memmove_extent_buffer(dst, btrfs_node_key_ptr_offset(push_items), in balance_node_right()
3299 src_nritems - push_items, push_items); in balance_node_right()
3306 btrfs_node_key_ptr_offset(src_nritems - push_items), in balance_node_right()
3307 push_items * sizeof(struct btrfs_key_ptr)); in balance_node_right()
3309 btrfs_set_header_nritems(src, src_nritems - push_items); in balance_node_right()
3310 btrfs_set_header_nritems(dst, dst_nritems + push_items); in balance_node_right()
3601 int push_items = 0; in __push_leaf_right() local
3623 if (!empty && push_items > 0) { in __push_leaf_right()
3640 push_items++; in __push_leaf_right()
3647 if (push_items == 0) in __push_leaf_right()
3650 WARN_ON(!empty && push_items == left_nritems); in __push_leaf_right()
3655 push_space = btrfs_item_end_nr(left, left_nritems - push_items); in __push_leaf_right()
3671 memmove_extent_buffer(right, btrfs_item_nr_offset(push_items), in __push_leaf_right()
3677 btrfs_item_nr_offset(left_nritems - push_items), in __push_leaf_right()
3678 push_items * sizeof(struct btrfs_item)); in __push_leaf_right()
3681 right_nritems += push_items; in __push_leaf_right()
3690 left_nritems -= push_items; in __push_leaf_right()
3823 int push_items = 0; in __push_leaf_left() local
3842 if (!empty && push_items > 0) { in __push_leaf_left()
3859 push_items++; in __push_leaf_left()
3863 if (push_items == 0) { in __push_leaf_left()
3867 WARN_ON(!empty && push_items == btrfs_header_nritems(right)); in __push_leaf_left()
3873 push_items * sizeof(struct btrfs_item)); in __push_leaf_left()
3876 btrfs_item_offset_nr(right, push_items - 1); in __push_leaf_left()
3881 btrfs_item_offset_nr(right, push_items - 1), in __push_leaf_left()
3887 for (i = old_left_nritems; i < old_left_nritems + push_items; i++) { in __push_leaf_left()
3897 btrfs_set_header_nritems(left, old_left_nritems + push_items); in __push_leaf_left()
3900 if (push_items > right_nritems) in __push_leaf_left()
3901 WARN(1, KERN_CRIT "push items %d nr %u\n", push_items, in __push_leaf_left()
3904 if (push_items < right_nritems) { in __push_leaf_left()
3905 push_space = btrfs_item_offset_nr(right, push_items - 1) - in __push_leaf_left()
3913 btrfs_item_nr_offset(push_items), in __push_leaf_left()
3914 (btrfs_header_nritems(right) - push_items) * in __push_leaf_left()
3917 right_nritems -= push_items; in __push_leaf_left()
3938 if (path->slots[0] < push_items) { in __push_leaf_left()
3947 path->slots[0] -= push_items; in __push_leaf_left()