@@ -191,19 +191,6 @@ static void dm_bufio_unlock(struct dm_bufio_client *c)
191
191
mutex_unlock (& c -> lock );
192
192
}
193
193
194
- /*
195
- * FIXME Move to sched.h?
196
- */
197
- #ifdef CONFIG_PREEMPT_VOLUNTARY
198
- # define dm_bufio_cond_resched () \
199
- do { \
200
- if (unlikely(need_resched())) \
201
- _cond_resched(); \
202
- } while (0)
203
- #else
204
- # define dm_bufio_cond_resched () do { } while (0)
205
- #endif
206
-
207
194
/*----------------------------------------------------------------*/
208
195
209
196
/*
@@ -741,7 +728,7 @@ static void __flush_write_list(struct list_head *write_list)
741
728
list_entry (write_list -> next , struct dm_buffer , write_list );
742
729
list_del (& b -> write_list );
743
730
submit_io (b , WRITE , b -> block , write_endio );
744
- dm_bufio_cond_resched ();
731
+ cond_resched ();
745
732
}
746
733
blk_finish_plug (& plug );
747
734
}
@@ -780,7 +767,7 @@ static struct dm_buffer *__get_unclaimed_buffer(struct dm_bufio_client *c)
780
767
__unlink_buffer (b );
781
768
return b ;
782
769
}
783
- dm_bufio_cond_resched ();
770
+ cond_resched ();
784
771
}
785
772
786
773
list_for_each_entry_reverse (b , & c -> lru [LIST_DIRTY ], lru_list ) {
@@ -791,7 +778,7 @@ static struct dm_buffer *__get_unclaimed_buffer(struct dm_bufio_client *c)
791
778
__unlink_buffer (b );
792
779
return b ;
793
780
}
794
- dm_bufio_cond_resched ();
781
+ cond_resched ();
795
782
}
796
783
797
784
return NULL ;
@@ -923,7 +910,7 @@ static void __write_dirty_buffers_async(struct dm_bufio_client *c, int no_wait,
923
910
return ;
924
911
925
912
__write_dirty_buffer (b , write_list );
926
- dm_bufio_cond_resched ();
913
+ cond_resched ();
927
914
}
928
915
}
929
916
@@ -973,7 +960,7 @@ static void __check_watermark(struct dm_bufio_client *c,
973
960
return ;
974
961
975
962
__free_buffer_wake (b );
976
- dm_bufio_cond_resched ();
963
+ cond_resched ();
977
964
}
978
965
979
966
if (c -> n_buffers [LIST_DIRTY ] > threshold_buffers )
@@ -1170,7 +1157,7 @@ void dm_bufio_prefetch(struct dm_bufio_client *c,
1170
1157
submit_io (b , READ , b -> block , read_endio );
1171
1158
dm_bufio_release (b );
1172
1159
1173
- dm_bufio_cond_resched ();
1160
+ cond_resched ();
1174
1161
1175
1162
if (!n_blocks )
1176
1163
goto flush_plug ;
@@ -1291,7 +1278,7 @@ int dm_bufio_write_dirty_buffers(struct dm_bufio_client *c)
1291
1278
!test_bit (B_WRITING , & b -> state ))
1292
1279
__relink_lru (b , LIST_CLEAN );
1293
1280
1294
- dm_bufio_cond_resched ();
1281
+ cond_resched ();
1295
1282
1296
1283
/*
1297
1284
* If we dropped the lock, the list is no longer consistent,
@@ -1574,7 +1561,7 @@ static unsigned long __scan(struct dm_bufio_client *c, unsigned long nr_to_scan,
1574
1561
freed ++ ;
1575
1562
if (!-- nr_to_scan || ((count - freed ) <= retain_target ))
1576
1563
return freed ;
1577
- dm_bufio_cond_resched ();
1564
+ cond_resched ();
1578
1565
}
1579
1566
}
1580
1567
return freed ;
@@ -1808,7 +1795,7 @@ static void __evict_old_buffers(struct dm_bufio_client *c, unsigned long age_hz)
1808
1795
if (__try_evict_buffer (b , 0 ))
1809
1796
count -- ;
1810
1797
1811
- dm_bufio_cond_resched ();
1798
+ cond_resched ();
1812
1799
}
1813
1800
1814
1801
dm_bufio_unlock (c );
0 commit comments