]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - fs/cifs/cifsfs.c
smb3: add module alias for smb3 to cifs.ko
[linux.git] / fs / cifs / cifsfs.c
index f715609b13f34a412de9f0486750a05cf73340b6..f0a68e90f740f18b70edcd1cd197d9b67e0e4a56 100644 (file)
@@ -495,6 +495,8 @@ cifs_show_options(struct seq_file *s, struct dentry *root)
                seq_puts(s, ",sfu");
        if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
                seq_puts(s, ",nobrl");
+       if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_HANDLE_CACHE)
+               seq_puts(s, ",nohandlecache");
        if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL)
                seq_puts(s, ",cifsacl");
        if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM)
@@ -897,6 +899,17 @@ struct file_system_type cifs_fs_type = {
        /*  .fs_flags */
 };
 MODULE_ALIAS_FS("cifs");
+
+static struct file_system_type smb3_fs_type = {
+       .owner = THIS_MODULE,
+       .name = "smb3",
+       .mount = cifs_do_mount,
+       .kill_sb = cifs_kill_sb,
+       /*  .fs_flags */
+};
+MODULE_ALIAS_FS("smb3");
+MODULE_ALIAS("smb3");
+
 const struct inode_operations cifs_dir_inode_ops = {
        .create = cifs_create,
        .atomic_open = cifs_atomic_open,
@@ -1047,6 +1060,18 @@ ssize_t cifs_file_copychunk_range(unsigned int xid,
        return rc;
 }
 
+/*
+ * Directory operations under CIFS/SMB2/SMB3 are synchronous, so fsync()
+ * is a dummy operation.
+ */
+static int cifs_dir_fsync(struct file *file, loff_t start, loff_t end, int datasync)
+{
+       cifs_dbg(FYI, "Sync directory - name: %pD datasync: 0x%x\n",
+                file, datasync);
+
+       return 0;
+}
+
 static ssize_t cifs_copy_file_range(struct file *src_file, loff_t off,
                                struct file *dst_file, loff_t destoff,
                                size_t len, unsigned int flags)
@@ -1181,6 +1206,7 @@ const struct file_operations cifs_dir_ops = {
        .copy_file_range = cifs_copy_file_range,
        .clone_file_range = cifs_clone_file_range,
        .llseek = generic_file_llseek,
+       .fsync = cifs_dir_fsync,
 };
 
 static void
@@ -1422,6 +1448,12 @@ init_cifs(void)
        if (rc)
                goto out_init_cifs_idmap;
 
+       rc = register_filesystem(&smb3_fs_type);
+       if (rc) {
+               unregister_filesystem(&cifs_fs_type);
+               goto out_init_cifs_idmap;
+       }
+
        return 0;
 
 out_init_cifs_idmap:
@@ -1452,8 +1484,9 @@ init_cifs(void)
 static void __exit
 exit_cifs(void)
 {
-       cifs_dbg(NOISY, "exit_cifs\n");
+       cifs_dbg(NOISY, "exit_smb3\n");
        unregister_filesystem(&cifs_fs_type);
+       unregister_filesystem(&smb3_fs_type);
        cifs_dfs_release_automount_timer();
 #ifdef CONFIG_CIFS_ACL
        exit_cifs_idmap();