LWN.net Logo

readdir

readdir

Posted Apr 9, 2009 23:16 UTC (Thu) by vaurora (guest, #38407)
In reply to: readdir by bharata
Parent article: Unioning file systems: Implementations, part 2

I thought your summary was pretty good:

http://sourceware.org/ml/libc-alpha/2008-03/msg00032.html

Clearly, this works since it is what BSD has been doing for years. But I don't like the idea of caching the entire directory very much. Dealing with directories with lots of entries is often not ideal, and this will add another constraint on the size of directories. For small directories, this works fine. For large directories, suddenly the size of directories is related to the amount of memory you have available. Imagine not being able to do an ls because you don't have enough memory to process the whiteouts - which you could fix if you could delete some files - but you don't know what the files are named because readdir() fails...

I'm sure you've thought about this more than I have, though. Any thoughts?


(Log in to post comments)

readdir

Posted Apr 11, 2009 5:14 UTC (Sat) by bharata (subscriber, #7885) [Link]

As you note, memory is a problem with glibc implementation with large directories. Your proposed scheme for readdir looks good, except that I find it a bit restrictive to tie a top layer to a bottom layer. I guess with you scheme, once you do a union mount, you can't re-union the top layer on top of any other layer.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds