Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 02 Aug 2011 13:55:26 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        freebsd-stable@freebsd.org
Subject:   Re: ZFS directory with a large number of files
Message-ID:  <4E37F3BE.5040207@infracaninophile.co.uk>
In-Reply-To: <4E37CD13.1070402@digsys.bg>
References:  <CAJGy1F0d7jeyaFuNdXe%2BucTL2r7R4suCyu8xG7WRHenMFZH-6g@mail.gmail.com> <20110802090830.GA92646@icarus.home.lan> <CAJGy1F0V65YB7L_1T-26O_gUkUUzn6mef036iuAw6HRGjxFRQA@mail.gmail.com> <20110802094226.GA93114@icarus.home.lan> <42039B84-D6CE-4780-AA70-8500B1B32036@gsoft.com.au> <4E37CD13.1070402@digsys.bg>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigB5D6A62DEB22158D1A0D9F01
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 02/08/2011 11:10, Daniel Kalchev wrote:
> Other than that, perhaps in ZFS it would be easier to prune the unused
> directory entries, than it is in UFS. It looks like this is not
> implemented.

Remember that ZFS uses copy-on-write for all filesystem updates.  Any
change to a directory contents means the whole directory data is
rewritten.  In which case, there's no benefit to retaining a large data
structure with lots of empty slots (as happened on Unix FSes in the
past.)  I'd expect, and I see in my (admittedly fairly cursory) testing
that ZFS directory data sizes update immediately whenever files are
added or removed from the directory.

Where this gets interesting is when the directory gets sufficiently
large that the directory data is larger than the 128kB block size used
by ZFS.  As that takes many more files than any sensible person would
put into one directory it's possible there's a bug in handling such
large structures which is only rarely tickled.  But this is all
speculation on my behalf, and I have no evidence to back it up.

	Cheers,

	Matthew

--=20
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
JID: matthew@infracaninophile.co.uk               Kent, CT11 9PW


--------------enigB5D6A62DEB22158D1A0D9F01
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.16 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk4388YACgkQ8Mjk52CukIxSbwCfRFz96Y2hycFGs2NPQPJepM87
iWgAnilMjLGPTepRGr37CBMd2M0DoY3f
=V6y7
-----END PGP SIGNATURE-----

--------------enigB5D6A62DEB22158D1A0D9F01--



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