aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsfs.c
diff options
context:
space:
mode:
authorSteve French <stfrench@microsoft.com>2019-08-27 23:58:54 -0500
committerSteve French <stfrench@microsoft.com>2019-09-16 11:43:37 -0500
commit83bbfa706dda668deb60e96df20327fc79e1716f (patch)
treed9682e25e2b3219df510e4f3002c105adf5f36f1 /fs/cifs/cifsfs.c
parentcifs: fix dereference on ses before it is null checked (diff)
downloadlinux-dev-83bbfa706dda668deb60e96df20327fc79e1716f.tar.xz
linux-dev-83bbfa706dda668deb60e96df20327fc79e1716f.zip
smb3: add mount option to allow forced caching of read only share
If a share is immutable (at least for the period that it will be mounted) it would be helpful to not have to revalidate dentries repeatedly that we know can not be changed remotely. Add "cache=" option (cache=ro) for mounting read only shares in order to improve performance in cases in which we know that the share will not be changing while it is in use. Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/cifsfs.c')
-rw-r--r--fs/cifs/cifsfs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 3289b566463f..970251bc0661 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -400,6 +400,8 @@ cifs_show_cache_flavor(struct seq_file *s, struct cifs_sb_info *cifs_sb)
seq_puts(s, "strict");
else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO)
seq_puts(s, "none");
+ else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RO_CACHE)
+ seq_puts(s, "ro"); /* read only caching assumed */
else
seq_puts(s, "loose");
}