OpenDir and large directories

Nadav Danieli nadavd at
Mon Oct 10 02:19:21 GMT 2005

On Mon, 2005-10-10 at 04:00, James Peach wrote:

> On Mon, 2005-10-10 at 03:28 +0200, Nadav Danieli wrote:
> > Hi,
> > 
> > As I already saw in several posts OpenDir with very large directories is
> > a bit of a problem to say the least.
> > My main issue is mostly with the stat calls that follows it, and it is
> > even worse since it is made on NFS mount that is accessed from several
> > machines and therefore attributes must not be cached.
> > I can think of several optimizations I can make, but in order to do them
> > I need to change the way OpenDir, ReadDirName, and CloseDir work.
> > I assume the main if not the only reason (if there are others I would be
> > glad to hear about them,) OpenDir reads the whole dir first, is done for
> > caching.
> This code hasn't read the entire directory since around 3.0.14 IIRC.
> What version of the source are you looking at?

Thanks a bunch, it would save me writing it all by myself :-)
Was 3.0.7

More information about the samba-technical mailing list