@@ -3517,9 +3517,9 @@ static int leaf_space_used(struct extent_buffer *l, int start, int nr)
3517
3517
btrfs_init_map_token (& token , l );
3518
3518
start_item = btrfs_item_nr (start );
3519
3519
end_item = btrfs_item_nr (end );
3520
- data_len = btrfs_token_item_offset (l , start_item , & token ) +
3521
- btrfs_token_item_size (l , start_item , & token );
3522
- data_len = data_len - btrfs_token_item_offset (l , end_item , & token );
3520
+ data_len = btrfs_token_item_offset (& token , start_item ) +
3521
+ btrfs_token_item_size (& token , start_item );
3522
+ data_len = data_len - btrfs_token_item_offset (& token , end_item );
3523
3523
data_len += sizeof (struct btrfs_item ) * nr ;
3524
3524
WARN_ON (data_len < 0 );
3525
3525
return data_len ;
@@ -3650,8 +3650,8 @@ static noinline int __push_leaf_right(struct btrfs_path *path,
3650
3650
push_space = BTRFS_LEAF_DATA_SIZE (fs_info );
3651
3651
for (i = 0 ; i < right_nritems ; i ++ ) {
3652
3652
item = btrfs_item_nr (i );
3653
- push_space -= btrfs_token_item_size (right , item , & token );
3654
- btrfs_set_token_item_offset (right , item , push_space , & token );
3653
+ push_space -= btrfs_token_item_size (& token , item );
3654
+ btrfs_set_token_item_offset (& token , item , push_space );
3655
3655
}
3656
3656
3657
3657
left_nritems -= push_items ;
@@ -3859,10 +3859,9 @@ static noinline int __push_leaf_left(struct btrfs_path *path, int data_size,
3859
3859
3860
3860
item = btrfs_item_nr (i );
3861
3861
3862
- ioff = btrfs_token_item_offset (left , item , & token );
3863
- btrfs_set_token_item_offset (left , item ,
3864
- ioff - (BTRFS_LEAF_DATA_SIZE (fs_info ) - old_left_item_size ),
3865
- & token );
3862
+ ioff = btrfs_token_item_offset (& token , item );
3863
+ btrfs_set_token_item_offset (& token , item ,
3864
+ ioff - (BTRFS_LEAF_DATA_SIZE (fs_info ) - old_left_item_size ));
3866
3865
}
3867
3866
btrfs_set_header_nritems (left , old_left_nritems + push_items );
3868
3867
@@ -3892,9 +3891,8 @@ static noinline int __push_leaf_left(struct btrfs_path *path, int data_size,
3892
3891
for (i = 0 ; i < right_nritems ; i ++ ) {
3893
3892
item = btrfs_item_nr (i );
3894
3893
3895
- push_space = push_space - btrfs_token_item_size (right ,
3896
- item , & token );
3897
- btrfs_set_token_item_offset (right , item , push_space , & token );
3894
+ push_space = push_space - btrfs_token_item_size (& token , item );
3895
+ btrfs_set_token_item_offset (& token , item , push_space );
3898
3896
}
3899
3897
3900
3898
btrfs_mark_buffer_dirty (left );
@@ -4036,9 +4034,8 @@ static noinline void copy_for_split(struct btrfs_trans_handle *trans,
4036
4034
struct btrfs_item * item = btrfs_item_nr (i );
4037
4035
u32 ioff ;
4038
4036
4039
- ioff = btrfs_token_item_offset (right , item , & token );
4040
- btrfs_set_token_item_offset (right , item ,
4041
- ioff + rt_data_off , & token );
4037
+ ioff = btrfs_token_item_offset (& token , item );
4038
+ btrfs_set_token_item_offset (& token , item , ioff + rt_data_off );
4042
4039
}
4043
4040
4044
4041
btrfs_set_header_nritems (l , mid );
@@ -4541,9 +4538,8 @@ void btrfs_truncate_item(struct btrfs_path *path, u32 new_size, int from_end)
4541
4538
u32 ioff ;
4542
4539
item = btrfs_item_nr (i );
4543
4540
4544
- ioff = btrfs_token_item_offset (leaf , item , & token );
4545
- btrfs_set_token_item_offset (leaf , item ,
4546
- ioff + size_diff , & token );
4541
+ ioff = btrfs_token_item_offset (& token , item );
4542
+ btrfs_set_token_item_offset (& token , item , ioff + size_diff );
4547
4543
}
4548
4544
4549
4545
/* shift the data */
@@ -4640,9 +4636,8 @@ void btrfs_extend_item(struct btrfs_path *path, u32 data_size)
4640
4636
u32 ioff ;
4641
4637
item = btrfs_item_nr (i );
4642
4638
4643
- ioff = btrfs_token_item_offset (leaf , item , & token );
4644
- btrfs_set_token_item_offset (leaf , item ,
4645
- ioff - data_size , & token );
4639
+ ioff = btrfs_token_item_offset (& token , item );
4640
+ btrfs_set_token_item_offset (& token , item , ioff - data_size );
4646
4641
}
4647
4642
4648
4643
/* shift the data */
@@ -4718,9 +4713,9 @@ void setup_items_for_insert(struct btrfs_root *root, struct btrfs_path *path,
4718
4713
u32 ioff ;
4719
4714
4720
4715
item = btrfs_item_nr (i );
4721
- ioff = btrfs_token_item_offset (leaf , item , & token );
4722
- btrfs_set_token_item_offset (leaf , item ,
4723
- ioff - total_data , & token );
4716
+ ioff = btrfs_token_item_offset (& token , item );
4717
+ btrfs_set_token_item_offset (& token , item ,
4718
+ ioff - total_data );
4724
4719
}
4725
4720
/* shift the items */
4726
4721
memmove_extent_buffer (leaf , btrfs_item_nr_offset (slot + nr ),
@@ -4739,10 +4734,9 @@ void setup_items_for_insert(struct btrfs_root *root, struct btrfs_path *path,
4739
4734
btrfs_cpu_key_to_disk (& disk_key , cpu_key + i );
4740
4735
btrfs_set_item_key (leaf , & disk_key , slot + i );
4741
4736
item = btrfs_item_nr (slot + i );
4742
- btrfs_set_token_item_offset (leaf , item ,
4743
- data_end - data_size [i ], & token );
4737
+ btrfs_set_token_item_offset (& token , item , data_end - data_size [i ]);
4744
4738
data_end -= data_size [i ];
4745
- btrfs_set_token_item_size (leaf , item , data_size [i ], & token );
4739
+ btrfs_set_token_item_size (& token , item , data_size [i ]);
4746
4740
}
4747
4741
4748
4742
btrfs_set_header_nritems (leaf , nritems + nr );
@@ -4930,9 +4924,8 @@ int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root,
4930
4924
u32 ioff ;
4931
4925
4932
4926
item = btrfs_item_nr (i );
4933
- ioff = btrfs_token_item_offset (leaf , item , & token );
4934
- btrfs_set_token_item_offset (leaf , item ,
4935
- ioff + dsize , & token );
4927
+ ioff = btrfs_token_item_offset (& token , item );
4928
+ btrfs_set_token_item_offset (& token , item , ioff + dsize );
4936
4929
}
4937
4930
4938
4931
memmove_extent_buffer (leaf , btrfs_item_nr_offset (slot ),
0 commit comments