mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Map devices before starting thermal
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-arm32 (push) Waiting to run
Build / build-win (push) Waiting to run
Build / build-freebsd (push) Waiting to run
Build / build-musl (push) Waiting to run
CodeQL Advanced / Analyze (c-cpp) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-arm32 (push) Waiting to run
Build / build-win (push) Waiting to run
Build / build-freebsd (push) Waiting to run
Build / build-musl (push) Waiting to run
CodeQL Advanced / Analyze (c-cpp) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
This commit is contained in:
parent
672a08d1d9
commit
1e02d608ab
3 changed files with 18 additions and 6 deletions
|
|
@ -1082,6 +1082,15 @@ int devtest(tommy_list* high, tommy_list* low, int operation)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void state_devmap(struct snapraid_state* state)
|
||||
{
|
||||
/* map device if not already done */
|
||||
if (!state->mapped_device) {
|
||||
devmap();
|
||||
state->mapped_device = 1;
|
||||
}
|
||||
}
|
||||
|
||||
int state_device(struct snapraid_state* state, int operation, tommy_list* filterlist_disk)
|
||||
{
|
||||
tommy_node* i;
|
||||
|
|
@ -1091,17 +1100,13 @@ int state_device(struct snapraid_state* state, int operation, tommy_list* filter
|
|||
int ret;
|
||||
time_t now = time(0);
|
||||
|
||||
/* map device if not already done */
|
||||
if (!state->mapped_device) {
|
||||
devmap();
|
||||
state->mapped_device = 1;
|
||||
}
|
||||
|
||||
switch (operation) {
|
||||
case DEVICE_UP : msg_progress("Spinup...\n"); break;
|
||||
case DEVICE_DOWN : msg_progress("Spindown...\n"); break;
|
||||
}
|
||||
|
||||
state_devmap(state);
|
||||
|
||||
tommy_list_init(&high);
|
||||
tommy_list_init(&low);
|
||||
|
||||
|
|
|
|||
|
|
@ -253,6 +253,11 @@ void state_scan(struct snapraid_state* state);
|
|||
*/
|
||||
void state_touch(struct snapraid_state* state);
|
||||
|
||||
/**
|
||||
* Map devices if not already done.
|
||||
*/
|
||||
void state_devmap(struct snapraid_state* state);
|
||||
|
||||
/**
|
||||
* Devices operations.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -128,6 +128,8 @@ void state_thermal(struct snapraid_state* state, time_t now)
|
|||
if (state->thermal_temperature_limit == 0)
|
||||
return;
|
||||
|
||||
state_devmap(state);
|
||||
|
||||
tommy_list_init(&high);
|
||||
tommy_list_init(&low);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue