diff options
Diffstat (limited to 'fs/nfs/inode.c')
-rw-r--r-- | fs/nfs/inode.c | 112 |
1 files changed, 56 insertions, 56 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index f7296983eba6..9b47610338f5 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> |
@@ -51,6 +50,7 @@ | |||
51 | #include "fscache.h" | 50 | #include "fscache.h" |
52 | #include "dns_resolve.h" | 51 | #include "dns_resolve.h" |
53 | #include "pnfs.h" | 52 | #include "pnfs.h" |
53 | #include "nfs.h" | ||
54 | #include "netns.h" | 54 | #include "netns.h" |
55 | 55 | ||
56 | #define NFSDBG_FACILITY NFSDBG_VFS | 56 | #define NFSDBG_FACILITY NFSDBG_VFS |
@@ -82,6 +82,7 @@ int nfs_wait_bit_killable(void *word) | |||
82 | freezable_schedule(); | 82 | freezable_schedule(); |
83 | return 0; | 83 | return 0; |
84 | } | 84 | } |
85 | EXPORT_SYMBOL_GPL(nfs_wait_bit_killable); | ||
85 | 86 | ||
86 | /** | 87 | /** |
87 | * nfs_compat_user_ino64 - returns the user-visible inode number | 88 | * nfs_compat_user_ino64 - returns the user-visible inode number |
@@ -106,7 +107,7 @@ u64 nfs_compat_user_ino64(u64 fileid) | |||
106 | return ino; | 107 | return ino; |
107 | } | 108 | } |
108 | 109 | ||
109 | static void nfs_clear_inode(struct inode *inode) | 110 | void nfs_clear_inode(struct inode *inode) |
110 | { | 111 | { |
111 | /* | 112 | /* |
112 | * The following should never happen... | 113 | * The following should never happen... |
@@ -117,6 +118,7 @@ static void nfs_clear_inode(struct inode *inode) | |||
117 | nfs_access_zap_cache(inode); | 118 | nfs_access_zap_cache(inode); |
118 | nfs_fscache_release_inode_cookie(inode); | 119 | nfs_fscache_release_inode_cookie(inode); |
119 | } | 120 | } |
121 | EXPORT_SYMBOL_GPL(nfs_clear_inode); | ||
120 | 122 | ||
121 | void nfs_evict_inode(struct inode *inode) | 123 | void nfs_evict_inode(struct inode *inode) |
122 | { | 124 | { |
@@ -152,7 +154,7 @@ static void nfs_zap_caches_locked(struct inode *inode) | |||
152 | nfsi->attrtimeo = NFS_MINATTRTIMEO(inode); | 154 | nfsi->attrtimeo = NFS_MINATTRTIMEO(inode); |
153 | nfsi->attrtimeo_timestamp = jiffies; | 155 | nfsi->attrtimeo_timestamp = jiffies; |
154 | 156 | ||
155 | memset(NFS_COOKIEVERF(inode), 0, sizeof(NFS_COOKIEVERF(inode))); | 157 | memset(NFS_I(inode)->cookieverf, 0, sizeof(NFS_I(inode)->cookieverf)); |
156 | if (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)) | 158 | if (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)) |
157 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL|NFS_INO_REVAL_PAGECACHE; | 159 | nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL|NFS_INO_REVAL_PAGECACHE; |
158 | else | 160 | else |
@@ -186,6 +188,7 @@ void nfs_zap_acl_cache(struct inode *inode) | |||
186 | NFS_I(inode)->cache_validity &= ~NFS_INO_INVALID_ACL; | 188 | NFS_I(inode)->cache_validity &= ~NFS_INO_INVALID_ACL; |
187 | spin_unlock(&inode->i_lock); | 189 | spin_unlock(&inode->i_lock); |
188 | } | 190 | } |
191 | EXPORT_SYMBOL_GPL(nfs_zap_acl_cache); | ||
189 | 192 | ||
190 | void nfs_invalidate_atime(struct inode *inode) | 193 | void nfs_invalidate_atime(struct inode *inode) |
191 | { | 194 | { |
@@ -193,6 +196,7 @@ void nfs_invalidate_atime(struct inode *inode) | |||
193 | NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATIME; | 196 | NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATIME; |
194 | spin_unlock(&inode->i_lock); | 197 | spin_unlock(&inode->i_lock); |
195 | } | 198 | } |
199 | EXPORT_SYMBOL_GPL(nfs_invalidate_atime); | ||
196 | 200 | ||
197 | /* | 201 | /* |
198 | * Invalidate, but do not unhash, the inode. | 202 | * Invalidate, but do not unhash, the inode. |
@@ -391,6 +395,7 @@ out_no_inode: | |||
391 | dprintk("nfs_fhget: iget failed with error %ld\n", PTR_ERR(inode)); | 395 | dprintk("nfs_fhget: iget failed with error %ld\n", PTR_ERR(inode)); |
392 | goto out; | 396 | goto out; |
393 | } | 397 | } |
398 | EXPORT_SYMBOL_GPL(nfs_fhget); | ||
394 | 399 | ||
395 | #define NFS_VALID_ATTRS (ATTR_MODE|ATTR_UID|ATTR_GID|ATTR_SIZE|ATTR_ATIME|ATTR_ATIME_SET|ATTR_MTIME|ATTR_MTIME_SET|ATTR_FILE|ATTR_OPEN) | 400 | #define NFS_VALID_ATTRS (ATTR_MODE|ATTR_UID|ATTR_GID|ATTR_SIZE|ATTR_ATIME|ATTR_ATIME_SET|ATTR_MTIME|ATTR_MTIME_SET|ATTR_FILE|ATTR_OPEN) |
396 | 401 | ||
@@ -430,7 +435,7 @@ nfs_setattr(struct dentry *dentry, struct iattr *attr) | |||
430 | * Return any delegations if we're going to change ACLs | 435 | * Return any delegations if we're going to change ACLs |
431 | */ | 436 | */ |
432 | if ((attr->ia_valid & (ATTR_MODE|ATTR_UID|ATTR_GID)) != 0) | 437 | if ((attr->ia_valid & (ATTR_MODE|ATTR_UID|ATTR_GID)) != 0) |
433 | nfs_inode_return_delegation(inode); | 438 | NFS_PROTO(inode)->return_delegation(inode); |
434 | error = NFS_PROTO(inode)->setattr(dentry, fattr, attr); | 439 | error = NFS_PROTO(inode)->setattr(dentry, fattr, attr); |
435 | if (error == 0) | 440 | if (error == 0) |
436 | nfs_refresh_inode(inode, fattr); | 441 | nfs_refresh_inode(inode, fattr); |
@@ -438,6 +443,7 @@ nfs_setattr(struct dentry *dentry, struct iattr *attr) | |||
438 | out: | 443 | out: |
439 | return error; | 444 | return error; |
440 | } | 445 | } |
446 | EXPORT_SYMBOL_GPL(nfs_setattr); | ||
441 | 447 | ||
442 | /** | 448 | /** |
443 | * nfs_vmtruncate - unmap mappings "freed" by truncate() syscall | 449 | * nfs_vmtruncate - unmap mappings "freed" by truncate() syscall |
@@ -496,6 +502,7 @@ void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr) | |||
496 | nfs_vmtruncate(inode, attr->ia_size); | 502 | nfs_vmtruncate(inode, attr->ia_size); |
497 | } | 503 | } |
498 | } | 504 | } |
505 | EXPORT_SYMBOL_GPL(nfs_setattr_update_inode); | ||
499 | 506 | ||
500 | int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) | 507 | int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) |
501 | { | 508 | { |
@@ -535,6 +542,7 @@ int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) | |||
535 | out: | 542 | out: |
536 | return err; | 543 | return err; |
537 | } | 544 | } |
545 | EXPORT_SYMBOL_GPL(nfs_getattr); | ||
538 | 546 | ||
539 | static void nfs_init_lock_context(struct nfs_lock_context *l_ctx) | 547 | static void nfs_init_lock_context(struct nfs_lock_context *l_ctx) |
540 | { | 548 | { |
@@ -623,6 +631,7 @@ void nfs_close_context(struct nfs_open_context *ctx, int is_sync) | |||
623 | return; | 631 | return; |
624 | nfs_revalidate_inode(server, inode); | 632 | nfs_revalidate_inode(server, inode); |
625 | } | 633 | } |
634 | EXPORT_SYMBOL_GPL(nfs_close_context); | ||
626 | 635 | ||
627 | struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, fmode_t f_mode) | 636 | struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, fmode_t f_mode) |
628 | { | 637 | { |
@@ -649,6 +658,7 @@ struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, fmode_t f | |||
649 | ctx->mdsthreshold = NULL; | 658 | ctx->mdsthreshold = NULL; |
650 | return ctx; | 659 | return ctx; |
651 | } | 660 | } |
661 | EXPORT_SYMBOL_GPL(alloc_nfs_open_context); | ||
652 | 662 | ||
653 | struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx) | 663 | struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx) |
654 | { | 664 | { |
@@ -656,6 +666,7 @@ struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx) | |||
656 | atomic_inc(&ctx->lock_context.count); | 666 | atomic_inc(&ctx->lock_context.count); |
657 | return ctx; | 667 | return ctx; |
658 | } | 668 | } |
669 | EXPORT_SYMBOL_GPL(get_nfs_open_context); | ||
659 | 670 | ||
660 | static void __put_nfs_open_context(struct nfs_open_context *ctx, int is_sync) | 671 | static void __put_nfs_open_context(struct nfs_open_context *ctx, int is_sync) |
661 | { | 672 | { |
@@ -683,6 +694,7 @@ void put_nfs_open_context(struct nfs_open_context *ctx) | |||
683 | { | 694 | { |
684 | __put_nfs_open_context(ctx, 0); | 695 | __put_nfs_open_context(ctx, 0); |
685 | } | 696 | } |
697 | EXPORT_SYMBOL_GPL(put_nfs_open_context); | ||
686 | 698 | ||
687 | /* | 699 | /* |
688 | * Ensure that mmap has a recent RPC credential for use when writing out | 700 | * Ensure that mmap has a recent RPC credential for use when writing out |
@@ -698,6 +710,7 @@ void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx) | |||
698 | list_add(&ctx->list, &nfsi->open_files); | 710 | list_add(&ctx->list, &nfsi->open_files); |
699 | spin_unlock(&inode->i_lock); | 711 | spin_unlock(&inode->i_lock); |
700 | } | 712 | } |
713 | EXPORT_SYMBOL_GPL(nfs_file_set_open_context); | ||
701 | 714 | ||
702 | /* | 715 | /* |
703 | * Given an inode, search for an open context with the desired characteristics | 716 | * Given an inode, search for an open context with the desired characteristics |
@@ -842,6 +855,7 @@ int nfs_revalidate_inode(struct nfs_server *server, struct inode *inode) | |||
842 | return NFS_STALE(inode) ? -ESTALE : 0; | 855 | return NFS_STALE(inode) ? -ESTALE : 0; |
843 | return __nfs_revalidate_inode(server, inode); | 856 | return __nfs_revalidate_inode(server, inode); |
844 | } | 857 | } |
858 | EXPORT_SYMBOL_GPL(nfs_revalidate_inode); | ||
845 | 859 | ||
846 | static int nfs_invalidate_mapping(struct inode *inode, struct address_space *mapping) | 860 | static int nfs_invalidate_mapping(struct inode *inode, struct address_space *mapping) |
847 | { | 861 | { |
@@ -883,6 +897,10 @@ int nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping) | |||
883 | struct nfs_inode *nfsi = NFS_I(inode); | 897 | struct nfs_inode *nfsi = NFS_I(inode); |
884 | int ret = 0; | 898 | int ret = 0; |
885 | 899 | ||
900 | /* swapfiles are not supposed to be shared. */ | ||
901 | if (IS_SWAPFILE(inode)) | ||
902 | goto out; | ||
903 | |||
886 | if (nfs_mapping_need_revalidate_inode(inode)) { | 904 | if (nfs_mapping_need_revalidate_inode(inode)) { |
887 | ret = __nfs_revalidate_inode(NFS_SERVER(inode), inode); | 905 | ret = __nfs_revalidate_inode(NFS_SERVER(inode), inode); |
888 | if (ret < 0) | 906 | if (ret < 0) |
@@ -1028,6 +1046,7 @@ void nfs_fattr_init(struct nfs_fattr *fattr) | |||
1028 | fattr->owner_name = NULL; | 1046 | fattr->owner_name = NULL; |
1029 | fattr->group_name = NULL; | 1047 | fattr->group_name = NULL; |
1030 | } | 1048 | } |
1049 | EXPORT_SYMBOL_GPL(nfs_fattr_init); | ||
1031 | 1050 | ||
1032 | struct nfs_fattr *nfs_alloc_fattr(void) | 1051 | struct nfs_fattr *nfs_alloc_fattr(void) |
1033 | { | 1052 | { |
@@ -1038,6 +1057,7 @@ struct nfs_fattr *nfs_alloc_fattr(void) | |||
1038 | nfs_fattr_init(fattr); | 1057 | nfs_fattr_init(fattr); |
1039 | return fattr; | 1058 | return fattr; |
1040 | } | 1059 | } |
1060 | EXPORT_SYMBOL_GPL(nfs_alloc_fattr); | ||
1041 | 1061 | ||
1042 | struct nfs_fh *nfs_alloc_fhandle(void) | 1062 | struct nfs_fh *nfs_alloc_fhandle(void) |
1043 | { | 1063 | { |
@@ -1048,6 +1068,7 @@ struct nfs_fh *nfs_alloc_fhandle(void) | |||
1048 | fh->size = 0; | 1068 | fh->size = 0; |
1049 | return fh; | 1069 | return fh; |
1050 | } | 1070 | } |
1071 | EXPORT_SYMBOL_GPL(nfs_alloc_fhandle); | ||
1051 | 1072 | ||
1052 | #ifdef NFS_DEBUG | 1073 | #ifdef NFS_DEBUG |
1053 | /* | 1074 | /* |
@@ -1168,6 +1189,7 @@ int nfs_refresh_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1168 | 1189 | ||
1169 | return status; | 1190 | return status; |
1170 | } | 1191 | } |
1192 | EXPORT_SYMBOL_GPL(nfs_refresh_inode); | ||
1171 | 1193 | ||
1172 | static int nfs_post_op_update_inode_locked(struct inode *inode, struct nfs_fattr *fattr) | 1194 | static int nfs_post_op_update_inode_locked(struct inode *inode, struct nfs_fattr *fattr) |
1173 | { | 1195 | { |
@@ -1204,6 +1226,7 @@ int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1204 | spin_unlock(&inode->i_lock); | 1226 | spin_unlock(&inode->i_lock); |
1205 | return status; | 1227 | return status; |
1206 | } | 1228 | } |
1229 | EXPORT_SYMBOL_GPL(nfs_post_op_update_inode); | ||
1207 | 1230 | ||
1208 | /** | 1231 | /** |
1209 | * nfs_post_op_update_inode_force_wcc - try to update the inode attribute cache | 1232 | * nfs_post_op_update_inode_force_wcc - try to update the inode attribute cache |
@@ -1255,6 +1278,7 @@ out_noforce: | |||
1255 | spin_unlock(&inode->i_lock); | 1278 | spin_unlock(&inode->i_lock); |
1256 | return status; | 1279 | return status; |
1257 | } | 1280 | } |
1281 | EXPORT_SYMBOL_GPL(nfs_post_op_update_inode_force_wcc); | ||
1258 | 1282 | ||
1259 | /* | 1283 | /* |
1260 | * Many nfs protocol calls return the new file attributes after | 1284 | * Many nfs protocol calls return the new file attributes after |
@@ -1457,7 +1481,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1457 | if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) | 1481 | if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) |
1458 | || S_ISLNK(inode->i_mode))) | 1482 | || S_ISLNK(inode->i_mode))) |
1459 | invalid &= ~NFS_INO_INVALID_DATA; | 1483 | invalid &= ~NFS_INO_INVALID_DATA; |
1460 | if (!nfs_have_delegation(inode, FMODE_READ) || | 1484 | if (!NFS_PROTO(inode)->have_delegation(inode, FMODE_READ) || |
1461 | (save_cache_validity & NFS_INO_REVAL_FORCED)) | 1485 | (save_cache_validity & NFS_INO_REVAL_FORCED)) |
1462 | nfsi->cache_validity |= invalid; | 1486 | nfsi->cache_validity |= invalid; |
1463 | 1487 | ||
@@ -1472,27 +1496,6 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1472 | return -ESTALE; | 1496 | return -ESTALE; |
1473 | } | 1497 | } |
1474 | 1498 | ||
1475 | |||
1476 | #ifdef CONFIG_NFS_V4 | ||
1477 | |||
1478 | /* | ||
1479 | * Clean out any remaining NFSv4 state that might be left over due | ||
1480 | * to open() calls that passed nfs_atomic_lookup, but failed to call | ||
1481 | * nfs_open(). | ||
1482 | */ | ||
1483 | void nfs4_evict_inode(struct inode *inode) | ||
1484 | { | ||
1485 | truncate_inode_pages(&inode->i_data, 0); | ||
1486 | clear_inode(inode); | ||
1487 | pnfs_return_layout(inode); | ||
1488 | pnfs_destroy_layout(NFS_I(inode)); | ||
1489 | /* If we are holding a delegation, return it! */ | ||
1490 | nfs_inode_return_delegation_noreclaim(inode); | ||
1491 | /* First call standard NFS clear_inode() code */ | ||
1492 | nfs_clear_inode(inode); | ||
1493 | } | ||
1494 | #endif | ||
1495 | |||
1496 | struct inode *nfs_alloc_inode(struct super_block *sb) | 1499 | struct inode *nfs_alloc_inode(struct super_block *sb) |
1497 | { | 1500 | { |
1498 | struct nfs_inode *nfsi; | 1501 | struct nfs_inode *nfsi; |
@@ -1505,11 +1508,12 @@ struct inode *nfs_alloc_inode(struct super_block *sb) | |||
1505 | nfsi->acl_access = ERR_PTR(-EAGAIN); | 1508 | nfsi->acl_access = ERR_PTR(-EAGAIN); |
1506 | nfsi->acl_default = ERR_PTR(-EAGAIN); | 1509 | nfsi->acl_default = ERR_PTR(-EAGAIN); |
1507 | #endif | 1510 | #endif |
1508 | #ifdef CONFIG_NFS_V4 | 1511 | #if IS_ENABLED(CONFIG_NFS_V4) |
1509 | nfsi->nfs4_acl = NULL; | 1512 | nfsi->nfs4_acl = NULL; |
1510 | #endif /* CONFIG_NFS_V4 */ | 1513 | #endif /* CONFIG_NFS_V4 */ |
1511 | return &nfsi->vfs_inode; | 1514 | return &nfsi->vfs_inode; |
1512 | } | 1515 | } |
1516 | EXPORT_SYMBOL_GPL(nfs_alloc_inode); | ||
1513 | 1517 | ||
1514 | static void nfs_i_callback(struct rcu_head *head) | 1518 | static void nfs_i_callback(struct rcu_head *head) |
1515 | { | 1519 | { |
@@ -1521,10 +1525,11 @@ void nfs_destroy_inode(struct inode *inode) | |||
1521 | { | 1525 | { |
1522 | call_rcu(&inode->i_rcu, nfs_i_callback); | 1526 | call_rcu(&inode->i_rcu, nfs_i_callback); |
1523 | } | 1527 | } |
1528 | EXPORT_SYMBOL_GPL(nfs_destroy_inode); | ||
1524 | 1529 | ||
1525 | static inline void nfs4_init_once(struct nfs_inode *nfsi) | 1530 | static inline void nfs4_init_once(struct nfs_inode *nfsi) |
1526 | { | 1531 | { |
1527 | #ifdef CONFIG_NFS_V4 | 1532 | #if IS_ENABLED(CONFIG_NFS_V4) |
1528 | INIT_LIST_HEAD(&nfsi->open_states); | 1533 | INIT_LIST_HEAD(&nfsi->open_states); |
1529 | nfsi->delegation = NULL; | 1534 | nfsi->delegation = NULL; |
1530 | nfsi->delegation_state = 0; | 1535 | nfsi->delegation_state = 0; |
@@ -1570,6 +1575,7 @@ static void nfs_destroy_inodecache(void) | |||
1570 | } | 1575 | } |
1571 | 1576 | ||
1572 | struct workqueue_struct *nfsiod_workqueue; | 1577 | struct workqueue_struct *nfsiod_workqueue; |
1578 | EXPORT_SYMBOL_GPL(nfsiod_workqueue); | ||
1573 | 1579 | ||
1574 | /* | 1580 | /* |
1575 | * start up the nfsiod workqueue | 1581 | * start up the nfsiod workqueue |
@@ -1628,81 +1634,76 @@ static int __init init_nfs_fs(void) | |||
1628 | { | 1634 | { |
1629 | int err; | 1635 | int err; |
1630 | 1636 | ||
1631 | err = nfs_idmap_init(); | ||
1632 | if (err < 0) | ||
1633 | goto out10; | ||
1634 | |||
1635 | err = nfs_dns_resolver_init(); | 1637 | err = nfs_dns_resolver_init(); |
1636 | if (err < 0) | 1638 | if (err < 0) |
1637 | goto out9; | 1639 | goto out10;; |
1638 | 1640 | ||
1639 | err = register_pernet_subsys(&nfs_net_ops); | 1641 | err = register_pernet_subsys(&nfs_net_ops); |
1640 | if (err < 0) | 1642 | if (err < 0) |
1641 | goto out8; | 1643 | goto out9; |
1642 | 1644 | ||
1643 | err = nfs_fscache_register(); | 1645 | err = nfs_fscache_register(); |
1644 | if (err < 0) | 1646 | if (err < 0) |
1645 | goto out7; | 1647 | goto out8; |
1646 | 1648 | ||
1647 | err = nfsiod_start(); | 1649 | err = nfsiod_start(); |
1648 | if (err) | 1650 | if (err) |
1649 | goto out6; | 1651 | goto out7; |
1650 | 1652 | ||
1651 | err = nfs_fs_proc_init(); | 1653 | err = nfs_fs_proc_init(); |
1652 | if (err) | 1654 | if (err) |
1653 | goto out5; | 1655 | goto out6; |
1654 | 1656 | ||
1655 | err = nfs_init_nfspagecache(); | 1657 | err = nfs_init_nfspagecache(); |
1656 | if (err) | 1658 | if (err) |
1657 | goto out4; | 1659 | goto out5; |
1658 | 1660 | ||
1659 | err = nfs_init_inodecache(); | 1661 | err = nfs_init_inodecache(); |
1660 | if (err) | 1662 | if (err) |
1661 | goto out3; | 1663 | goto out4; |
1662 | 1664 | ||
1663 | err = nfs_init_readpagecache(); | 1665 | err = nfs_init_readpagecache(); |
1664 | if (err) | 1666 | if (err) |
1665 | goto out2; | 1667 | goto out3; |
1666 | 1668 | ||
1667 | err = nfs_init_writepagecache(); | 1669 | err = nfs_init_writepagecache(); |
1668 | if (err) | 1670 | if (err) |
1669 | goto out1; | 1671 | goto out2; |
1670 | 1672 | ||
1671 | err = nfs_init_directcache(); | 1673 | err = nfs_init_directcache(); |
1672 | if (err) | 1674 | if (err) |
1673 | goto out0; | 1675 | goto out1; |
1674 | 1676 | ||
1675 | #ifdef CONFIG_PROC_FS | 1677 | #ifdef CONFIG_PROC_FS |
1676 | rpc_proc_register(&init_net, &nfs_rpcstat); | 1678 | rpc_proc_register(&init_net, &nfs_rpcstat); |
1677 | #endif | 1679 | #endif |
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: |
1682 | #ifdef CONFIG_PROC_FS | 1685 | #ifdef CONFIG_PROC_FS |
1683 | rpc_proc_unregister(&init_net, "nfs"); | 1686 | rpc_proc_unregister(&init_net, "nfs"); |
1684 | #endif | 1687 | #endif |
1685 | nfs_destroy_directcache(); | 1688 | nfs_destroy_directcache(); |
1686 | out0: | ||
1687 | nfs_destroy_writepagecache(); | ||
1688 | out1: | 1689 | out1: |
1689 | nfs_destroy_readpagecache(); | 1690 | nfs_destroy_writepagecache(); |
1690 | out2: | 1691 | out2: |
1691 | nfs_destroy_inodecache(); | 1692 | nfs_destroy_readpagecache(); |
1692 | out3: | 1693 | out3: |
1693 | nfs_destroy_nfspagecache(); | 1694 | nfs_destroy_inodecache(); |
1694 | out4: | 1695 | out4: |
1695 | nfs_fs_proc_exit(); | 1696 | nfs_destroy_nfspagecache(); |
1696 | out5: | 1697 | out5: |
1697 | nfsiod_stop(); | 1698 | nfs_fs_proc_exit(); |
1698 | out6: | 1699 | out6: |
1699 | nfs_fscache_unregister(); | 1700 | nfsiod_stop(); |
1700 | out7: | 1701 | out7: |
1701 | unregister_pernet_subsys(&nfs_net_ops); | 1702 | nfs_fscache_unregister(); |
1702 | out8: | 1703 | out8: |
1703 | nfs_dns_resolver_destroy(); | 1704 | unregister_pernet_subsys(&nfs_net_ops); |
1704 | out9: | 1705 | out9: |
1705 | nfs_idmap_quit(); | 1706 | nfs_dns_resolver_destroy(); |
1706 | out10: | 1707 | out10: |
1707 | return err; | 1708 | return err; |
1708 | } | 1709 | } |
@@ -1717,7 +1718,6 @@ static void __exit exit_nfs_fs(void) | |||
1717 | nfs_fscache_unregister(); | 1718 | nfs_fscache_unregister(); |
1718 | unregister_pernet_subsys(&nfs_net_ops); | 1719 | unregister_pernet_subsys(&nfs_net_ops); |
1719 | nfs_dns_resolver_destroy(); | 1720 | nfs_dns_resolver_destroy(); |
1720 | nfs_idmap_quit(); | ||
1721 | #ifdef CONFIG_PROC_FS | 1721 | #ifdef CONFIG_PROC_FS |
1722 | rpc_proc_unregister(&init_net, "nfs"); | 1722 | rpc_proc_unregister(&init_net, "nfs"); |
1723 | #endif | 1723 | #endif |