From owner-freebsd-fs@FreeBSD.ORG Wed Mar 3 13:38:54 2004 Return-Path: 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 6F49516A4CE for ; Wed, 3 Mar 2004 13:38:54 -0800 (PST) Received: from cliffclavin.cs.rpi.edu (cliffclavin.cs.rpi.edu [128.213.1.9]) by mx1.FreeBSD.org (Postfix) with ESMTP id 115EE43D3F for ; Wed, 3 Mar 2004 13:38:54 -0800 (PST) (envelope-from crossd@cs.rpi.edu) Received: from 128.213.12.18 (rexx.cs.rpi.edu [128.213.12.18]) i23Lcnn7016912 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 3 Mar 2004 16:38:49 -0500 (EST) From: "David E. Cross" To: freebsd-fs@freebsd.org Content-Type: text/plain Message-Id: <1078349927.454.5.camel@rexx.cs.rpi.edu> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 03 Mar 2004 16:38:49 -0500 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.37 Subject: struct buf * and journaled-UFS help X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2004 21:38:54 -0000 As some are aware I have been working with a computer science graduate student to bring jounralling to the UFS(2) filesystem. Right now we have it so that operations are journaled to an in-core memory structure (comprised of BLKSIZE * number amount of memory, which is obtained by malloc(9)). When this in-core journal gets full we need to flush it to disk. Previously we had used VOP_WRITE() for this, but it was suggested, and I agree that we should use either VOP_STRATEGY or brwite/bread for our IO work. Both of these require a "struct buf" to do their work. What is the appropriate way to get such a structure? I have seen gbincore() used in similar cases, but it seems that gbincore(), like many of the other buf(9) routines are for getting an already allocated struct buf from the system pool; for example gbincore checks that the lblkno of what is requested is the name as the block already allocated in either the clean or dirty block trees. -- David E. Cross