summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2000-05-01 13:36:25 +0000
committerphk <phk@FreeBSD.org>2000-05-01 13:36:25 +0000
commit8f6a76b4dd073885aba26f3bee2a0bf76a3c21c8 (patch)
tree2c449be5174c7adc5d7066a40e57a9546c7b6105 /sys/kern
parent1adeb7ffb16ca15e57e103f0b216470ee1d82d99 (diff)
downloadFreeBSD-src-8f6a76b4dd073885aba26f3bee2a0bf76a3c21c8.zip
FreeBSD-src-8f6a76b4dd073885aba26f3bee2a0bf76a3c21c8.tar.gz
Give struct bio it's own call back mechanism.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/subr_diskslice.c26
-rw-r--r--sys/kern/vfs_bio.c18
2 files changed, 20 insertions, 24 deletions
diff --git a/sys/kern/subr_diskslice.c b/sys/kern/subr_diskslice.c
index b5c197a..1e7d6c4 100644
--- a/sys/kern/subr_diskslice.c
+++ b/sys/kern/subr_diskslice.c
@@ -74,7 +74,7 @@ typedef u_char bool_t;
static volatile bool_t ds_debug;
static struct disklabel *clone_label __P((struct disklabel *lp));
-static void dsiodone __P((struct buf *bp));
+static void dsiodone __P((struct bio *bp));
static char *fixlabel __P((char *sname, struct diskslice *sp,
struct disklabel *lp, int writeflag));
static void free_ds_label __P((struct diskslices *ssp, int slice));
@@ -270,13 +270,6 @@ if (labelsect != 0) Debugger("labelsect != 0 in dscheck()");
* XXX probably need to copy the data to avoid even
* temporarily corrupting the in-core copy.
*/
-#ifdef notyet
- if (bp->b_vp != NULL) {
- s = splbio();
- bp->b_vp->v_numoutput++;
- splx(s);
- }
-#endif
/* XXX need name here. */
msg = fixlabel((char *)NULL, sp,
(struct disklabel *)
@@ -531,26 +524,25 @@ dsioctl(dev, cmd, data, flags, sspp)
static void
dsiodone(bp)
- struct buf *bp;
+ struct bio *bp;
{
struct iodone_chain *ic;
char *msg;
- ic = bp->b_iodone_chain;
- bp->b_flags = bp->b_flags & ~B_DONE;
- bp->b_iodone = ic->ic_prev_iodone;
- bp->b_iodone_chain = ic->ic_prev_iodone_chain;
- if (!(bp->b_iocmd == BIO_READ)
- || (!(bp->b_ioflags & BIO_ERROR) && bp->b_error == 0)) {
+ ic = bp->bio_done_chain;
+ bp->bio_done = ic->ic_prev_iodone;
+ bp->bio_done_chain = ic->ic_prev_iodone_chain;
+ if (!(bp->bio_cmd == BIO_READ)
+ || (!(bp->bio_flags & BIO_ERROR) && bp->bio_error == 0)) {
msg = fixlabel((char *)NULL, ic->ic_args[1].ia_ptr,
(struct disklabel *)
- (bp->b_data + ic->ic_args[0].ia_long),
+ (bp->bio_data + ic->ic_args[0].ia_long),
FALSE);
if (msg != NULL)
printf("%s\n", msg);
}
free(ic, M_DEVBUF);
- biodone((struct bio *)bp); /* XXX */
+ biodone(bp);
}
int
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 0338cc5..025d030 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -2603,8 +2603,18 @@ bufwait(register struct buf * bp)
}
}
+ /*
+ * Call back function from struct bio back up to struct buf.
+ * The corresponding initialization lives in sys/conf.h:DEV_STRATEGY().
+ */
+void
+bufdonebio(struct bio *bp)
+{
+ bufdone(bp->bio_caller2);
+}
+
/*
- * biodone:
+ * bufdone:
*
* Finish I/O on a buffer, optionally calling a completion function.
* This is usually called from an interrupt so process blocking is
@@ -2623,12 +2633,6 @@ bufwait(register struct buf * bp)
* in the biodone routine.
*/
void
-biodone(struct bio * bip)
-{
- bufdone((struct buf *)bip);
-}
-
-void
bufdone(struct buf *bp)
{
int s;
OpenPOWER on IntegriCloud