From owner-freebsd-fs Sun Jan 12 7:47:58 2003 Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D5E9537B401 for ; Sun, 12 Jan 2003 07:47:56 -0800 (PST) Received: from HAL9000.homeunix.com (12-233-57-224.client.attbi.com [12.233.57.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4AD3A43F3F for ; Sun, 12 Jan 2003 07:47:55 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.6/8.12.5) with ESMTP id h0CFlsB4003521; Sun, 12 Jan 2003 07:47:54 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.6/8.12.5/Submit) id h0CFlrW4003520; Sun, 12 Jan 2003 07:47:53 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Date: Sun, 12 Jan 2003 07:47:53 -0800 From: David Schultz To: Tomas Pluskal Cc: Bruce Evans , Terry Lambert , freebsd-fs@FreeBSD.ORG Subject: Re: seeking help to rewrite the msdos filesystem Message-ID: <20030112154753.GA3284@HAL9000.homeunix.com> Mail-Followup-To: Tomas Pluskal , Bruce Evans , Terry Lambert , freebsd-fs@FreeBSD.ORG References: <20021114020947.O6495-100000@gamplex.bde.org> <20030111191832.B18312-200000@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030111191832.B18312-200000@localhost.localdomain> Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Thus spake Tomas Pluskal : > I have made a simple patch to enable clustering in msdosfs. > It is against 4-STABLE. > > With this patch I get speed on my ZIP drive about 700KB/s (while before it > was about 80KB/s). [...] > if (ap->a_runp) { > - /* > - * Sequential clusters should be counted here. > - */ > - *ap->a_runp = 0; > + int nblk; > + > + nblk = (dep->de_FileSize >> bshift) - (lblkno + 1); > + if (nblk <= 0) > + *ap->a_runp = 0; > + else if (nblk >= (MAXBSIZE >> bshift)) > + *ap->a_runp = (MAXBSIZE >> bshift) - 1; > + else > + *ap->a_runp = nblk; > } I'm not sure I understand what you're trying to do here. Does this work with files that are fragmented? You appear to be assuming that they are not. Maybe you copied the code from the cd9660 filesystem, which does not permit external fragmentation. I think you need to use the cluster number returned by pcbmap() to index into the FAT and extract the next cluster number, repeating until you find that the next cluster is not contiguous, or until you hit MAXBSIZE or the end of the file. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message