Date: Mon, 2 Oct 2006 18:12:42 -0700 (PDT) From: Shane Adams <adamsch1@yahoo.com> To: freebsd-fs@freebsd.org Subject: curiosity between bread and UFS_BALLOC on struct buf Message-ID: <20061003011243.19533.qmail@web31812.mail.mud.yahoo.com>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061003011243.19533.qmail>