From owner-freebsd-hackers Tue Sep 8 12:15:53 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA27449 for freebsd-hackers-outgoing; Tue, 8 Sep 1998 12:15:53 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from bingsun1.cc.binghamton.edu (bingsun1.cc.binghamton.edu [128.226.1.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA27441 for ; Tue, 8 Sep 1998 12:15:48 -0700 (PDT) (envelope-from bf20761@binghamton.edu) Received: from localhost (bf20761@localhost) by bingsun1.cc.binghamton.edu (8.8.7/8.6.9) with SMTP id PAA29812; Tue, 8 Sep 1998 15:15:08 -0400 (EDT) Date: Tue, 8 Sep 1998 15:15:07 -0400 (EDT) From: zhihuizhang X-Sender: bf20761@bingsun1 Reply-To: zhihuizhang To: Mike Smith cc: hackers Subject: Re: ffs_blkpref() and cluster_save In-Reply-To: <199809080728.AAA15515@word.smith.net.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, 8 Sep 1998, Mike Smith wrote: > indx refers to the offset of the allocation within the file section. > > bap[] is the table of block addresses within the section. It's used to > locate the previous block in the file in order to make a contiguous > allocation. I am still confused with this small routine: (1) If bap[indx-1]==0 means the previous logical block has not been allocated, does this imply that the file has holes? In this case, we can not make use of information of previous allocation. Since this also implies that we are NOT making contiguous allocation, it is OK to guess by logical block number. (2) bap is actually given as ip->i_db[0] or the last metablock on the path used to access the data block (see ufs_getlbns()) and indx is the offset into bap corresponding to the given logical block number. Its value should be 0..11 or 0..1023. If so, indx has nothing to do with fs_maxbpg. I mean indx % fs->fs_maxbpg is the same thing as indx == 0. The default value of maxbpg is 1024 though. (3) Why we always return the same value fs_fpg*cg + fs_frag for ALL direct blocks (lbn < NDADDR)? Besides, the first fragment address of a chosen cylinder group cg should be fs_fpg * cg, not fs_fpg*cg + fs_frag. By the way, I still can not find where the structure *cluster_save* is defined (I check all the included head files). I hope someone can tell me where it is. Any help is appreciated. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message