From owner-freebsd-fs@FreeBSD.ORG Tue Oct 3 01:12:44 2006 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7964316A40F for ; Tue, 3 Oct 2006 01:12:44 +0000 (UTC) (envelope-from adamsch1@yahoo.com) Received: from web31812.mail.mud.yahoo.com (web31812.mail.mud.yahoo.com [68.142.207.75]) by mx1.FreeBSD.org (Postfix) with SMTP id 077FE43D58 for ; Tue, 3 Oct 2006 01:12:43 +0000 (GMT) (envelope-from adamsch1@yahoo.com) Received: (qmail 19535 invoked by uid 60001); 3 Oct 2006 01:12:43 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=pvE4bw6IFyEiHvS9RGUhRZRs955n7taJUFlgI4btTZRPZiGBAH5B8Qdhzw0QwuwZMrNxDp161ivE/65MeZo9KfkWZasRE/KQ7K1N/Dn5WOXdVcmo1fvOpDtftOV8Valgbnz9v4D7sx+t/2LPjYMD/a1PQWsLiLu4/sNWS6MtRkk= ; Message-ID: <20061003011243.19533.qmail@web31812.mail.mud.yahoo.com> Received: from [69.236.99.151] by web31812.mail.mud.yahoo.com via HTTP; Mon, 02 Oct 2006 18:12:43 PDT Date: Mon, 2 Oct 2006 18:12:42 -0700 (PDT) From: Shane Adams To: freebsd-fs@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Content-Transfer-Encoding: quoted-printable Subject: curiosity between bread and UFS_BALLOC on struct buf X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Oct 2006 01:12:44 -0000 Hey all,=0A=0AI've been puzzling with a bit of code. I'm creating a file f= rom within a kernel module, that works fine, but I've got a question if per= haps I'm missing something:=0A=0AI use UFS_BALLOC to allocate some space. = That function has a struct buf thats returned. What I would expect is that= I could manipulate the bp->b_data field then do a bwrite and have my chang= es saved. Doesnt work that way. Only way=0AI can get it to work is=0A=0A1= UFS_BALLOC( ... )=0A=0A2 bwrite( .. )=0A=0A3 bread( ... )=0A=0A4 /* Make c= hanges to what I read */=0A=0A5 bwrite()=0A=0ASeems like I could get rid of= , 2 and 3. I'm not sure why I have to bwrite the buffer returned from UFS_= BALLOC. I dug around and there are a few examples of where ffs/ufs manipul= ate the buffer returned from UFS_BALLOC so I am guessing I'm missing a flag= or something.=0A=0AHope the question is clear enough!=0A=0ACheers,=0A Sha= ne=0A=0A