diff options
| author | oster <oster@NetBSD.org> | 2019-02-06 02:49:09 +0000 |
|---|---|---|
| committer | oster <oster@NetBSD.org> | 2019-02-06 02:49:09 +0000 |
| commit | 61928b13c7c70e38bd5b3f507f00e9a22b96459e (patch) | |
| tree | 66054f3d884edaa8048501bd738a87645e2287e0 /sys/dev/raidframe | |
| parent | bb872f6816ae1830662fdaf0f5c3d02acdf07411 (diff) | |
Shuffle softc declarations to a different .h file. Create missing
rf_get_raid(). Things compile, but don't work correctly.
Diffstat (limited to 'sys/dev/raidframe')
| -rw-r--r-- | sys/dev/raidframe/rf_netbsd.h | 9 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_netbsdkintf.c | 30 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_raid.h | 31 |
3 files changed, 38 insertions, 32 deletions
diff --git a/sys/dev/raidframe/rf_netbsd.h b/sys/dev/raidframe/rf_netbsd.h index 9c355465741..6d39672389a 100644 --- a/sys/dev/raidframe/rf_netbsd.h +++ b/sys/dev/raidframe/rf_netbsd.h @@ -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_ */ diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c index 4e143095e78..ba1fe685998 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.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; diff --git a/sys/dev/raidframe/rf_raid.h b/sys/dev/raidframe/rf_raid.h index 6db156257e7..5c2ed892d76 100644 --- a/sys/dev/raidframe/rf_raid.h +++ b/sys/dev/raidframe/rf_raid.h @@ -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_ */ |
