summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-01-12 17:39:29 +0000
committerphk <phk@FreeBSD.org>2003-01-12 17:39:29 +0000
commit11b1d67a0251c8409efb1532424e8fec9f5905f7 (patch)
tree261e41ee8968d134a36394278b45c5bd729c0818 /sys
parent9a785896535fd824a120133d807af7204b3f1570 (diff)
downloadFreeBSD-src-11b1d67a0251c8409efb1532424e8fec9f5905f7.zip
FreeBSD-src-11b1d67a0251c8409efb1532424e8fec9f5905f7.tar.gz
Shift things around a bit in preparation for future evilness.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/md/md.c91
1 files changed, 48 insertions, 43 deletions
diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c
index acb09c0..6f8aa78 100644
--- a/sys/dev/md/md.c
+++ b/sys/dev/md/md.c
@@ -113,26 +113,7 @@ static dev_t status_dev = 0;
#define CDEV_MAJOR 95
-static d_strategy_t mdstrategy;
-static d_open_t mdopen;
-static d_close_t mdclose;
-static d_ioctl_t mdioctl, mdctlioctl;
-
-static struct cdevsw md_cdevsw = {
- /* open */ mdopen,
- /* close */ mdclose,
- /* read */ physread,
- /* write */ physwrite,
- /* ioctl */ mdioctl,
- /* poll */ nopoll,
- /* mmap */ nommap,
- /* strategy */ mdstrategy,
- /* name */ MD_NAME,
- /* maj */ CDEV_MAJOR,
- /* dump */ nodump,
- /* psize */ nopsize,
- /* flags */ D_DISK | D_CANFREE | D_MEMDISK,
-};
+static d_ioctl_t mdctlioctl;
static struct cdevsw mdctl_cdevsw = {
/* open */ nullopen,
@@ -147,7 +128,6 @@ static struct cdevsw mdctl_cdevsw = {
/* maj */ CDEV_MAJOR
};
-static struct cdevsw mddisk_cdevsw;
static LIST_HEAD(, md_s) md_softc_list = LIST_HEAD_INITIALIZER(&md_softc_list);
@@ -356,6 +336,30 @@ s_write(struct indir *ip, off_t offset, uintptr_t ptr)
return (0);
}
+
+static d_strategy_t mdstrategy;
+static d_open_t mdopen;
+static d_close_t mdclose;
+static d_ioctl_t mdioctl;
+
+static struct cdevsw md_cdevsw = {
+ /* open */ mdopen,
+ /* close */ mdclose,
+ /* read */ physread,
+ /* write */ physwrite,
+ /* ioctl */ mdioctl,
+ /* poll */ nopoll,
+ /* mmap */ nommap,
+ /* strategy */ mdstrategy,
+ /* name */ MD_NAME,
+ /* maj */ CDEV_MAJOR,
+ /* dump */ nodump,
+ /* psize */ nopsize,
+ /* flags */ D_DISK | D_CANFREE | D_MEMDISK,
+};
+
+static struct cdevsw mddisk_cdevsw;
+
static int
mdopen(dev_t dev, int flag, int fmt, struct thread *td)
{
@@ -395,6 +399,29 @@ mdioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct thread *td)
return (ENOIOCTL);
}
+static void
+mdstrategy(struct bio *bp)
+{
+ struct md_s *sc;
+
+ if (md_debug > 1)
+ printf("mdstrategy(%p) %s %x, %jd, %jd %ld, %p)\n",
+ (void *)bp, devtoname(bp->bio_dev), bp->bio_flags,
+ (intmax_t)bp->bio_blkno,
+ (intmax_t)bp->bio_pblkno,
+ bp->bio_bcount / DEV_BSIZE,
+ (void *)bp->bio_data);
+
+ sc = bp->bio_dev->si_drv1;
+
+ /* XXX: LOCK(sc->lock) */
+ bioqdisksort(&sc->bio_queue, bp);
+ /* XXX: UNLOCK(sc->lock) */
+
+ wakeup(sc);
+}
+
+
static int
mdstart_malloc(struct md_s *sc, struct bio *bp)
{
@@ -538,28 +565,6 @@ mdstart_swap(struct md_s *sc, struct bio *bp)
}
static void
-mdstrategy(struct bio *bp)
-{
- struct md_s *sc;
-
- if (md_debug > 1)
- printf("mdstrategy(%p) %s %x, %jd, %jd %ld, %p)\n",
- (void *)bp, devtoname(bp->bio_dev), bp->bio_flags,
- (intmax_t)bp->bio_blkno,
- (intmax_t)bp->bio_pblkno,
- bp->bio_bcount / DEV_BSIZE,
- (void *)bp->bio_data);
-
- sc = bp->bio_dev->si_drv1;
-
- /* XXX: LOCK(sc->lock) */
- bioqdisksort(&sc->bio_queue, bp);
- /* XXX: UNLOCK(sc->lock) */
-
- wakeup(sc);
-}
-
-static void
md_kthread(void *arg)
{
struct md_s *sc;
OpenPOWER on IntegriCloud