summaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsfs.c
diff options
context:
space:
mode:
authorPavel Shilovsky <piastry@etersoft.ru>2011-05-26 23:35:47 +0400
committerSteve French <sfrench@us.ibm.com>2011-05-27 03:53:23 +0000
commit25c7f41e9234f60af30e086278f1de7974f8816f (patch)
tree41cb4da532da30418da2d33e5376ddbf9f65958a /fs/cifs/cifsfs.c
parentf87d39d951329cd8f462bf9007d334122c0599d0 (diff)
downloadtalos-op-linux-25c7f41e9234f60af30e086278f1de7974f8816f.tar.gz
talos-op-linux-25c7f41e9234f60af30e086278f1de7974f8816f.zip
CIFS: Migrate to shared superblock model
Add cifs_match_super to use in sget to share superblock between mounts that have the same //server/sharename, credentials and mount options. It helps us to improve performance on work with future SMB2.1 leases. Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifsfs.c')
-rw-r--r--fs/cifs/cifsfs.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 46fdd55cf427..360fe2ec2a19 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -630,6 +630,7 @@ cifs_do_mount(struct file_system_type *fs_type,
struct super_block *sb;
struct cifs_sb_info *cifs_sb;
struct smb_vol *volume_info;
+ struct cifs_mnt_data mnt_data;
struct dentry *root;
cFYI(1, "Devname: %s flags: %d ", dev_name, flags);
@@ -646,12 +647,21 @@ cifs_do_mount(struct file_system_type *fs_type,
cifs_setup_cifs_sb(volume_info, cifs_sb);
- sb = sget(fs_type, NULL, set_anon_super, NULL);
+ mnt_data.vol = volume_info;
+ mnt_data.cifs_sb = cifs_sb;
+ mnt_data.flags = flags;
+
+ sb = sget(fs_type, cifs_match_super, set_anon_super, &mnt_data);
if (IS_ERR(sb)) {
root = ERR_CAST(sb);
goto out_cifs_sb;
}
+ if (sb->s_fs_info) {
+ cFYI(1, "Use existing superblock");
+ goto out_shared;
+ }
+
/*
* Copy mount params for use in submounts. Better to do
* the copy here and deal with the error before cleanup gets
@@ -680,9 +690,16 @@ cifs_do_mount(struct file_system_type *fs_type,
root = cifs_get_root(volume_info, sb);
if (root == NULL)
goto out_super;
+
cFYI(1, "dentry root is: %p", root);
goto out;
+out_shared:
+ root = cifs_get_root(volume_info, sb);
+ if (root)
+ cFYI(1, "dentry root is: %p", root);
+ goto out;
+
out_super:
kfree(cifs_sb->mountdata);
deactivate_locked_super(sb);
OpenPOWER on IntegriCloud