On Tue, 2012-04-03 at 13:57 +1000, Marghanita da Cruz wrote: 
> [email protected] wrote:
> <snip>
> > Depends on the underlying filesystem.

depends a lot on the underlying file system

> > On XFS it's as many as you can fit filenames into an 8 Exabytye file!
> > 
> 
> Thanks - that sounds a lot.

You may want to think about directory structure here.
Name searches (for older file systems, at least) are linear, so if you
have 1000000 files in a directory, it will take 1000000 times as long to
figure out that the file of interest isn't there, than a directory with
one file in it.

One way of limiting this O(n) search time is to introduce directory
levels (aa/bb/cc instead of aabbcc); another is to use a file system
with O(log n) search times, like reiserfs.  And, just maybe, what you
actually need is a database, not a flat directory structure, which
possibly giving O(1) search times depending on the database engine.

> What constitutes a filename?

the bit between the /slashes/

> > You can't create a new link in that directory.

open(2) will report ENOSPC, because the directory data can't be made any
bigger because the disk is full.

Some file systems also have a limit on the total number of inodes
(files) on the disk, independent of the directory they are in.  You will
also get an ENOSPC error for this one, but df(1) stubbornly insists
there are available data blocks... that's not what it ran out of.


-- 
Regards
Peter Miller <[email protected]>
/\/\*        http://miller.emu.id.au/pmiller/

PGP public key ID: 1024D/D0EDB64D
fingerprint = AD0A C5DF C426 4F03 5D53  2BDB 18D8 A4E2 D0ED B64D
See http://www.keyserver.net or any PGP keyserver for public key.

"Me, I have a science fiction writer's conviction that the damn robot is
supposed to speak human, not the other way around." --Spider Robinson
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to