diff options
| author | elric <elric@NetBSD.org> | 2004-03-27 23:23:06 +0000 |
|---|---|---|
| committer | elric <elric@NetBSD.org> | 2004-03-27 23:23:06 +0000 |
| commit | befeae8929bf08ac1db59de2e6dd256e84756e8a (patch) | |
| tree | e034671e4198431a307701a1c46dc22ea568d541 /sys/dev/dkvar.h | |
| parent | b6e59003c46b3c7ad9577fe09bf46b5e0fa5f573 (diff) | |
Modified the dksubr routines to:
o expect the disk's start routine to return an int. If the
int is non-zero, we enqueue the request and try again
later.
o have a dk_start() routine which runs the request queue.
o have a dk_iodone() function which should be called by the
driver using the framwork from its iodone. dk_iodone will
retry the queue since presumably further progress may be
possible once a request is complete. It is required that
the underlying driver have the resources to keep at least
one transaction in flight at any time.
Modified cgd to:
o be able to keep one transaction in flight at any time
(almost) by keeping a buffer of size MAXPHYS in its softc
and use it.
We still need to make the cgd_cbufpool per device rather than global
and provide a low water mark for it.
Addresses PR: kern/24715
(at least according to the submitter.)
Diffstat (limited to 'sys/dev/dkvar.h')
| -rw-r--r-- | sys/dev/dkvar.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/dkvar.h b/sys/dev/dkvar.h index 74b58a22245..929f2febd6f 100644 --- a/sys/dev/dkvar.h +++ b/sys/dev/dkvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: dkvar.h,v 1.3 2003/06/29 22:29:59 fvdl Exp $ */ +/* $NetBSD: dkvar.h,v 1.4 2004/03/27 23:23:06 elric Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -55,11 +55,12 @@ struct dk_softc { * driver */ u_int32_t sc_flags; /* flags */ size_t sc_size; /* size of disk */ - struct dk_geom sc_geom; /* geometry info */ + struct dk_geom sc_geom; /* geometry info */ #define DK_XNAME_SIZE 8 char sc_xname[DK_XNAME_SIZE]; /* external name */ struct disk sc_dkdev; /* generic disk info */ struct lock sc_lock; /* the lock */ + struct bufq_state sc_bufq; /* buffer queue */ }; /* sc_flags: @@ -88,7 +89,7 @@ struct dk_intf { int (*di_open)(dev_t, int, int, struct proc *); int (*di_close)(dev_t, int, int, struct proc *); void (*di_strategy)(struct buf *); - void (*di_diskstart)(struct dk_softc *, struct buf *); + int (*di_diskstart)(struct dk_softc *, struct buf *); }; #define DK_BUSY(_dksc, _pmask) \ @@ -107,6 +108,8 @@ int dk_open(struct dk_intf *, struct dk_softc *, dev_t, int dk_close(struct dk_intf *, struct dk_softc *, dev_t, int, int, struct proc *); void dk_strategy(struct dk_intf *, struct dk_softc *, struct buf *); +void dk_start(struct dk_intf *, struct dk_softc *); +void dk_iodone(struct dk_intf *, struct dk_softc *); int dk_size(struct dk_intf *, struct dk_softc *, dev_t); int dk_ioctl(struct dk_intf *, struct dk_softc *, dev_t, u_long, caddr_t, int, struct proc *); |
