From owner-freebsd-fs Tue Feb 6 13:53:36 2001 Delivered-To: freebsd-fs@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 90BF237B401 for ; Tue, 6 Feb 2001 13:53:19 -0800 (PST) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id f16LrI626721; Tue, 6 Feb 2001 13:53:18 -0800 (PST) Date: Tue, 6 Feb 2001 13:53:18 -0800 From: Alfred Perlstein To: Zhiui Zhang Cc: freebsd-fs@FreeBSD.ORG Subject: Re: Design a journalled file system Message-ID: <20010206135317.Z26076@fw.wintelcom.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from zzhang@cs.binghamton.edu on Tue, Feb 06, 2001 at 04:15:45PM -0500 Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org * Zhiui Zhang [010206 13:16] wrote: > > I am considering the design of a journalled file system in FreeBSD. I > think each transaction corresponds to a file system update operation and > will therefore consists of a list of modified buffers. The important > thing is that these buffers should not be written to disk until they have > been logged into the log area. To do so, we need to pin these buffers in > memory for a while. The concept should be simple, but I run into a problem > which I have no idea how to solve it: > > If you access a lot of files quickly, some vnodes will be reused. These > vnodes can contain buffers that are still pinned in the memory because of > the write-ahead logging constraints. After a vnode is gone, we have > no way to recover its buffers. Note that whenever we need a new vnode, we > are in the process of creating a new file. At this point, we can not flush > the buffers to the log area. The result is a deadlock. > > I could make copies of the buffers that are still pinned, but that incurs > memory copy and need buffer headers, which is also a rare resource. > > The design is similar to ext3fs of linux (they do not seem to have a vnode > layer and they use device + physical block number instead of vnode + > logical block number to index buffers, which, I guess, means that buffers > can exist after the inode is gone). I know Mckusick has a paper on > journalling FFS, but I just want to know if this design can work or not. > > Any ideas? Thanks for your help! There's ways to reassign buffers to other vnodes, you can remove the buffers from the vnodes at reclaim time (there has to be a hook for this) and link them to a special vnode linked from your mount structure. -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] "I have the heart of a child; I keep it in a jar on my desk." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message