21
21
#include <linux/buffer_head.h>
22
22
#include <linux/writeback.h>
23
23
#include <linux/statfs.h>
24
+ #include <linux/fs_context.h>
24
25
#include "qnx4.h"
25
26
26
27
#define QNX4_VERSION 4
@@ -30,28 +31,33 @@ static const struct super_operations qnx4_sops;
30
31
31
32
static struct inode * qnx4_alloc_inode (struct super_block * sb );
32
33
static void qnx4_free_inode (struct inode * inode );
33
- static int qnx4_remount (struct super_block * sb , int * flags , char * data );
34
34
static int qnx4_statfs (struct dentry * , struct kstatfs * );
35
+ static int qnx4_get_tree (struct fs_context * fc );
35
36
36
37
static const struct super_operations qnx4_sops =
37
38
{
38
39
.alloc_inode = qnx4_alloc_inode ,
39
40
.free_inode = qnx4_free_inode ,
40
41
.statfs = qnx4_statfs ,
41
- .remount_fs = qnx4_remount ,
42
42
};
43
43
44
- static int qnx4_remount (struct super_block * sb , int * flags , char * data )
44
+ static int qnx4_reconfigure (struct fs_context * fc )
45
45
{
46
+ struct super_block * sb = fc -> root -> d_sb ;
46
47
struct qnx4_sb_info * qs ;
47
48
48
49
sync_filesystem (sb );
49
50
qs = qnx4_sb (sb );
50
51
qs -> Version = QNX4_VERSION ;
51
- * flags |= SB_RDONLY ;
52
+ fc -> sb_flags |= SB_RDONLY ;
52
53
return 0 ;
53
54
}
54
55
56
+ static const struct fs_context_operations qnx4_context_opts = {
57
+ .get_tree = qnx4_get_tree ,
58
+ .reconfigure = qnx4_reconfigure ,
59
+ };
60
+
55
61
static int qnx4_get_block ( struct inode * inode , sector_t iblock , struct buffer_head * bh , int create )
56
62
{
57
63
unsigned long phys ;
@@ -183,12 +189,13 @@ static const char *qnx4_checkroot(struct super_block *sb,
183
189
return "bitmap file not found." ;
184
190
}
185
191
186
- static int qnx4_fill_super (struct super_block * s , void * data , int silent )
192
+ static int qnx4_fill_super (struct super_block * s , struct fs_context * fc )
187
193
{
188
194
struct buffer_head * bh ;
189
195
struct inode * root ;
190
196
const char * errmsg ;
191
197
struct qnx4_sb_info * qs ;
198
+ int silent = fc -> sb_flags & SB_SILENT ;
192
199
193
200
qs = kzalloc (sizeof (struct qnx4_sb_info ), GFP_KERNEL );
194
201
if (!qs )
@@ -216,7 +223,7 @@ static int qnx4_fill_super(struct super_block *s, void *data, int silent)
216
223
errmsg = qnx4_checkroot (s , (struct qnx4_super_block * ) bh -> b_data );
217
224
brelse (bh );
218
225
if (errmsg != NULL ) {
219
- if (!silent )
226
+ if (!silent )
220
227
printk (KERN_ERR "qnx4: %s\n" , errmsg );
221
228
return - EINVAL ;
222
229
}
@@ -235,6 +242,18 @@ static int qnx4_fill_super(struct super_block *s, void *data, int silent)
235
242
return 0 ;
236
243
}
237
244
245
+ static int qnx4_get_tree (struct fs_context * fc )
246
+ {
247
+ return get_tree_bdev (fc , qnx4_fill_super );
248
+ }
249
+
250
+ static int qnx4_init_fs_context (struct fs_context * fc )
251
+ {
252
+ fc -> ops = & qnx4_context_opts ;
253
+
254
+ return 0 ;
255
+ }
256
+
238
257
static void qnx4_kill_sb (struct super_block * sb )
239
258
{
240
259
struct qnx4_sb_info * qs = qnx4_sb (sb );
@@ -376,18 +395,12 @@ static void destroy_inodecache(void)
376
395
kmem_cache_destroy (qnx4_inode_cachep );
377
396
}
378
397
379
- static struct dentry * qnx4_mount (struct file_system_type * fs_type ,
380
- int flags , const char * dev_name , void * data )
381
- {
382
- return mount_bdev (fs_type , flags , dev_name , data , qnx4_fill_super );
383
- }
384
-
385
398
static struct file_system_type qnx4_fs_type = {
386
- .owner = THIS_MODULE ,
387
- .name = "qnx4" ,
388
- .mount = qnx4_mount ,
389
- .kill_sb = qnx4_kill_sb ,
390
- .fs_flags = FS_REQUIRES_DEV ,
399
+ .owner = THIS_MODULE ,
400
+ .name = "qnx4" ,
401
+ .kill_sb = qnx4_kill_sb ,
402
+ .fs_flags = FS_REQUIRES_DEV ,
403
+ .init_fs_context = qnx4_init_fs_context ,
391
404
};
392
405
MODULE_ALIAS_FS ("qnx4" );
393
406
0 commit comments