@@ -682,13 +682,6 @@ static int cifs_show_stats(struct seq_file *s, struct dentry *root)
682
682
}
683
683
#endif
684
684
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
-
692
685
static int cifs_drop_inode (struct inode * inode )
693
686
{
694
687
struct cifs_sb_info * cifs_sb = CIFS_SB (inode -> i_sb );
@@ -710,7 +703,6 @@ static const struct super_operations cifs_super_ops = {
710
703
as opens */
711
704
.show_options = cifs_show_options ,
712
705
.umount_begin = cifs_umount_begin ,
713
- .remount_fs = cifs_remount ,
714
706
#ifdef CONFIG_CIFS_STATS2
715
707
.show_stats = cifs_show_stats ,
716
708
#endif
@@ -778,9 +770,9 @@ static int cifs_set_super(struct super_block *sb, void *data)
778
770
return set_anon_super (sb , NULL );
779
771
}
780
772
781
- static struct dentry *
773
+ struct dentry *
782
774
cifs_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 )
784
776
{
785
777
int rc ;
786
778
struct super_block * sb ;
@@ -794,21 +786,32 @@ cifs_smb3_do_mount(struct file_system_type *fs_type,
794
786
* If CIFS_DEBUG && cifs_FYI
795
787
*/
796
788
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 );
798
790
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
+ }
800
801
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
+ }
804
807
805
808
cifs_sb = kzalloc (sizeof (struct cifs_sb_info ), GFP_KERNEL );
806
809
if (cifs_sb == NULL ) {
807
810
root = ERR_PTR (- ENOMEM );
808
811
goto out_nls ;
809
812
}
810
813
811
- cifs_sb -> mountdata = kstrndup (data , PAGE_SIZE , GFP_KERNEL );
814
+ cifs_sb -> mountdata = kstrndup (ctx -> mount_options , PAGE_SIZE , GFP_KERNEL );
812
815
if (cifs_sb -> mountdata == NULL ) {
813
816
root = ERR_PTR (- ENOMEM );
814
817
goto out_free ;
@@ -878,19 +881,6 @@ cifs_smb3_do_mount(struct file_system_type *fs_type,
878
881
goto out ;
879
882
}
880
883
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
- }
894
884
895
885
static ssize_t
896
886
cifs_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
1027
1017
struct file_system_type cifs_fs_type = {
1028
1018
.owner = THIS_MODULE ,
1029
1019
.name = "cifs" ,
1030
- .mount = cifs_do_mount ,
1020
+ .init_fs_context = smb3_init_fs_context ,
1021
+ .parameters = smb3_fs_parameters ,
1031
1022
.kill_sb = cifs_kill_sb ,
1032
1023
.fs_flags = FS_RENAME_DOES_D_MOVE ,
1033
1024
};
@@ -1036,7 +1027,8 @@ MODULE_ALIAS_FS("cifs");
1036
1027
static struct file_system_type smb3_fs_type = {
1037
1028
.owner = THIS_MODULE ,
1038
1029
.name = "smb3" ,
1039
- .mount = smb3_do_mount ,
1030
+ .init_fs_context = smb3_init_fs_context ,
1031
+ .parameters = smb3_fs_parameters ,
1040
1032
.kill_sb = cifs_kill_sb ,
1041
1033
.fs_flags = FS_RENAME_DOES_D_MOVE ,
1042
1034
};
0 commit comments