version 1.389, 2020/08/25 13:50:00 |
version 1.390, 2020/09/27 21:39:08 |
Line 1754 raidioctl(dev_t dev, u_long cmd, void *d |
|
Line 1754 raidioctl(dev_t dev, u_long cmd, void *d |
|
break; |
break; |
|
|
case DIOCCACHESYNC: |
case DIOCCACHESYNC: |
retcode = rf_sync_component_caches(raidPtr); |
retcode = rf_sync_component_caches(raidPtr, *(int *)data); |
break; |
break; |
|
|
default: |
default: |
Line 3661 rf_get_component_caches(RF_Raid_t *raidP |
|
Line 3661 rf_get_component_caches(RF_Raid_t *raidP |
|
*/ |
*/ |
|
|
static int |
static int |
rf_sync_component_cache(RF_Raid_t *raidPtr, int c) |
rf_sync_component_cache(RF_Raid_t *raidPtr, int c, int force) |
{ |
{ |
int force = 1; |
|
int e = 0; |
int e = 0; |
for (int i = 0; i < 5; i++) { |
for (int i = 0; i < 5; i++) { |
e = VOP_IOCTL(raidPtr->raid_cinfo[c].ci_vp, DIOCCACHESYNC, |
e = VOP_IOCTL(raidPtr->raid_cinfo[c].ci_vp, DIOCCACHESYNC, |
Line 3677 rf_sync_component_cache(RF_Raid_t *raidP |
|
Line 3676 rf_sync_component_cache(RF_Raid_t *raidP |
|
} |
} |
|
|
int |
int |
rf_sync_component_caches(RF_Raid_t *raidPtr) |
rf_sync_component_caches(RF_Raid_t *raidPtr, int force) |
{ |
{ |
int c, error; |
int c, error; |
|
|
error = 0; |
error = 0; |
for (c = 0; c < raidPtr->numCol; c++) { |
for (c = 0; c < raidPtr->numCol; c++) { |
if (raidPtr->Disks[c].status == rf_ds_optimal) { |
if (raidPtr->Disks[c].status == rf_ds_optimal) { |
int e = rf_sync_component_cache(raidPtr, c); |
int e = rf_sync_component_cache(raidPtr, c, force); |
if (e && !error) |
if (e && !error) |
error = e; |
error = e; |
} |
} |
Line 3694 rf_sync_component_caches(RF_Raid_t *raid |
|
Line 3693 rf_sync_component_caches(RF_Raid_t *raid |
|
int sparecol = raidPtr->numCol + c; |
int sparecol = raidPtr->numCol + c; |
/* Need to ensure that the reconstruct actually completed! */ |
/* Need to ensure that the reconstruct actually completed! */ |
if (raidPtr->Disks[sparecol].status == rf_ds_used_spare) { |
if (raidPtr->Disks[sparecol].status == rf_ds_used_spare) { |
int e = rf_sync_component_cache(raidPtr, sparecol); |
int e = rf_sync_component_cache(raidPtr, sparecol, |
|
force); |
if (e && !error) |
if (e && !error) |
error = e; |
error = e; |
} |
} |