mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 13:53:33 +00:00
cifs: check the timestamp for the cached dirent when deciding on revalidate
Improves directory metadata caching Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
parent
ed8561fa1d
commit
f6d2353a50
1 changed files with 12 additions and 0 deletions
|
@ -2193,6 +2193,8 @@ cifs_dentry_needs_reval(struct dentry *dentry)
|
||||||
struct inode *inode = d_inode(dentry);
|
struct inode *inode = d_inode(dentry);
|
||||||
struct cifsInodeInfo *cifs_i = CIFS_I(inode);
|
struct cifsInodeInfo *cifs_i = CIFS_I(inode);
|
||||||
struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
|
struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
|
||||||
|
struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb);
|
||||||
|
struct cached_fid *cfid = NULL;
|
||||||
|
|
||||||
if (cifs_i->time == 0)
|
if (cifs_i->time == 0)
|
||||||
return true;
|
return true;
|
||||||
|
@ -2203,6 +2205,16 @@ cifs_dentry_needs_reval(struct dentry *dentry)
|
||||||
if (!lookupCacheEnabled)
|
if (!lookupCacheEnabled)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
if (!open_cached_dir_by_dentry(tcon, dentry->d_parent, &cfid)) {
|
||||||
|
mutex_lock(&cfid->fid_mutex);
|
||||||
|
if (cfid->time && cifs_i->time > cfid->time) {
|
||||||
|
mutex_unlock(&cfid->fid_mutex);
|
||||||
|
close_cached_dir(cfid);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
mutex_unlock(&cfid->fid_mutex);
|
||||||
|
close_cached_dir(cfid);
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* depending on inode type, check if attribute caching disabled for
|
* depending on inode type, check if attribute caching disabled for
|
||||||
* files or directories
|
* files or directories
|
||||||
|
|
Loading…
Reference in a new issue