> What Samba needs is a way to tell between two points in time whether the > directory contents have changed in any way - nothing more. Only one new > syscall is used to maintain the Samba dcache: > > long sys_mark_dir_clean(dirfd); > this is how Samba could create a file atomically: > > sys_create(name, mode | O_CLEAN); i've attached a quick patch (against 2.6.3) that implements the new sys_mark_dir_clean() syscall and O_CLEAN support in all open() variants, just to have an idea of how it looks like roughly. (It's incomplete - e.g. there's no explicit way to do an atomic unlink or rename.) i've also attached dir-cache.c, a simple testcode for the new functionality. It marks the current directory clean and tries to open the "./1" file via O_CLEAN with 1 second delay. Start this in one shell and do VFS-namespace modifying ops in another window (eg. "rm -f 2; touch 2") and see the dir-cache code react to it - the 'clean' bit is lost, and the file open-create does not succeed if the directory is not clean. there's a new dentry flag that is maintained under the directory's i_sem semaphore. (It would be simpler to have the flag on the inode level, that way the invalidation could be done as a simple filter to the dnotify function.) Ingo