@@ -682,13 +682,6 @@ static int cifs_show_stats(struct seq_file *s, struct dentry *root)
682682}
683683#endif
684684
685- static int cifs_remount (struct super_block * sb , int * flags , char * data )
686- {
687- sync_filesystem (sb );
688- * flags |= SB_NODIRATIME ;
689- return 0 ;
690- }
691-
692685static int cifs_drop_inode (struct inode * inode )
693686{
694687 struct cifs_sb_info * cifs_sb = CIFS_SB (inode -> i_sb );
@@ -710,7 +703,6 @@ static const struct super_operations cifs_super_ops = {
710703 as opens */
711704 .show_options = cifs_show_options ,
712705 .umount_begin = cifs_umount_begin ,
713- .remount_fs = cifs_remount ,
714706#ifdef CONFIG_CIFS_STATS2
715707 .show_stats = cifs_show_stats ,
716708#endif
@@ -778,9 +770,9 @@ static int cifs_set_super(struct super_block *sb, void *data)
778770 return set_anon_super (sb , NULL );
779771}
780772
781- static struct dentry *
773+ struct dentry *
782774cifs_smb3_do_mount (struct file_system_type * fs_type ,
783- int flags , const char * dev_name , void * data , bool is_smb3 )
775+ int flags , struct smb3_fs_context * old_ctx )
784776{
785777 int rc ;
786778 struct super_block * sb ;
@@ -794,21 +786,32 @@ cifs_smb3_do_mount(struct file_system_type *fs_type,
794786 * If CIFS_DEBUG && cifs_FYI
795787 */
796788 if (cifsFYI )
797- cifs_dbg (FYI , "Devname: %s flags: %d\n" , dev_name , flags );
789+ cifs_dbg (FYI , "Devname: %s flags: %d\n" , old_ctx -> UNC , flags );
798790 else
799- cifs_info ("Attempting to mount %s\n" , dev_name );
791+ cifs_info ("Attempting to mount %s\n" , old_ctx -> UNC );
792+
793+ ctx = kzalloc (sizeof (struct smb3_fs_context ), GFP_KERNEL );
794+ if (!ctx )
795+ return ERR_PTR (- ENOMEM );
796+ rc = smb3_fs_context_dup (ctx , old_ctx );
797+ if (rc ) {
798+ root = ERR_PTR (rc );
799+ goto out ;
800+ }
800801
801- ctx = cifs_get_volume_info ((char * )data , dev_name , is_smb3 );
802- if (IS_ERR (ctx ))
803- return ERR_CAST (ctx );
802+ rc = cifs_setup_volume_info (ctx );
803+ if (rc ) {
804+ root = ERR_PTR (rc );
805+ goto out ;
806+ }
804807
805808 cifs_sb = kzalloc (sizeof (struct cifs_sb_info ), GFP_KERNEL );
806809 if (cifs_sb == NULL ) {
807810 root = ERR_PTR (- ENOMEM );
808811 goto out_nls ;
809812 }
810813
811- cifs_sb -> mountdata = kstrndup (data , PAGE_SIZE , GFP_KERNEL );
814+ cifs_sb -> mountdata = kstrndup (ctx -> mount_options , PAGE_SIZE , GFP_KERNEL );
812815 if (cifs_sb -> mountdata == NULL ) {
813816 root = ERR_PTR (- ENOMEM );
814817 goto out_free ;
@@ -878,19 +881,6 @@ cifs_smb3_do_mount(struct file_system_type *fs_type,
878881 goto out ;
879882}
880883
881- static struct dentry *
882- smb3_do_mount (struct file_system_type * fs_type ,
883- int flags , const char * dev_name , void * data )
884- {
885- return cifs_smb3_do_mount (fs_type , flags , dev_name , data , true);
886- }
887-
888- static struct dentry *
889- cifs_do_mount (struct file_system_type * fs_type ,
890- int flags , const char * dev_name , void * data )
891- {
892- return cifs_smb3_do_mount (fs_type , flags , dev_name , data , false);
893- }
894884
895885static ssize_t
896886cifs_loose_read_iter (struct kiocb * iocb , struct iov_iter * iter )
@@ -1027,7 +1017,8 @@ cifs_setlease(struct file *file, long arg, struct file_lock **lease, void **priv
10271017struct file_system_type cifs_fs_type = {
10281018 .owner = THIS_MODULE ,
10291019 .name = "cifs" ,
1030- .mount = cifs_do_mount ,
1020+ .init_fs_context = smb3_init_fs_context ,
1021+ .parameters = smb3_fs_parameters ,
10311022 .kill_sb = cifs_kill_sb ,
10321023 .fs_flags = FS_RENAME_DOES_D_MOVE ,
10331024};
@@ -1036,7 +1027,8 @@ MODULE_ALIAS_FS("cifs");
10361027static struct file_system_type smb3_fs_type = {
10371028 .owner = THIS_MODULE ,
10381029 .name = "smb3" ,
1039- .mount = smb3_do_mount ,
1030+ .init_fs_context = smb3_init_fs_context ,
1031+ .parameters = smb3_fs_parameters ,
10401032 .kill_sb = cifs_kill_sb ,
10411033 .fs_flags = FS_RENAME_DOES_D_MOVE ,
10421034};
0 commit comments