From owner-freebsd-fs Tue Sep 14 23: 3: 8 1999 Delivered-To: freebsd-fs@freebsd.org Received: from mail.du.gtn.com (mail.du.gtn.com [194.77.9.57]) by hub.freebsd.org (Postfix) with ESMTP id 4131014F01 for ; Tue, 14 Sep 1999 23:03:04 -0700 (PDT) (envelope-from ticso@cicely8.cicely.de) Received: from mail.cicely.de (cicely.de [194.231.9.142]) by mail.du.gtn.com (8.9.3/8.9.3) with ESMTP id HAA06844; Wed, 15 Sep 1999 07:59:27 +0200 (MET DST) Received: from cicely8.cicely.de (cicely8.cicely.de [10.1.2.10]) by mail.cicely.de (8.9.0/8.9.0) with ESMTP id IAA78509; Wed, 15 Sep 1999 08:03:18 +0200 (CEST) Received: (from ticso@localhost) by cicely8.cicely.de (8.9.3/8.9.2) id IAA42227; Wed, 15 Sep 1999 08:03:17 +0200 (CEST) (envelope-from ticso) Date: Wed, 15 Sep 1999 08:03:17 +0200 From: Bernd Walter To: Terry Lambert Cc: Bernd Walter , freebsd-fs@FreeBSD.ORG Subject: Re: FFS-questions Message-ID: <19990915080317.A42200@cicely8.cicely.de> References: <19990912115904.A37697@cicely8.cicely.de> <199909142200.PAA22155@usr09.primenet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.3i In-Reply-To: <199909142200.PAA22155@usr09.primenet.com>; from Terry Lambert on Tue, Sep 14, 1999 at 10:00:26PM +0000 Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Tue, Sep 14, 1999 at 10:00:26PM +0000, Terry Lambert wrote: Thank you for explaining the directory specific behavours. During search in the source I got the impression that softlinks uses the di_ib[] array of struct dinode as direct pointers. Is that true or is my impression wrong? > > > Another problem might be the situation if the fs is mounted: > > AFAIK FFS allocates complete blocks (or clusters?) in case > > the file gets bigger. I can't find out if it's a block or a > > couple of frags depending on the ino->di_size. > > This is problematic, because files can be sparse. > > The value of ino->di_size is the file size, in bytes. > > If you take the remainder modulo the physical block size, you > will get the size of the remainder. > > If this value is less than the file system block size minus the > fragment size (4096 - 1024 = 3072), then there are frag(s) involved, > unless it has been truncated back. > That's the way I already do it. My problem was special for the mounted case that the kernel might allocate more than the needed frags but write the real filesize to the inode. It doesn't seem to be a real problem since may need to sync before or use the incore informations anyway. -- B.Walter COSMO-Project http://www.cosmo-project.de ticso@cicely.de Usergroup info@cosmo-project.de To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message