Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Aug 2003 07:28:20 +0200
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        Eno Thereska <eno@andrew.cmu.edu>
Cc:        freebsd hackers <freebsd-hackers@FreeBSD.ORG>
Subject:   Re: getting from bio to buf in dastrategy() 
Message-ID:  <28859.1060666100@critter.freebsd.dk>
In-Reply-To: Your message of "Mon, 11 Aug 2003 22:09:42 EDT." <3F384C66.6060205@andrew.cmu.edu> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <3F384C66.6060205@andrew.cmu.edu>, Eno Thereska writes:


> >>in /sys/cam/scsi/scsi_da.c the dastrategy()
> >>function takes as an argument "struct bio* bp"
> >>Now I need to get to the "struct *buf" that bp
> >>belongs to.
>
> >You can't do that, there may not be any struct buf.
>
>How can a bio exist on it's own, unrelated to any buf?
>Would that be a special case or does that happen all the
>time? A concrete example would help.

struct buf represents a block in the cache/VM system.

struct bio represents a disk I/O request.

For historical reasons, a buf contains a bio, but that is by
no means the only way to create a bio.

Throughout geom bio's are created a destroyed which have no
relation to any specific buf, for instance to read the key
sectors in gbde.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?28859.1060666100>