20
20
#include <linux/mpage.h>
21
21
#include <linux/vfs.h>
22
22
#include <linux/writeback.h>
23
+ #include <linux/fs_context.h>
23
24
24
25
static int minix_write_inode (struct inode * inode ,
25
26
struct writeback_control * wbc );
26
27
static int minix_statfs (struct dentry * dentry , struct kstatfs * buf );
27
- static int minix_remount (struct super_block * sb , int * flags , char * data );
28
28
29
29
static void minix_evict_inode (struct inode * inode )
30
30
{
@@ -111,19 +111,19 @@ static const struct super_operations minix_sops = {
111
111
.evict_inode = minix_evict_inode ,
112
112
.put_super = minix_put_super ,
113
113
.statfs = minix_statfs ,
114
- .remount_fs = minix_remount ,
115
114
};
116
115
117
- static int minix_remount (struct super_block * sb , int * flags , char * data )
116
+ static int minix_reconfigure (struct fs_context * fc )
118
117
{
119
- struct minix_sb_info * sbi = minix_sb (sb );
120
118
struct minix_super_block * ms ;
119
+ struct super_block * sb = fc -> root -> d_sb ;
120
+ struct minix_sb_info * sbi = sb -> s_fs_info ;
121
121
122
122
sync_filesystem (sb );
123
123
ms = sbi -> s_ms ;
124
- if ((bool )(* flags & SB_RDONLY ) == sb_rdonly (sb ))
124
+ if ((bool )(fc -> sb_flags & SB_RDONLY ) == sb_rdonly (sb ))
125
125
return 0 ;
126
- if (* flags & SB_RDONLY ) {
126
+ if (fc -> sb_flags & SB_RDONLY ) {
127
127
if (ms -> s_state & MINIX_VALID_FS ||
128
128
!(sbi -> s_mount_state & MINIX_VALID_FS ))
129
129
return 0 ;
@@ -170,7 +170,7 @@ static bool minix_check_superblock(struct super_block *sb)
170
170
return true;
171
171
}
172
172
173
- static int minix_fill_super (struct super_block * s , void * data , int silent )
173
+ static int minix_fill_super (struct super_block * s , struct fs_context * fc )
174
174
{
175
175
struct buffer_head * bh ;
176
176
struct buffer_head * * map ;
@@ -180,6 +180,7 @@ static int minix_fill_super(struct super_block *s, void *data, int silent)
180
180
struct inode * root_inode ;
181
181
struct minix_sb_info * sbi ;
182
182
int ret = - EINVAL ;
183
+ int silent = fc -> sb_flags & SB_SILENT ;
183
184
184
185
sbi = kzalloc (sizeof (struct minix_sb_info ), GFP_KERNEL );
185
186
if (!sbi )
@@ -371,6 +372,23 @@ static int minix_fill_super(struct super_block *s, void *data, int silent)
371
372
return ret ;
372
373
}
373
374
375
+ static int minix_get_tree (struct fs_context * fc )
376
+ {
377
+ return get_tree_bdev (fc , minix_fill_super );
378
+ }
379
+
380
+ static const struct fs_context_operations minix_context_ops = {
381
+ .get_tree = minix_get_tree ,
382
+ .reconfigure = minix_reconfigure ,
383
+ };
384
+
385
+ static int minix_init_fs_context (struct fs_context * fc )
386
+ {
387
+ fc -> ops = & minix_context_ops ;
388
+
389
+ return 0 ;
390
+ }
391
+
374
392
static int minix_statfs (struct dentry * dentry , struct kstatfs * buf )
375
393
{
376
394
struct super_block * sb = dentry -> d_sb ;
@@ -680,18 +698,12 @@ void minix_truncate(struct inode * inode)
680
698
V2_minix_truncate (inode );
681
699
}
682
700
683
- static struct dentry * minix_mount (struct file_system_type * fs_type ,
684
- int flags , const char * dev_name , void * data )
685
- {
686
- return mount_bdev (fs_type , flags , dev_name , data , minix_fill_super );
687
- }
688
-
689
701
static struct file_system_type minix_fs_type = {
690
- .owner = THIS_MODULE ,
691
- .name = "minix" ,
692
- .mount = minix_mount ,
693
- .kill_sb = kill_block_super ,
694
- .fs_flags = FS_REQUIRES_DEV ,
702
+ .owner = THIS_MODULE ,
703
+ .name = "minix" ,
704
+ .kill_sb = kill_block_super ,
705
+ .fs_flags = FS_REQUIRES_DEV ,
706
+ .init_fs_context = minix_init_fs_context ,
695
707
};
696
708
MODULE_ALIAS_FS ("minix" );
697
709
0 commit comments