17
17
#include <linux/writeback.h>
18
18
#include <linux/uio.h>
19
19
#include <linux/uaccess.h>
20
+ #include <linux/fs_context.h>
20
21
#include "bfs.h"
21
22
22
23
MODULE_AUTHOR (
"Tigran Aivazian <[email protected] >" );
@@ -305,7 +306,7 @@ void bfs_dump_imap(const char *prefix, struct super_block *s)
305
306
#endif
306
307
}
307
308
308
- static int bfs_fill_super (struct super_block * s , void * data , int silent )
309
+ static int bfs_fill_super (struct super_block * s , struct fs_context * fc )
309
310
{
310
311
struct buffer_head * bh , * sbh ;
311
312
struct bfs_super_block * bfs_sb ;
@@ -314,6 +315,7 @@ static int bfs_fill_super(struct super_block *s, void *data, int silent)
314
315
struct bfs_sb_info * info ;
315
316
int ret = - EINVAL ;
316
317
unsigned long i_sblock , i_eblock , i_eoff , s_size ;
318
+ int silent = fc -> sb_flags & SB_SILENT ;
317
319
318
320
info = kzalloc (sizeof (* info ), GFP_KERNEL );
319
321
if (!info )
@@ -446,18 +448,28 @@ static int bfs_fill_super(struct super_block *s, void *data, int silent)
446
448
return ret ;
447
449
}
448
450
449
- static struct dentry * bfs_mount (struct file_system_type * fs_type ,
450
- int flags , const char * dev_name , void * data )
451
+ static int bfs_get_tree (struct fs_context * fc )
451
452
{
452
- return mount_bdev (fs_type , flags , dev_name , data , bfs_fill_super );
453
+ return get_tree_bdev (fc , bfs_fill_super );
454
+ }
455
+
456
+ static const struct fs_context_operations bfs_context_ops = {
457
+ .get_tree = bfs_get_tree ,
458
+ };
459
+
460
+ static int bfs_init_fs_context (struct fs_context * fc )
461
+ {
462
+ fc -> ops = & bfs_context_ops ;
463
+
464
+ return 0 ;
453
465
}
454
466
455
467
static struct file_system_type bfs_fs_type = {
456
- .owner = THIS_MODULE ,
457
- .name = "bfs" ,
458
- .mount = bfs_mount ,
459
- .kill_sb = kill_block_super ,
460
- .fs_flags = FS_REQUIRES_DEV ,
468
+ .owner = THIS_MODULE ,
469
+ .name = "bfs" ,
470
+ .init_fs_context = bfs_init_fs_context ,
471
+ .kill_sb = kill_block_super ,
472
+ .fs_flags = FS_REQUIRES_DEV ,
461
473
};
462
474
MODULE_ALIAS_FS ("bfs" );
463
475
0 commit comments