[Samba] Re: Sorting directory lists [SOLVED]

Andy Kelk andykelk at gmail.com
Thu Jan 1 21:07:27 GMT 2009


2008/12/31 Volker Lendecke <Volker.Lendecke at sernet.de>:
> It will not compile on some c compilers, in dirsort_opendir
> you define source_directory after a statement. Same for dp.

Thanks for the tips. Now fixed.

> In dirsort_readdir you might want to implement a check based
> on fstat if the directory has changed since you read it. It
> might take a while before smbd actually does the readdir
> call. You might want to throw away the cached contents. You
> might want to look at vfs_syncops for information how to get
> a directory fd.

I've implemented this so that it does an fstat on readdir and re-loads
the cache if necessary (if the mtime has changed). I've used dirfd()
to get at the previously opened directory stream. This works on my
system and, from what I can see from various manual pages, I think it
should work on other systems too.

I released a 0.2 version of the vfs module.

http://code.google.com/p/samba-dirsort-vfs/downloads/list

> It would be good if we got this in git format-patch format
> :-)

I've cloned the samba repo and am in the process of massaging my vfs
changes into it. Will send a patch to this list once I have completed
that.


Many thanks for the feedback,

Andy


More information about the samba mailing list