/****************************************************************************
*
* Purpose: To show the effect of a bitwise OR (|) by converting
* an ASCII character to its graphic extension equivalent.
* Author: M.J. Leslie.
* Date: 04-Mar-95
*
****************************************************************************/
main()
{
/* Hex 66 (f) looks like this in binary
*
* 0110 0110
*/
unsigned char value='\x66';
/* Hex 80 looks like this in binary
*
* 1000 0000
*/
printf("%2X %2X \n", value, (value | (unsigned char)'\x80'));
/* A bitwise OR has the effect of
* adding wanted bits.
*
* 0110 0110 (66) OR
* 1000 0000 (80)
* ---------
* 1110 0110 (E6)
*/
}
/****************************************************************************
*
* Program results are:
*
* 66 E6
*
****************************************************************************/
ange='this.form.submit();'>
md/r5cache: flush data only stripes in r5l_recovery_log()
For safer operation, all arrays start in write-through mode, which has been
better tested and is more mature. And actually the write-through/write-mode
isn't persistent after array restarted, so we always start array in
write-through mode. However, if recovery found data-only stripes before the
shutdown (from previous write-back mode), it is not safe to start the array in
write-through mode, as write-through mode can not handle stripes with data in
write-back cache. To solve this problem, we flush all data-only stripes in
r5l_recovery_log(). When r5l_recovery_log() returns, the array starts with
empty cache in write-through mode.
This logic is implemented in r5c_recovery_flush_data_only_stripes():
1. enable write back cache
2. flush all stripes
3. wake up conf->mddev->thread
4. wait for all stripes get flushed (reuse wait_for_quiescent)
5. disable write back cache
The wait in 4 will be waked up in release_inactive_stripe_list()
when conf->active_stripes reaches 0.
It is safe to wake up mddev->thread here because all the resource
required for the thread has been initialized.
Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Shaohua Li <shli@fb.com>