diff options
author | phk <phk@FreeBSD.org> | 2004-03-11 18:50:33 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2004-03-11 18:50:33 +0000 |
commit | 5c532f7fd4286a2a53b4ac3a8381da5b89251557 (patch) | |
tree | 2b5985795bbbb2d7db3118632ad579bf98d8f94a /sys/kern | |
parent | 265fe61be82dff80c5b876620d07c8a8edcf4c25 (diff) | |
download | FreeBSD-src-5c532f7fd4286a2a53b4ac3a8381da5b89251557.zip FreeBSD-src-5c532f7fd4286a2a53b4ac3a8381da5b89251557.tar.gz |
When I was a kid my work table was one cluttered mess an cleaning it up
were a rather overwhelming task. I soon learned that if you don't know
where you're going to store something, at least try to pile it next to
something slightly related in the hope that a pattern emerges.
Apply the same principle to the ffs/snapshot/softupdates code which have
leaked into specfs: Add yet a buf-quasi-method and call it from the
only two places I can see it can make a difference and implement the
magic in ffs_softdep.c where it belongs.
It's not pretty, but at least it's one less layer violated.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_bio.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index bba9a55..d612fc9 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -886,10 +886,12 @@ ibwrite(struct buf * bp) if (oldflags & B_ASYNC) BUF_KERNPROC(bp); bp->b_iooffset = dbtob(bp->b_blkno); - if (bp->b_vp->v_type == VCHR) - VOP_SPECSTRATEGY(bp->b_vp, bp); - else + if (bp->b_vp->v_type == VCHR) { + if (!buf_prewrite(bp->b_vp, bp)) + VOP_SPECSTRATEGY(bp->b_vp, bp); + } else { VOP_STRATEGY(bp->b_vp, bp); + } if ((oldflags & B_ASYNC) == 0) { int rtval = bufwait(bp); |