diff options
author | NeilBrown <neilb@suse.de> | 2009-03-11 19:10:23 +0100 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-03-11 19:10:23 +0100 |
commit | 37d9d76d8b3a2ac5817e1fa3263cfe0fdb439e51 (patch) | |
tree | ccbf57ce8f85ad8277838c50f723cbe79950eebc /fs/binfmt_script.c | |
parent | NFS: Minor __nfs_revalidate_inode cleanup (diff) | |
download | linux-37d9d76d8b3a2ac5817e1fa3263cfe0fdb439e51.tar.xz linux-37d9d76d8b3a2ac5817e1fa3263cfe0fdb439e51.zip |
NFS: flush cached directory information slightly more readily.
If cached directory contents becomes incorrect, there is no way to
flush the contents. This contrasts with files where file locking is
the recommended way to ensure cache consistency between multiple
applications (a read-lock always flushes the cache).
Also while changes to files often change the size of the file (thus
triggering a cache flush), changes to directories often do not change
the apparent size (as the size is often rounded to a block size).
So it is particularly important with directories to avoid the
possibility of an incorrect cache wherever possible.
When the link count on a directory changes it implies a change in the
number of child directories, and so a change in the contents of this
directory. So use that as a trigger to flush cached contents.
When the ctime changes but the mtime does not, there are two possible
reasons.
1/ The owner/mode information has been changed.
2/ utimes has been used to set the mtime backwards.
In the first case, a data-cache flush is not required.
In the second case it is.
So on the basis that correctness trumps performance, flush the
directory contents cache in this case also.
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/binfmt_script.c')
0 files changed, 0 insertions, 0 deletions