@@ -9549,6 +9549,8 @@ l2arc_process_sublist(spa_t *spa, l2arc_dev_t *dev, multilist_sublist_t *mls,
9549
9549
if (hdr == multilist_sublist_head (mls ))
9550
9550
scan_from_head = B_TRUE ;
9551
9551
9552
+ prev_hdr = hdr ;
9553
+
9552
9554
while (hdr != NULL ) {
9553
9555
kmutex_t * hash_lock ;
9554
9556
abd_t * to_write = NULL ;
@@ -9721,10 +9723,7 @@ l2arc_process_sublist(spa_t *spa, l2arc_dev_t *dev, multilist_sublist_t *mls,
9721
9723
* Position persistent marker for next iteration
9722
9724
*/
9723
9725
if (save_position ) {
9724
- if (prev_hdr != NULL )
9725
- multilist_sublist_insert_before (mls , prev_hdr , marker );
9726
- else
9727
- multilist_sublist_insert_head (mls , marker );
9726
+ multilist_sublist_insert_before (mls , prev_hdr , marker );
9728
9727
} else {
9729
9728
multilist_sublist_insert_tail (mls , marker );
9730
9729
}
@@ -9834,21 +9833,13 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev, uint64_t target_sz)
9834
9833
skip_sublist = B_TRUE ;
9835
9834
} else if (save_position ) {
9836
9835
hdr = multilist_sublist_prev (mls , marker );
9837
- if (hdr != NULL )
9838
- multilist_sublist_remove (mls , marker );
9839
- else
9840
- hdr = multilist_sublist_tail (mls );
9836
+ ASSERT3P (hdr , != , NULL );
9837
+ multilist_sublist_remove (mls , marker );
9841
9838
} else {
9842
9839
multilist_sublist_remove (mls , marker );
9843
9840
hdr = arc_warm ? multilist_sublist_tail (mls ) :
9844
9841
multilist_sublist_head (mls );
9845
- if (arc_warm ) {
9846
- multilist_sublist_insert_tail (mls ,
9847
- marker );
9848
- } else {
9849
- multilist_sublist_insert_head (mls ,
9850
- marker );
9851
- }
9842
+ ASSERT3P (hdr , != , NULL );
9852
9843
}
9853
9844
9854
9845
if (!skip_sublist ) {
0 commit comments