aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/cache_lib.c
diff options
context:
space:
mode:
authorStanislav Kinsbursky <skinsbursky@parallels.com>2011-11-25 09:12:40 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-01-31 18:20:26 -0500
commit820f9442e711a81749e70c40f149fc54c4ce0ca8 (patch)
treed3e3f9b6e32cc8f19189d9760ce60ee502b81ee8 /fs/nfs/cache_lib.c
parent30507f58ce11e7664512059c708347d7a7d75271 (diff)
SUNRPC: split cache creation and PipeFS registration
This precursor patch splits SUNRPC cache creation and PipeFS registartion. It's required for latter split of NFS DNS resolver cache creation per network namespace context and PipeFS registration/unregistration on MOUNT/UMOUNT events. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/cache_lib.c')
-rw-r--r--fs/nfs/cache_lib.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/nfs/cache_lib.c b/fs/nfs/cache_lib.c
index c98b439332fc..d62a8951cb12 100644
--- a/fs/nfs/cache_lib.c
+++ b/fs/nfs/cache_lib.c
@@ -120,6 +120,7 @@ int nfs_cache_register(struct cache_detail *cd)
120 mnt = rpc_get_mount(); 120 mnt = rpc_get_mount();
121 if (IS_ERR(mnt)) 121 if (IS_ERR(mnt))
122 return PTR_ERR(mnt); 122 return PTR_ERR(mnt);
123 sunrpc_init_cache_detail(cd);
123 ret = vfs_path_lookup(mnt->mnt_root, mnt, "/cache", 0, &path); 124 ret = vfs_path_lookup(mnt->mnt_root, mnt, "/cache", 0, &path);
124 if (ret) 125 if (ret)
125 goto err; 126 goto err;
@@ -128,6 +129,7 @@ int nfs_cache_register(struct cache_detail *cd)
128 if (!ret) 129 if (!ret)
129 return ret; 130 return ret;
130err: 131err:
132 sunrpc_destroy_cache_detail(cd);
131 rpc_put_mount(); 133 rpc_put_mount();
132 return ret; 134 return ret;
133} 135}
@@ -135,6 +137,7 @@ err:
135void nfs_cache_unregister(struct cache_detail *cd) 137void nfs_cache_unregister(struct cache_detail *cd)
136{ 138{
137 sunrpc_cache_unregister_pipefs(cd); 139 sunrpc_cache_unregister_pipefs(cd);
140 sunrpc_destroy_cache_detail(cd);
138 rpc_put_mount(); 141 rpc_put_mount();
139} 142}
140 143