Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/raidframe DIOCCACHESYNC takes an int argument, pass ...



details:   https://anonhg.NetBSD.org/src/rev/02de227b25be
branches:  trunk
changeset: 955387:02de227b25be
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Sep 27 21:39:08 2020 +0000

description:
DIOCCACHESYNC takes an int argument, pass it through.

diffstat:

 sys/dev/raidframe/rf_kintf.h       |   4 ++--
 sys/dev/raidframe/rf_netbsdkintf.c |  16 ++++++++--------
 sys/dev/raidframe/rf_paritymap.c   |   8 ++++----
 3 files changed, 14 insertions(+), 14 deletions(-)

diffs (114 lines):

diff -r 49867c9b2a9c -r 02de227b25be sys/dev/raidframe/rf_kintf.h
--- a/sys/dev/raidframe/rf_kintf.h      Sun Sep 27 21:35:16 2020 +0000
+++ b/sys/dev/raidframe/rf_kintf.h      Sun Sep 27 21:39:08 2020 +0000
@@ -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_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 -r 49867c9b2a9c -r 02de227b25be sys/dev/raidframe/rf_netbsdkintf.c
--- a/sys/dev/raidframe/rf_netbsdkintf.c        Sun Sep 27 21:35:16 2020 +0000
+++ b/sys/dev/raidframe/rf_netbsdkintf.c        Sun Sep 27 21:39:08 2020 +0000
@@ -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 @@
                break;
 
        case DIOCCACHESYNC:
-               retcode = rf_sync_component_caches(raidPtr);
+               retcode = rf_sync_component_caches(raidPtr, *(int *)data);
                break;
 
        default:
@@ -3661,9 +3661,8 @@
  */
 
 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 @@
 }
 
 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 @@
                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 -r 49867c9b2a9c -r 02de227b25be sys/dev/raidframe/rf_paritymap.c
--- a/sys/dev/raidframe/rf_paritymap.c  Sun Sep 27 21:35:16 2020 +0000
+++ b/sys/dev/raidframe/rf_paritymap.c  Sun Sep 27 21:39:08 2020 +0000
@@ -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 @@
         * 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. */



Home | Main Index | Thread Index | Old Index