diff options
author | Jeff Layton <jlayton@redhat.com> | 2010-02-12 07:44:16 -0500 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2010-03-05 23:37:05 -0500 |
commit | df2cf170c823ba779ca339e3ede347c87f4dc6a9 (patch) | |
tree | 9ea1ababe413a518afb3de89dadeba73db082850 /fs/cifs/cifsfs.c | |
parent | 64ba9926759792cf7b95f823402e2781edd1b5d4 (diff) |
cifs: overhaul cifs_revalidate and rename to cifs_revalidate_dentry
cifs_revalidate is renamed to cifs_revalidate_dentry as a later patch
will add a by-filehandle variant.
Add a new "invalid_mapping" flag to the cifsInodeInfo that indicates
that the pagecache is considered invalid. Add a new routine to check
inode attributes whenever they're updated and set that flag if the inode
has changed on the server.
cifs_revalidate_dentry is then changed to just update the attrcache if
needed and then to zap the pagecache if it's not valid.
There are some other behavior changes in here as well. Open files are
now allowed to have their caches invalidated. I see no reason why we'd
want to keep stale data around just because a file is open. Also,
cifs_revalidate_cache uses the server_eof for revalidating the file
size since that should more closely match the size of the file on the
server.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifsfs.c')
-rw-r--r-- | fs/cifs/cifsfs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 8c6a03627176..cf85a4165b01 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -312,6 +312,7 @@ cifs_alloc_inode(struct super_block *sb) | |||
312 | cifs_inode->clientCanCacheRead = false; | 312 | cifs_inode->clientCanCacheRead = false; |
313 | cifs_inode->clientCanCacheAll = false; | 313 | cifs_inode->clientCanCacheAll = false; |
314 | cifs_inode->delete_pending = false; | 314 | cifs_inode->delete_pending = false; |
315 | cifs_inode->invalid_mapping = false; | ||
315 | cifs_inode->vfs_inode.i_blkbits = 14; /* 2**14 = CIFS_MAX_MSGSIZE */ | 316 | cifs_inode->vfs_inode.i_blkbits = 14; /* 2**14 = CIFS_MAX_MSGSIZE */ |
316 | cifs_inode->server_eof = 0; | 317 | cifs_inode->server_eof = 0; |
317 | 318 | ||
@@ -638,7 +639,7 @@ static loff_t cifs_llseek(struct file *file, loff_t offset, int origin) | |||
638 | setting the revalidate time to zero */ | 639 | setting the revalidate time to zero */ |
639 | CIFS_I(file->f_path.dentry->d_inode)->time = 0; | 640 | CIFS_I(file->f_path.dentry->d_inode)->time = 0; |
640 | 641 | ||
641 | retval = cifs_revalidate(file->f_path.dentry); | 642 | retval = cifs_revalidate_dentry(file->f_path.dentry); |
642 | if (retval < 0) | 643 | if (retval < 0) |
643 | return (loff_t)retval; | 644 | return (loff_t)retval; |
644 | } | 645 | } |