|
25 | 25 | #include <linux/init.h>
|
26 | 26 | #include <linux/slab.h>
|
27 | 27 | #include <linux/buffer_head.h>
|
| 28 | +#include <linux/fs_context.h> |
28 | 29 | #include "sysv.h"
|
29 | 30 |
|
30 | 31 | /*
|
@@ -349,12 +350,13 @@ static int complete_read_super(struct super_block *sb, int silent, int size)
|
349 | 350 | return 1;
|
350 | 351 | }
|
351 | 352 |
|
352 |
| -static int sysv_fill_super(struct super_block *sb, void *data, int silent) |
| 353 | +static int sysv_fill_super(struct super_block *sb, struct fs_context *fc) |
353 | 354 | {
|
354 | 355 | struct buffer_head *bh1, *bh = NULL;
|
355 | 356 | struct sysv_sb_info *sbi;
|
356 | 357 | unsigned long blocknr;
|
357 | 358 | int size = 0, i;
|
| 359 | + int silent = fc->sb_flags & SB_SILENT; |
358 | 360 |
|
359 | 361 | BUILD_BUG_ON(1024 != sizeof (struct xenix_super_block));
|
360 | 362 | BUILD_BUG_ON(512 != sizeof (struct sysv4_super_block));
|
@@ -471,10 +473,11 @@ static int v7_sanity_check(struct super_block *sb, struct buffer_head *bh)
|
471 | 473 | return 1;
|
472 | 474 | }
|
473 | 475 |
|
474 |
| -static int v7_fill_super(struct super_block *sb, void *data, int silent) |
| 476 | +static int v7_fill_super(struct super_block *sb, struct fs_context *fc) |
475 | 477 | {
|
476 | 478 | struct sysv_sb_info *sbi;
|
477 | 479 | struct buffer_head *bh;
|
| 480 | + int silent = fc->sb_flags & SB_SILENT; |
478 | 481 |
|
479 | 482 | BUILD_BUG_ON(sizeof(struct v7_super_block) != 440);
|
480 | 483 | BUILD_BUG_ON(sizeof(struct sysv_inode) != 64);
|
@@ -528,33 +531,51 @@ static int v7_fill_super(struct super_block *sb, void *data, int silent)
|
528 | 531 |
|
529 | 532 | /* Every kernel module contains stuff like this. */
|
530 | 533 |
|
531 |
| -static struct dentry *sysv_mount(struct file_system_type *fs_type, |
532 |
| - int flags, const char *dev_name, void *data) |
| 534 | +static int sysv_get_tree(struct fs_context *fc) |
533 | 535 | {
|
534 |
| - return mount_bdev(fs_type, flags, dev_name, data, sysv_fill_super); |
| 536 | + return get_tree_bdev(fc, sysv_fill_super); |
535 | 537 | }
|
536 | 538 |
|
537 |
| -static struct dentry *v7_mount(struct file_system_type *fs_type, |
538 |
| - int flags, const char *dev_name, void *data) |
| 539 | +static int v7_get_tree(struct fs_context *fc) |
539 | 540 | {
|
540 |
| - return mount_bdev(fs_type, flags, dev_name, data, v7_fill_super); |
| 541 | + return get_tree_bdev(fc, v7_fill_super); |
| 542 | +} |
| 543 | + |
| 544 | +static const struct fs_context_operations sysv_context_ops = { |
| 545 | + .get_tree = sysv_get_tree, |
| 546 | +}; |
| 547 | + |
| 548 | +static const struct fs_context_operations v7_context_ops = { |
| 549 | + .get_tree = v7_get_tree, |
| 550 | +}; |
| 551 | + |
| 552 | +static int sysv_init_fs_context(struct fs_context *fc) |
| 553 | +{ |
| 554 | + fc->ops = &sysv_context_ops; |
| 555 | + return 0; |
| 556 | +} |
| 557 | + |
| 558 | +static int v7_init_fs_context(struct fs_context *fc) |
| 559 | +{ |
| 560 | + fc->ops = &v7_context_ops; |
| 561 | + return 0; |
541 | 562 | }
|
542 | 563 |
|
543 | 564 | static struct file_system_type sysv_fs_type = {
|
544 |
| - .owner = THIS_MODULE, |
545 |
| - .name = "sysv", |
546 |
| - .mount = sysv_mount, |
547 |
| - .kill_sb = kill_block_super, |
548 |
| - .fs_flags = FS_REQUIRES_DEV, |
| 565 | + .owner = THIS_MODULE, |
| 566 | + .name = "sysv", |
| 567 | + .kill_sb = kill_block_super, |
| 568 | + .fs_flags = FS_REQUIRES_DEV, |
| 569 | + .init_fs_context = sysv_init_fs_context, |
549 | 570 | };
|
550 | 571 | MODULE_ALIAS_FS("sysv");
|
551 | 572 |
|
552 | 573 | static struct file_system_type v7_fs_type = {
|
553 |
| - .owner = THIS_MODULE, |
554 |
| - .name = "v7", |
555 |
| - .mount = v7_mount, |
556 |
| - .kill_sb = kill_block_super, |
557 |
| - .fs_flags = FS_REQUIRES_DEV, |
| 574 | + .owner = THIS_MODULE, |
| 575 | + .name = "v7", |
| 576 | + .kill_sb = kill_block_super, |
| 577 | + .fs_flags = FS_REQUIRES_DEV, |
| 578 | + .init_fs_context = v7_init_fs_context, |
558 | 579 | };
|
559 | 580 | MODULE_ALIAS_FS("v7");
|
560 | 581 | MODULE_ALIAS("v7");
|
|
0 commit comments