Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Aug 1998 16:03:03 -0400 (EDT)
From:      zhihuizhang <bf20761@binghamton.edu>
To:        hackers <freebsd-hackers@FreeBSD.ORG>
Subject:   Questions about FFS
Message-ID:  <Pine.SOL.L3.93.980821153408.12002A-100000@bingsun2>

next in thread | raw e-mail | index | archive | help

I am reading page 278-279 of the 4.4 BSD book on block and fragment
management in FFS and I am quite confused with it:

(1) (page 278) If file contains no fragmented blocks (and the final block
in the file contains insufficient space to hold the new data). If space
exists in *a block* already allocated, ... 

Does this mean that the file does not share any blocks with other files? 
How do you know which part of a block belong to which file if more than
one small file do share a block (any pointers)? 

Also, I think the "a block" should be the final block. 

(2) (page 278) The file contains one or more fragments (and the fragments
contain insufficient space to hold the new data)...

I guess that these fragments must be contiguous and appear only at the end
of any file with fragments. Am I right? 

(3) (page 278) to avoid excessive copying for slowly growing files, the
file system allows only direct blocks of files to refer to fragments.

I am totaly confused with this statement.

(4) (page 279) if enough of the rest of the current block is free, the
filesystem can avoid a copy by using that block.  The contents of the
existing fragments, appended with the new data, are written into the
allocated space.

If the block refers to the block where the existing fragments exist, then
why write the existing fragments again?  Only the new data needs to be
written after the existing data. Therefore, there seems to be a
contradictary in the above paragraph.  It says "avoid a copy". 

Any help is appreciated.

-------------------------------------------------- 
| Zhihui Zhang, http://cs.binghamton.edu/~zzhang |
| Dept. of Computer Science,  SUNY at Binghamton |
--------------------------------------------------


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SOL.L3.93.980821153408.12002A-100000>