@@ -781,12 +781,10 @@ static union bch_extent_entry *extent_entry_prev(struct bkey_ptrs ptrs,
781
781
/*
782
782
* Returns pointer to the next entry after the one being dropped:
783
783
*/
784
- union bch_extent_entry * bch2_bkey_drop_ptr_noerror (struct bkey_s k ,
785
- struct bch_extent_ptr * ptr )
784
+ void bch2_bkey_drop_ptr_noerror (struct bkey_s k , struct bch_extent_ptr * ptr )
786
785
{
787
786
struct bkey_ptrs ptrs = bch2_bkey_ptrs (k );
788
787
union bch_extent_entry * entry = to_entry (ptr ), * next ;
789
- union bch_extent_entry * ret = entry ;
790
788
bool drop_crc = true;
791
789
792
790
EBUG_ON (ptr < & ptrs .start -> ptr ||
@@ -811,21 +809,16 @@ union bch_extent_entry *bch2_bkey_drop_ptr_noerror(struct bkey_s k,
811
809
break ;
812
810
813
811
if ((extent_entry_is_crc (entry ) && drop_crc ) ||
814
- extent_entry_is_stripe_ptr (entry )) {
815
- ret = (void * ) ret - extent_entry_bytes (entry );
812
+ extent_entry_is_stripe_ptr (entry ))
816
813
extent_entry_drop (k , entry );
817
- }
818
814
}
819
-
820
- return ret ;
821
815
}
822
816
823
- union bch_extent_entry * bch2_bkey_drop_ptr (struct bkey_s k ,
824
- struct bch_extent_ptr * ptr )
817
+ void bch2_bkey_drop_ptr (struct bkey_s k , struct bch_extent_ptr * ptr )
825
818
{
826
819
bool have_dirty = bch2_bkey_dirty_devs (k .s_c ).nr ;
827
- union bch_extent_entry * ret =
828
- bch2_bkey_drop_ptr_noerror (k , ptr );
820
+
821
+ bch2_bkey_drop_ptr_noerror (k , ptr );
829
822
830
823
/*
831
824
* If we deleted all the dirty pointers and there's still cached
@@ -837,14 +830,10 @@ union bch_extent_entry *bch2_bkey_drop_ptr(struct bkey_s k,
837
830
!bch2_bkey_dirty_devs (k .s_c ).nr ) {
838
831
k .k -> type = KEY_TYPE_error ;
839
832
set_bkey_val_u64s (k .k , 0 );
840
- ret = NULL ;
841
833
} else if (!bch2_bkey_nr_ptrs (k .s_c )) {
842
834
k .k -> type = KEY_TYPE_deleted ;
843
835
set_bkey_val_u64s (k .k , 0 );
844
- ret = NULL ;
845
836
}
846
-
847
- return ret ;
848
837
}
849
838
850
839
void bch2_bkey_drop_device (struct bkey_s k , unsigned dev )
0 commit comments