From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 11 22:28:27 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ADEF837B401 for ; Mon, 11 Aug 2003 22:28:27 -0700 (PDT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 90A6843FA3 for ; Mon, 11 Aug 2003 22:28:26 -0700 (PDT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.9/8.12.9) with ESMTP id h7C5SKGn028860; Tue, 12 Aug 2003 07:28:21 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: Eno Thereska From: "Poul-Henning Kamp" In-Reply-To: Your message of "Mon, 11 Aug 2003 22:09:42 EDT." <3F384C66.6060205@andrew.cmu.edu> Date: Tue, 12 Aug 2003 07:28:20 +0200 Message-ID: <28859.1060666100@critter.freebsd.dk> cc: freebsd hackers Subject: Re: getting from bio to buf in dastrategy() X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Aug 2003 05:28:28 -0000 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.