From owner-freebsd-arch Mon Feb 17 21:11:24 2003 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 68FA737B401 for ; Mon, 17 Feb 2003 21:11:23 -0800 (PST) Received: from smtp-relay.omnis.com (smtp-relay.omnis.com [216.239.128.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9807D43F3F for ; Mon, 17 Feb 2003 21:11:18 -0800 (PST) (envelope-from wes@softweyr.com) Received: from softweyr.homeunix.net (66-75-151-22.san.rr.com [66.75.151.22]) by smtp-relay.omnis.com (Postfix) with ESMTP id EF55C4310F; Mon, 17 Feb 2003 21:11:16 -0800 (PST) From: Wes Peters Organization: Softweyr To: Peter Jeremy Subject: Re: syslog.conf syntax change (multiple program/host specifications) Date: Tue, 18 Feb 2003 05:11:15 +0000 User-Agent: KMail/1.5 Cc: arch@FreeBSD.ORG References: <20030210114930.GB90800@melusine.cuivre.fr.eu.org> <200302150918.09807.wes@softweyr.com> <20030215204503.GA56102@cirb503493.alcatel.com.au> In-Reply-To: <20030215204503.GA56102@cirb503493.alcatel.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200302180511.15013.wes@softweyr.com> Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Saturday 15 February 2003 20:45, Peter Jeremy wrote: > On Sat, Feb 15, 2003 at 09:18:09AM +0000, Wes Peters wrote: > > >Right, only I don't have anywhere near the filesystem-foo to implement > > such a change. I suppose it could be done relatively straightforward > > by allowing the original leading disk blocks to be marked unused and > > making an offset to the beginning of the file field in the inode, > > that counts bytes to skip into the first truly allocated block. > > This doesn't sound too difficult - we can already free blocks from the > end of a file so it shouldn't be too difficult to free blocks from the > beginning of a file. Adding a start-of-file offset to I/O operations > is almost a mechanical operation. The only hard part would be finding > space in the inode for another off_t. > > The downside of this is that there would be an upper limit on the total > number of bytes that can be written to the file (ie when you run out of > triple-indirect blocks). You could avoid this by dropping unused > blocks at the front and shifting the remaining blocks forwards in the > inode. (Probably as groups of blocks to avoid the need to move block > pointers within indirect blocks). This would also reduce the size of > the offset from off_t to enough to represent an indirect block of > bytes. Yeah, if you "re-normalize" the file every time you truncate at the beginning, you don't need a full off_t, just an offset up to blocksize. Not much of a difference, and I have no idea how the re-normalization would affect performance; it's certainly not zero cost. The alternative is to use an off_t and only re-normalize when necessary, which would be the simpler solution. -- Where am I, and what am I doing in this handbasket? Wes Peters wes@softweyr.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message