summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2020-09-27 21:39:08 +0000
committerchristos <christos@NetBSD.org>2020-09-27 21:39:08 +0000
commit7721efffdab7f762edaa951990226551cde90e55 (patch)
tree22422c4bcbd93a8bce50a4f5a7465ed29d226c8e /sys/dev/raidframe
parent37343ba63dbc6a3b6d64b159e777350132120cd5 (diff)
DIOCCACHESYNC takes an int argument, pass it through.
Diffstat (limited to 'sys/dev/raidframe')
-rw-r--r--sys/dev/raidframe/rf_kintf.h4
-rw-r--r--sys/dev/raidframe/rf_netbsdkintf.c16
-rw-r--r--sys/dev/raidframe/rf_paritymap.c8
3 files changed, 14 insertions, 14 deletions
diff --git a/sys/dev/raidframe/rf_kintf.h b/sys/dev/raidframe/rf_kintf.h
index 3dea3fa4e1a..83300b5b1aa 100644
--- a/sys/dev/raidframe/rf_kintf.h
+++ b/sys/dev/raidframe/rf_kintf.h
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_kintf.h,v 1.25 2018/01/18 00:32:49 mrg Exp $ */
+/* $NetBSD: rf_kintf.h,v 1.26 2020/09/27 21:39:08 christos Exp $ */
/*
* rf_kintf.h
*
@@ -61,7 +61,7 @@ void rf_print_component_label(RF_ComponentLabel_t *);
void rf_UnconfigureVnodes( RF_Raid_t * );
void rf_close_component( RF_Raid_t *, struct vnode *, int);
int rf_getdisksize(struct vnode *, RF_RaidDisk_t *);
-int rf_sync_component_caches(RF_Raid_t *);
+int rf_sync_component_caches(RF_Raid_t *, int);
void rf_check_recon_status_ext(RF_Raid_t *, RF_ProgressInfo_t *);
void rf_check_parityrewrite_status_ext(RF_Raid_t *, RF_ProgressInfo_t *);
diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c
index d9b0124b6a6..eb3ec90c8cb 100644
--- a/sys/dev/raidframe/rf_netbsdkintf.c
+++ b/sys/dev/raidframe/rf_netbsdkintf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_netbsdkintf.c,v 1.389 2020/08/25 13:50:00 skrll Exp $ */
+/* $NetBSD: rf_netbsdkintf.c,v 1.390 2020/09/27 21:39:08 christos Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
***********************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.389 2020/08/25 13:50:00 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.390 2020/09/27 21:39:08 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_raid_autoconfig.h"
@@ -1754,7 +1754,7 @@ raidioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l)
break;
case DIOCCACHESYNC:
- retcode = rf_sync_component_caches(raidPtr);
+ retcode = rf_sync_component_caches(raidPtr, *(int *)data);
break;
default:
@@ -3661,9 +3661,8 @@ rf_get_component_caches(RF_Raid_t *raidPtr, int *data)
*/
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;
for (int i = 0; i < 5; i++) {
e = VOP_IOCTL(raidPtr->raid_cinfo[c].ci_vp, DIOCCACHESYNC,
@@ -3677,14 +3676,14 @@ rf_sync_component_cache(RF_Raid_t *raidPtr, int c)
}
int
-rf_sync_component_caches(RF_Raid_t *raidPtr)
+rf_sync_component_caches(RF_Raid_t *raidPtr, int force)
{
int c, error;
error = 0;
for (c = 0; c < raidPtr->numCol; c++) {
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)
error = e;
}
@@ -3694,7 +3693,8 @@ rf_sync_component_caches(RF_Raid_t *raidPtr)
int sparecol = raidPtr->numCol + c;
/* Need to ensure that the reconstruct actually completed! */
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)
error = e;
}
diff --git a/sys/dev/raidframe/rf_paritymap.c b/sys/dev/raidframe/rf_paritymap.c
index af63515bdb2..683ae00deb0 100644
--- a/sys/dev/raidframe/rf_paritymap.c
+++ b/sys/dev/raidframe/rf_paritymap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_paritymap.c,v 1.9 2019/02/09 03:34:00 christos Exp $ */
+/* $NetBSD: rf_paritymap.c,v 1.10 2020/09/27 21:39:08 christos Exp $ */
/*-
* Copyright (c) 2009 Jed Davis.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_paritymap.c,v 1.9 2019/02/09 03:34:00 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_paritymap.c,v 1.10 2020/09/27 21:39:08 christos Exp $");
#include <sys/param.h>
#include <sys/callout.h>
@@ -220,10 +220,10 @@ rf_paritymap_write_locked(struct rf_paritymap *pm)
* currently have no way to express that directly.)
*/
if (clearing)
- rf_sync_component_caches(pm->raid);
+ rf_sync_component_caches(pm->raid, 1);
rf_paritymap_kern_write(pm->raid, pm->disk_now);
if (setting)
- rf_sync_component_caches(pm->raid);
+ rf_sync_component_caches(pm->raid, 1);
}
/* Mark all parity as being in need of rewrite. */