Commit ddaf6d4a authored by Steve French's avatar Steve French

cifs: convert revalidate of directories to using directory metadata cache timeout

The new optional mount parm, "acdirmax" allows caching the metadata
for a directory longer than file metadata, which can be very helpful
for performance.  Convert cifs_inode_needs_reval to check acdirmax
for revalidating directory metadata.
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
Reviewed-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
Reviewed-By: default avatarTom Talpey <tom@talpey.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 4c9f9481
......@@ -2198,12 +2198,23 @@ cifs_inode_needs_reval(struct inode *inode)
if (!lookupCacheEnabled)
return true;
if (!cifs_sb->ctx->actimeo)
return true;
if (!time_in_range(jiffies, cifs_i->time,
cifs_i->time + cifs_sb->ctx->actimeo))
return true;
/*
* depending on inode type, check if attribute caching disabled for
* files or directories
*/
if (S_ISDIR(inode->i_mode)) {
if (!cifs_sb->ctx->acdirmax)
return true;
if (!time_in_range(jiffies, cifs_i->time,
cifs_i->time + cifs_sb->ctx->acdirmax))
return true;
} else { /* file */
if (!cifs_sb->ctx->actimeo)
return true;
if (!time_in_range(jiffies, cifs_i->time,
cifs_i->time + cifs_sb->ctx->actimeo))
return true;
}
/* hardlinked files w/ noserverino get "special" treatment */
if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment