mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 01:30:30 -04:00
Add a bio_disk pointer for use between geom_disk and the device drivers.
This commit is contained in:
parent
ecc575bfaa
commit
ffa918814d
2 changed files with 4 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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. */
|
||||
|
|
|
|||
Loading…
Reference in a new issue