mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-30 20:06:56 -05:00
Quiesce read-ahead before thermal spin-down
This commit is contained in:
parent
4423c8c895
commit
b959f0056e
5 changed files with 77 additions and 8 deletions
|
|
@ -5872,9 +5872,12 @@ void generate_configuration(const char* path)
|
|||
|
||||
|
||||
/**
|
||||
* Flush and sync the parity files.
|
||||
* Establish a durable I/O barrier: drain asynchronous writes, collect their
|
||||
* errors, sync parity only if all writes succeeded, then quiesce read-ahead.
|
||||
* A failed writer invalidates the whole barrier because parity must not be
|
||||
* treated as coherent, or recorded in content state, after a failed write.
|
||||
*/
|
||||
int state_flush(struct snapraid_state* state, struct snapraid_io* io, struct snapraid_parity_handle* parity_handle, block_off_t blockcur)
|
||||
int state_barrier(struct snapraid_state* state, struct snapraid_io* io, struct snapraid_parity_handle* parity_handle, block_off_t blockcur)
|
||||
{
|
||||
unsigned l;
|
||||
|
||||
|
|
@ -5904,6 +5907,10 @@ int state_flush(struct snapraid_state* state, struct snapraid_io* io, struct sna
|
|||
}
|
||||
}
|
||||
|
||||
/* complete all read-ahead without consuming the results */
|
||||
if (io)
|
||||
io_quiesce(io);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue