.. | .. |
---|
34 | 34 | |
---|
35 | 35 | #include <linux/module.h> |
---|
36 | 36 | #include <linux/fs.h> |
---|
| 37 | +#include <linux/fs_context.h> |
---|
37 | 38 | #include <linux/mount.h> |
---|
38 | 39 | #include <linux/pagemap.h> |
---|
39 | 40 | #include <linux/init.h> |
---|
.. | .. |
---|
492 | 493 | remove_file(dir, "flash"); |
---|
493 | 494 | inode_unlock(d_inode(dir)); |
---|
494 | 495 | ret = simple_rmdir(d_inode(root), dir); |
---|
495 | | - d_delete(dir); |
---|
| 496 | + d_drop(dir); |
---|
496 | 497 | dput(dir); |
---|
497 | 498 | |
---|
498 | 499 | bail: |
---|
.. | .. |
---|
506 | 507 | * after device init. The direct add_cntr_files() call handles adding |
---|
507 | 508 | * them from the init code, when the fs is already mounted. |
---|
508 | 509 | */ |
---|
509 | | -static int qibfs_fill_super(struct super_block *sb, void *data, int silent) |
---|
| 510 | +static int qibfs_fill_super(struct super_block *sb, struct fs_context *fc) |
---|
510 | 511 | { |
---|
511 | | - struct qib_devdata *dd, *tmp; |
---|
512 | | - unsigned long flags; |
---|
| 512 | + struct qib_devdata *dd; |
---|
| 513 | + unsigned long index; |
---|
513 | 514 | int ret; |
---|
514 | 515 | |
---|
515 | 516 | static const struct tree_descr files[] = { |
---|
.. | .. |
---|
524 | 525 | goto bail; |
---|
525 | 526 | } |
---|
526 | 527 | |
---|
527 | | - spin_lock_irqsave(&qib_devs_lock, flags); |
---|
528 | | - |
---|
529 | | - list_for_each_entry_safe(dd, tmp, &qib_dev_list, list) { |
---|
530 | | - spin_unlock_irqrestore(&qib_devs_lock, flags); |
---|
| 528 | + xa_for_each(&qib_dev_table, index, dd) { |
---|
531 | 529 | ret = add_cntr_files(sb, dd); |
---|
532 | 530 | if (ret) |
---|
533 | 531 | goto bail; |
---|
534 | | - spin_lock_irqsave(&qib_devs_lock, flags); |
---|
535 | 532 | } |
---|
536 | | - |
---|
537 | | - spin_unlock_irqrestore(&qib_devs_lock, flags); |
---|
538 | 533 | |
---|
539 | 534 | bail: |
---|
540 | 535 | return ret; |
---|
541 | 536 | } |
---|
542 | 537 | |
---|
543 | | -static struct dentry *qibfs_mount(struct file_system_type *fs_type, int flags, |
---|
544 | | - const char *dev_name, void *data) |
---|
| 538 | +static int qibfs_get_tree(struct fs_context *fc) |
---|
545 | 539 | { |
---|
546 | | - struct dentry *ret; |
---|
547 | | - |
---|
548 | | - ret = mount_single(fs_type, flags, data, qibfs_fill_super); |
---|
549 | | - if (!IS_ERR(ret)) |
---|
550 | | - qib_super = ret->d_sb; |
---|
| 540 | + int ret = get_tree_single(fc, qibfs_fill_super); |
---|
| 541 | + if (ret == 0) |
---|
| 542 | + qib_super = fc->root->d_sb; |
---|
551 | 543 | return ret; |
---|
| 544 | +} |
---|
| 545 | + |
---|
| 546 | +static const struct fs_context_operations qibfs_context_ops = { |
---|
| 547 | + .get_tree = qibfs_get_tree, |
---|
| 548 | +}; |
---|
| 549 | + |
---|
| 550 | +static int qibfs_init_fs_context(struct fs_context *fc) |
---|
| 551 | +{ |
---|
| 552 | + fc->ops = &qibfs_context_ops; |
---|
| 553 | + return 0; |
---|
552 | 554 | } |
---|
553 | 555 | |
---|
554 | 556 | static void qibfs_kill_super(struct super_block *s) |
---|
.. | .. |
---|
589 | 591 | static struct file_system_type qibfs_fs_type = { |
---|
590 | 592 | .owner = THIS_MODULE, |
---|
591 | 593 | .name = "ipathfs", |
---|
592 | | - .mount = qibfs_mount, |
---|
| 594 | + .init_fs_context = qibfs_init_fs_context, |
---|
593 | 595 | .kill_sb = qibfs_kill_super, |
---|
594 | 596 | }; |
---|
595 | 597 | MODULE_ALIAS_FS("ipathfs"); |
---|