Module Name: src
Committed By: christos
Date: Sun Sep 27 21:39:08 UTC 2020
Modified Files:
src/sys/dev/raidframe: rf_kintf.h rf_netbsdkintf.c rf_paritymap.c
Log Message:
DIOCCACHESYNC takes an int argument, pass it through.
To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/raidframe/rf_kintf.h
cvs rdiff -u -r1.389 -r1.390 src/sys/dev/raidframe/rf_netbsdkintf.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/raidframe/rf_paritymap.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/raidframe/rf_kintf.h
diff -u src/sys/dev/raidframe/rf_kintf.h:1.25 src/sys/dev/raidframe/rf_kintf.h:1.26
--- src/sys/dev/raidframe/rf_kintf.h:1.25 Wed Jan 17 19:32:49 2018
+++ src/sys/dev/raidframe/rf_kintf.h Sun Sep 27 17:39:08 2020
@@ -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_Compone
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 *);
Index: src/sys/dev/raidframe/rf_netbsdkintf.c
diff -u src/sys/dev/raidframe/rf_netbsdkintf.c:1.389 src/sys/dev/raidframe/rf_netbsdkintf.c:1.390
--- src/sys/dev/raidframe/rf_netbsdkintf.c:1.389 Tue Aug 25 09:50:00 2020
+++ src/sys/dev/raidframe/rf_netbsdkintf.c Sun Sep 27 17:39:08 2020
@@ -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 *d
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 *raidP
*/
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 *raidP
}
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 *raid
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;
}
Index: src/sys/dev/raidframe/rf_paritymap.c
diff -u src/sys/dev/raidframe/rf_paritymap.c:1.9 src/sys/dev/raidframe/rf_paritymap.c:1.10
--- src/sys/dev/raidframe/rf_paritymap.c:1.9 Fri Feb 8 22:34:00 2019
+++ src/sys/dev/raidframe/rf_paritymap.c Sun Sep 27 17:39:08 2020
@@ -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_pari
* 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. */