diff options
Diffstat (limited to 'fs/nfs/inode.c')
-rw-r--r-- | fs/nfs/inode.c | 67 |
1 files changed, 37 insertions, 30 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 28c9ebbe78a6..35f7e4bc680e 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -32,7 +32,6 @@ | |||
32 | #include <linux/lockd/bind.h> | 32 | #include <linux/lockd/bind.h> |
33 | #include <linux/seq_file.h> | 33 | #include <linux/seq_file.h> |
34 | #include <linux/mount.h> | 34 | #include <linux/mount.h> |
35 | #include <linux/nfs_idmap.h> | ||
36 | #include <linux/vfs.h> | 35 | #include <linux/vfs.h> |
37 | #include <linux/inet.h> | 36 | #include <linux/inet.h> |
38 | #include <linux/nfs_xdr.h> | 37 | #include <linux/nfs_xdr.h> |
@@ -1628,87 +1627,96 @@ static int __init init_nfs_fs(void) | |||
1628 | { | 1627 | { |
1629 | int err; | 1628 | int err; |
1630 | 1629 | ||
1631 | err = nfs_idmap_init(); | ||
1632 | if (err < 0) | ||
1633 | goto out10; | ||
1634 | |||
1635 | err = nfs_dns_resolver_init(); | 1630 | err = nfs_dns_resolver_init(); |
1636 | if (err < 0) | 1631 | if (err < 0) |
1637 | goto out9; | 1632 | goto out11; |
1638 | 1633 | ||
1639 | err = register_pernet_subsys(&nfs_net_ops); | 1634 | err = register_pernet_subsys(&nfs_net_ops); |
1640 | if (err < 0) | 1635 | if (err < 0) |
1641 | goto out8; | 1636 | goto out10; |
1642 | 1637 | ||
1643 | err = nfs_fscache_register(); | 1638 | err = nfs_fscache_register(); |
1644 | if (err < 0) | 1639 | if (err < 0) |
1645 | goto out7; | 1640 | goto out9; |
1646 | 1641 | ||
1647 | err = nfsiod_start(); | 1642 | err = nfsiod_start(); |
1648 | if (err) | 1643 | if (err) |
1649 | goto out6; | 1644 | goto out8; |
1650 | 1645 | ||
1651 | err = nfs_fs_proc_init(); | 1646 | err = nfs_fs_proc_init(); |
1652 | if (err) | 1647 | if (err) |
1653 | goto out5; | 1648 | goto out7; |
1654 | 1649 | ||
1655 | err = nfs_init_nfspagecache(); | 1650 | err = nfs_init_nfspagecache(); |
1656 | if (err) | 1651 | if (err) |
1657 | goto out4; | 1652 | goto out6; |
1658 | 1653 | ||
1659 | err = nfs_init_inodecache(); | 1654 | err = nfs_init_inodecache(); |
1660 | if (err) | 1655 | if (err) |
1661 | goto out3; | 1656 | goto out5; |
1662 | 1657 | ||
1663 | err = nfs_init_readpagecache(); | 1658 | err = nfs_init_readpagecache(); |
1664 | if (err) | 1659 | if (err) |
1665 | goto out2; | 1660 | goto out4; |
1666 | 1661 | ||
1667 | err = nfs_init_writepagecache(); | 1662 | err = nfs_init_writepagecache(); |
1668 | if (err) | 1663 | if (err) |
1669 | goto out1; | 1664 | goto out3; |
1670 | 1665 | ||
1671 | err = nfs_init_directcache(); | 1666 | err = nfs_init_directcache(); |
1672 | if (err) | 1667 | if (err) |
1673 | goto out0; | 1668 | goto out2; |
1674 | 1669 | ||
1675 | #ifdef CONFIG_PROC_FS | 1670 | #ifdef CONFIG_PROC_FS |
1676 | rpc_proc_register(&init_net, &nfs_rpcstat); | 1671 | rpc_proc_register(&init_net, &nfs_rpcstat); |
1677 | #endif | 1672 | #endif |
1673 | |||
1674 | #ifdef CONFIG_NFS_V4 | ||
1675 | err = init_nfs_v4(); | ||
1676 | if (err) | ||
1677 | goto out1; | ||
1678 | #endif | ||
1679 | |||
1678 | if ((err = register_nfs_fs()) != 0) | 1680 | if ((err = register_nfs_fs()) != 0) |
1679 | goto out; | 1681 | goto out0; |
1682 | |||
1680 | return 0; | 1683 | return 0; |
1681 | out: | 1684 | out0: |
1685 | #ifdef CONFIG_NFS_V4 | ||
1686 | exit_nfs_v4(); | ||
1687 | out1: | ||
1688 | #endif | ||
1682 | #ifdef CONFIG_PROC_FS | 1689 | #ifdef CONFIG_PROC_FS |
1683 | rpc_proc_unregister(&init_net, "nfs"); | 1690 | rpc_proc_unregister(&init_net, "nfs"); |
1684 | #endif | 1691 | #endif |
1685 | nfs_destroy_directcache(); | 1692 | nfs_destroy_directcache(); |
1686 | out0: | ||
1687 | nfs_destroy_writepagecache(); | ||
1688 | out1: | ||
1689 | nfs_destroy_readpagecache(); | ||
1690 | out2: | 1693 | out2: |
1691 | nfs_destroy_inodecache(); | 1694 | nfs_destroy_writepagecache(); |
1692 | out3: | 1695 | out3: |
1693 | nfs_destroy_nfspagecache(); | 1696 | nfs_destroy_readpagecache(); |
1694 | out4: | 1697 | out4: |
1695 | nfs_fs_proc_exit(); | 1698 | nfs_destroy_inodecache(); |
1696 | out5: | 1699 | out5: |
1697 | nfsiod_stop(); | 1700 | nfs_destroy_nfspagecache(); |
1698 | out6: | 1701 | out6: |
1699 | nfs_fscache_unregister(); | 1702 | nfs_fs_proc_exit(); |
1700 | out7: | 1703 | out7: |
1701 | unregister_pernet_subsys(&nfs_net_ops); | 1704 | nfsiod_stop(); |
1702 | out8: | 1705 | out8: |
1703 | nfs_dns_resolver_destroy(); | 1706 | nfs_fscache_unregister(); |
1704 | out9: | 1707 | out9: |
1705 | nfs_idmap_quit(); | 1708 | unregister_pernet_subsys(&nfs_net_ops); |
1706 | out10: | 1709 | out10: |
1710 | nfs_dns_resolver_destroy(); | ||
1711 | out11: | ||
1707 | return err; | 1712 | return err; |
1708 | } | 1713 | } |
1709 | 1714 | ||
1710 | static void __exit exit_nfs_fs(void) | 1715 | static void __exit exit_nfs_fs(void) |
1711 | { | 1716 | { |
1717 | #ifdef CONFIG_NFS_V4 | ||
1718 | exit_nfs_v4(); | ||
1719 | #endif | ||
1712 | nfs_destroy_directcache(); | 1720 | nfs_destroy_directcache(); |
1713 | nfs_destroy_writepagecache(); | 1721 | nfs_destroy_writepagecache(); |
1714 | nfs_destroy_readpagecache(); | 1722 | nfs_destroy_readpagecache(); |
@@ -1717,7 +1725,6 @@ static void __exit exit_nfs_fs(void) | |||
1717 | nfs_fscache_unregister(); | 1725 | nfs_fscache_unregister(); |
1718 | unregister_pernet_subsys(&nfs_net_ops); | 1726 | unregister_pernet_subsys(&nfs_net_ops); |
1719 | nfs_dns_resolver_destroy(); | 1727 | nfs_dns_resolver_destroy(); |
1720 | nfs_idmap_quit(); | ||
1721 | #ifdef CONFIG_PROC_FS | 1728 | #ifdef CONFIG_PROC_FS |
1722 | rpc_proc_unregister(&init_net, "nfs"); | 1729 | rpc_proc_unregister(&init_net, "nfs"); |
1723 | #endif | 1730 | #endif |