Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/raidframe Shuffle softc declarations to a different ...



details:   https://anonhg.NetBSD.org/src/rev/ffb62ca52de9
branches:  trunk
changeset: 448605:ffb62ca52de9
user:      oster <oster%NetBSD.org@localhost>
date:      Wed Feb 06 02:49:09 2019 +0000

description:
Shuffle softc declarations to a different .h file.  Create missing
rf_get_raid().  Things compile, but don't work correctly.

diffstat:

 sys/dev/raidframe/rf_netbsd.h      |   9 +--------
 sys/dev/raidframe/rf_netbsdkintf.c |  30 +++++++-----------------------
 sys/dev/raidframe/rf_raid.h        |  31 ++++++++++++++++++++++++++++++-
 3 files changed, 38 insertions(+), 32 deletions(-)

diffs (129 lines):

diff -r 100b4b94ca3c -r ffb62ca52de9 sys/dev/raidframe/rf_netbsd.h
--- a/sys/dev/raidframe/rf_netbsd.h     Tue Feb 05 23:28:02 2019 +0000
+++ b/sys/dev/raidframe/rf_netbsd.h     Wed Feb 06 02:49:09 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_netbsd.h,v 1.32 2019/02/05 23:28:02 christos Exp $  */
+/*     $NetBSD: rf_netbsd.h,v 1.33 2019/02/06 02:49:09 oster Exp $     */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -103,11 +103,4 @@
        struct RF_ConfigSet_s *next;
 } RF_ConfigSet_t;
 
-int rf_fail_disk(RF_Raid_t *, struct rf_recon_req *);
-
-int rf_inited(const struct raid_softc *);
-int rf_get_unit(const struct raid_softc *);
-RF_Raid_t *rf_get_raid(struct raid_softc *);
-int rf_construct(struct raid_softc *, RF_Config_t *);
-
 #endif /* _RF__RF_NETBSDSTUFF_H_ */
diff -r 100b4b94ca3c -r ffb62ca52de9 sys/dev/raidframe/rf_netbsdkintf.c
--- a/sys/dev/raidframe/rf_netbsdkintf.c        Tue Feb 05 23:28:02 2019 +0000
+++ b/sys/dev/raidframe/rf_netbsdkintf.c        Wed Feb 06 02:49:09 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_netbsdkintf.c,v 1.367 2019/02/05 23:28:02 christos Exp $    */
+/*     $NetBSD: rf_netbsdkintf.c,v 1.368 2019/02/06 02:49:09 oster 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.367 2019/02/05 23:28:02 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.368 2019/02/06 02:49:09 oster Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_raid_autoconfig.h"
@@ -182,7 +182,6 @@
 static void InitBP(struct buf *, struct vnode *, unsigned,
     dev_t, RF_SectorNum_t, RF_SectorCount_t, void *, void (*) (struct buf *),
     void *, int, struct proc *);
-struct raid_softc;
 static void raidinit(struct raid_softc *);
 static int raiddoaccess(RF_Raid_t *raidPtr, struct buf *bp);
 static int rf_get_component_caches(RF_Raid_t *raidPtr, int *);
@@ -250,26 +249,6 @@
        .d_minphys = minphys
 };
 
-struct raid_softc {
-       struct dk_softc sc_dksc;
-       int     sc_unit;
-       int     sc_flags;       /* flags */
-       int     sc_cflags;      /* configuration flags */
-       kmutex_t sc_mutex;      /* interlock mutex */
-       kcondvar_t sc_cv;       /* and the condvar */
-       uint64_t sc_size;       /* size of the raid device */
-       char    sc_xname[20];   /* XXX external name */
-       RF_Raid_t sc_r;
-       LIST_ENTRY(raid_softc) sc_link;
-};
-/* sc_flags */
-#define RAIDF_INITED           0x01    /* unit has been initialized */
-#define RAIDF_SHUTDOWN         0x02    /* unit is being shutdown */
-#define RAIDF_DETACH           0x04    /* detach after final close */
-#define RAIDF_WANTED           0x08    /* someone waiting to obtain a lock */
-#define RAIDF_LOCKED           0x10    /* unit is locked */
-#define RAIDF_UNIT_CHANGED     0x20    /* unit is being changed */
-
 #define        raidunit(x)     DISKUNIT(x)
 #define        raidsoftc(dev)  (((struct raid_softc *)device_private(dev))->sc_r.softc)
 
@@ -460,6 +439,11 @@
        return (rs->sc_flags & RAIDF_INITED) != 0;
 }
 
+RF_Raid_t *
+rf_get_raid(struct raid_softc *rs) {
+       return &rs->sc_r;
+}
+
 int
 rf_get_unit(const struct raid_softc *rs) {
        return rs->sc_unit;
diff -r 100b4b94ca3c -r ffb62ca52de9 sys/dev/raidframe/rf_raid.h
--- a/sys/dev/raidframe/rf_raid.h       Tue Feb 05 23:28:02 2019 +0000
+++ b/sys/dev/raidframe/rf_raid.h       Wed Feb 06 02:49:09 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_raid.h,v 1.46 2019/01/08 07:18:18 mrg Exp $ */
+/*     $NetBSD: rf_raid.h,v 1.47 2019/02/06 02:49:09 oster Exp $       */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -305,4 +305,33 @@
 #endif                         /* RF_INCLUDE_PARITYLOGGING > 0 */
        struct rf_paritymap *parity_map;
 };
+
+struct raid_softc {
+       struct dk_softc sc_dksc;
+       int     sc_unit;
+       int     sc_flags;       /* flags */
+       int     sc_cflags;      /* configuration flags */
+       kmutex_t sc_mutex;      /* interlock mutex */
+       kcondvar_t sc_cv;       /* and the condvar */
+       uint64_t sc_size;       /* size of the raid device */
+       char    sc_xname[20];   /* XXX external name */
+       RF_Raid_t sc_r;
+       LIST_ENTRY(raid_softc) sc_link;
+};
+/* sc_flags */
+#define RAIDF_INITED           0x01    /* unit has been initialized */
+#define RAIDF_SHUTDOWN         0x02    /* unit is being shutdown */
+#define RAIDF_DETACH           0x04    /* detach after final close */
+#define RAIDF_WANTED           0x08    /* someone waiting to obtain a lock */
+#define RAIDF_LOCKED           0x10    /* unit is locked */
+#define RAIDF_UNIT_CHANGED     0x20    /* unit is being changed */
+
+
+int rf_fail_disk(RF_Raid_t *, struct rf_recon_req *);
+
+int rf_inited(const struct raid_softc *);
+int rf_get_unit(const struct raid_softc *);
+RF_Raid_t *rf_get_raid(struct raid_softc *);
+int rf_construct(struct raid_softc *, RF_Config_t *);
+
 #endif                         /* !_RF__RF_RAID_H_ */



Home | Main Index | Thread Index | Old Index