Module Name: src Committed By: oster Date: Wed Feb 6 02:49:09 UTC 2019
Modified Files: src/sys/dev/raidframe: rf_netbsd.h rf_netbsdkintf.c rf_raid.h Log Message: Shuffle softc declarations to a different .h file. Create missing rf_get_raid(). Things compile, but don't work correctly. To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/sys/dev/raidframe/rf_netbsd.h cvs rdiff -u -r1.367 -r1.368 src/sys/dev/raidframe/rf_netbsdkintf.c cvs rdiff -u -r1.46 -r1.47 src/sys/dev/raidframe/rf_raid.h 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_netbsd.h diff -u src/sys/dev/raidframe/rf_netbsd.h:1.32 src/sys/dev/raidframe/rf_netbsd.h:1.33 --- src/sys/dev/raidframe/rf_netbsd.h:1.32 Tue Feb 5 23:28:02 2019 +++ src/sys/dev/raidframe/rf_netbsd.h Wed Feb 6 02:49:09 2019 @@ -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 @@ typedef struct RF_ConfigSet_s { 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_ */ Index: src/sys/dev/raidframe/rf_netbsdkintf.c diff -u src/sys/dev/raidframe/rf_netbsdkintf.c:1.367 src/sys/dev/raidframe/rf_netbsdkintf.c:1.368 --- src/sys/dev/raidframe/rf_netbsdkintf.c:1.367 Tue Feb 5 23:28:02 2019 +++ src/sys/dev/raidframe/rf_netbsdkintf.c Wed Feb 6 02:49:09 2019 @@ -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 KernelWakeupFunc(struct buf 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 @@ static struct dkdriver rf_dkdriver = { .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 @@ rf_inited(const struct raid_softc *rs) { 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; Index: src/sys/dev/raidframe/rf_raid.h diff -u src/sys/dev/raidframe/rf_raid.h:1.46 src/sys/dev/raidframe/rf_raid.h:1.47 --- src/sys/dev/raidframe/rf_raid.h:1.46 Tue Jan 8 07:18:18 2019 +++ src/sys/dev/raidframe/rf_raid.h Wed Feb 6 02:49:09 2019 @@ -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 @@ struct RF_Raid_s { #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_ */