Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Jan 2003 07:47:53 -0800
From:      David Schultz <dschultz@uclink.Berkeley.EDU>
To:        Tomas Pluskal <plusik@pohoda.cz>
Cc:        Bruce Evans <bde@zeta.org.au>, Terry Lambert <tlambert2@mindspring.com>, freebsd-fs@FreeBSD.ORG
Subject:   Re: seeking help to rewrite the msdos filesystem
Message-ID:  <20030112154753.GA3284@HAL9000.homeunix.com>
In-Reply-To: <20030111191832.B18312-200000@localhost.localdomain>
References:  <20021114020947.O6495-100000@gamplex.bde.org> <20030111191832.B18312-200000@localhost.localdomain>

next in thread | previous in thread | raw e-mail | index | archive | help
Thus spake Tomas Pluskal <plusik@pohoda.cz>:
> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030112154753.GA3284>