File tree Expand file tree Collapse file tree 2 files changed +6
-17
lines changed Expand file tree Collapse file tree 2 files changed +6
-17
lines changed Original file line number Diff line number Diff line change @@ -8929,7 +8929,8 @@ void md_do_sync(struct md_thread *thread)
8929
8929
sector_t last_check ;
8930
8930
int skipped = 0 ;
8931
8931
struct md_rdev * rdev ;
8932
- char * desc , * action = NULL ;
8932
+ enum sync_action action ;
8933
+ const char * desc ;
8933
8934
struct blk_plug plug ;
8934
8935
int ret ;
8935
8936
@@ -8960,21 +8961,9 @@ void md_do_sync(struct md_thread *thread)
8960
8961
goto skip ;
8961
8962
}
8962
8963
8963
- if (test_bit (MD_RECOVERY_SYNC , & mddev -> recovery )) {
8964
- if (test_bit (MD_RECOVERY_CHECK , & mddev -> recovery )) {
8965
- desc = "data-check" ;
8966
- action = "check" ;
8967
- } else if (test_bit (MD_RECOVERY_REQUESTED , & mddev -> recovery )) {
8968
- desc = "requested-resync" ;
8969
- action = "repair" ;
8970
- } else
8971
- desc = "resync" ;
8972
- } else if (test_bit (MD_RECOVERY_RESHAPE , & mddev -> recovery ))
8973
- desc = "reshape" ;
8974
- else
8975
- desc = "recovery" ;
8976
-
8977
- mddev -> last_sync_action = action ?: desc ;
8964
+ action = md_sync_action (mddev );
8965
+ desc = md_sync_action_name (action );
8966
+ mddev -> last_sync_action = desc ;
8978
8967
8979
8968
/*
8980
8969
* Before starting a resync we must have set curr_resync to
Original file line number Diff line number Diff line change @@ -432,7 +432,7 @@ struct mddev {
432
432
* when the sync thread is "frozen" (interrupted) or "idle" (stopped
433
433
* or finished). It is overwritten when a new sync operation is begun.
434
434
*/
435
- char * last_sync_action ;
435
+ const char * last_sync_action ;
436
436
sector_t curr_resync ; /* last block scheduled */
437
437
/* As resync requests can complete out of order, we cannot easily track
438
438
* how much resync has been completed. So we occasionally pause until
You can’t perform that action at this time.
0 commit comments