summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-02-02 11:59:54 +0000
committerphk <phk@FreeBSD.org>2003-02-02 11:59:54 +0000
commit53aec1a3a4fd66cf5c0d8f60cb7bae402caa6868 (patch)
treebadbc40927245579fc98c19fe98bebd56b1a35f8
parent0e3c8673ccec26c60bcc6ec1961470dbb29d015b (diff)
downloadFreeBSD-src-53aec1a3a4fd66cf5c0d8f60cb7bae402caa6868.zip
FreeBSD-src-53aec1a3a4fd66cf5c0d8f60cb7bae402caa6868.tar.gz
Add a bio_disk pointer for use between geom_disk and the device drivers.
-rw-r--r--sys/geom/geom_disk.c4
-rw-r--r--sys/sys/bio.h2
2 files changed, 4 insertions, 2 deletions
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c
index b7f0eec..eb134a9 100644
--- a/sys/geom/geom_disk.c
+++ b/sys/geom/geom_disk.c
@@ -150,7 +150,7 @@ g_disk_done(struct bio *bp)
{
struct disk *dp;
- dp = bp->bio_caller1;
+ dp = bp->bio_disk;
bp->bio_completed = bp->bio_length - bp->bio_resid;
if (!(dp->d_flags & DISKFLAG_NOGIANT)) {
DROP_GIANT();
@@ -188,7 +188,7 @@ g_disk_start(struct bio *bp)
bp2->bio_pblkno = bp2->bio_offset / dp->d_sectorsize;
bp2->bio_bcount = bp2->bio_length;
bp2->bio_dev = dev;
- bp2->bio_caller1 = dp;
+ bp2->bio_disk = dp;
g_disk_lock_giant(dp);
dp->d_strategy(bp2);
g_disk_unlock_giant(dp);
diff --git a/sys/sys/bio.h b/sys/sys/bio.h
index d012c86..5aaba85 100644
--- a/sys/sys/bio.h
+++ b/sys/sys/bio.h
@@ -44,12 +44,14 @@
#include <sys/queue.h>
+struct disk;
/*
* The bio structure describes an I/O operation in the kernel.
*/
struct bio {
u_int bio_cmd; /* I/O operation. */
dev_t bio_dev; /* Device to do I/O on. */
+ struct disk *bio_disk; /* Valid below geom_disk.c only */
daddr_t bio_blkno; /* Underlying physical block number. */
off_t bio_offset; /* Offset into file. */
long bio_bcount; /* Valid bytes in buffer. */
OpenPOWER on IntegriCloud