ref2 = btrfs_item_ptr(leaf, path->slots[0],
struct btrfs_shared_data_ref);
num_refs = btrfs_shared_data_ref_count(leaf, ref2);
- } else if (key.type == BTRFS_EXTENT_REF_V0_KEY) {
+ } else if (unlikely(key.type == BTRFS_EXTENT_REF_V0_KEY)) {
btrfs_print_v0_err(trans->fs_info);
btrfs_abort_transaction(trans, -EINVAL);
return -EINVAL;
leaf = path->nodes[0];
item_size = btrfs_item_size_nr(leaf, path->slots[0]);
- if (item_size < sizeof(*ei)) {
+ if (unlikely(item_size < sizeof(*ei))) {
err = -EINVAL;
btrfs_print_v0_err(fs_info);
btrfs_abort_transaction(trans, err);
leaf = path->nodes[0];
item_size = btrfs_item_size_nr(leaf, path->slots[0]);
- if (item_size < sizeof(*ei)) {
+ if (unlikely(item_size < sizeof(*ei))) {
err = -EINVAL;
btrfs_print_v0_err(fs_info);
btrfs_abort_transaction(trans, err);
leaf = path->nodes[0];
item_size = btrfs_item_size_nr(leaf, extent_slot);
- if (item_size < sizeof(*ei)) {
+ if (unlikely(item_size < sizeof(*ei))) {
ret = -EINVAL;
btrfs_print_v0_err(info);
btrfs_abort_transaction(trans, ret);
u64 offset;
int ref_index = 0;
- if (item_size < sizeof(*ei)) {
+ if (unlikely(item_size < sizeof(*ei))) {
btrfs_print_v0_err(eb->fs_info);
btrfs_handle_fs_error(eb->fs_info, -EINVAL, NULL);
}
edge->node[UPPER] = upper;
goto next;
- } else if (key.type == BTRFS_EXTENT_REF_V0_KEY) {
+ } else if (unlikely(key.type == BTRFS_EXTENT_REF_V0_KEY)) {
err = -EINVAL;
btrfs_print_v0_err(rc->extent_root->fs_info);
btrfs_handle_fs_error(rc->extent_root->fs_info, err,
level = (int)extent_key->offset;
}
generation = btrfs_extent_generation(eb, ei);
- } else if (item_size == sizeof(struct btrfs_extent_item_v0)) {
+ } else if (unlikely(item_size == sizeof(struct btrfs_extent_item_v0))) {
btrfs_print_v0_err(eb->fs_info);
btrfs_handle_fs_error(eb->fs_info, -EINVAL, NULL);
return -EINVAL;
struct btrfs_extent_data_ref);
ret = find_data_references(rc, extent_key,
eb, dref, blocks);
- } else if (key.type == BTRFS_EXTENT_REF_V0_KEY) {
+ } else if (unlikely(key.type == BTRFS_EXTENT_REF_V0_KEY)) {
btrfs_print_v0_err(eb->fs_info);
btrfs_handle_fs_error(eb->fs_info, -EINVAL, NULL);
ret = -EINVAL;
flags = btrfs_extent_flags(path->nodes[0], ei);
ret = check_extent_flags(flags);
BUG_ON(ret);
- } else if (item_size == sizeof(struct btrfs_extent_item_v0)) {
+ } else if (unlikely(item_size == sizeof(struct btrfs_extent_item_v0))) {
err = -EINVAL;
btrfs_print_v0_err(trans->fs_info);
btrfs_abort_transaction(trans, err);