diff options
author | Stanislav Kinsbursky <skinsbursky@parallels.com> | 2011-11-25 09:13:20 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-01-31 18:20:26 -0500 |
commit | 39cb67b9a04300df41e201d9e6392691cdad080f (patch) | |
tree | 4fee2a5398b470b3503ea7af07a9d58b42f9c607 | |
parent | 9df69c81b469780b64f9b26bb87c048613fdeddf (diff) |
NFS: remove RPC PipeFS mount point references from NFS cache routines
This is a cleanup patch. We don't need this reference anymore, because DNS
resolver cache now creates it's dentries in per-net operations and on PipeFS
mount/umount notification.
Note that nfs_cache_register_net() now returns 0 instead of -ENOENT in case of
PiepFS superblock absence. This is ok, Dns resolver cache will be regestered on
PipeFS mount event.
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r-- | fs/nfs/cache_lib.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/fs/nfs/cache_lib.c b/fs/nfs/cache_lib.c index 5905a31211e5..dded26368111 100644 --- a/fs/nfs/cache_lib.c +++ b/fs/nfs/cache_lib.c | |||
@@ -126,24 +126,14 @@ int nfs_cache_register_sb(struct super_block *sb, struct cache_detail *cd) | |||
126 | 126 | ||
127 | int nfs_cache_register_net(struct net *net, struct cache_detail *cd) | 127 | int nfs_cache_register_net(struct net *net, struct cache_detail *cd) |
128 | { | 128 | { |
129 | struct vfsmount *mnt; | ||
130 | struct super_block *pipefs_sb; | 129 | struct super_block *pipefs_sb; |
131 | int ret; | 130 | int ret = 0; |
132 | 131 | ||
133 | mnt = rpc_get_mount(); | ||
134 | if (IS_ERR(mnt)) | ||
135 | return PTR_ERR(mnt); | ||
136 | pipefs_sb = rpc_get_sb_net(net); | 132 | pipefs_sb = rpc_get_sb_net(net); |
137 | if (!pipefs_sb) { | 133 | if (pipefs_sb) { |
138 | ret = -ENOENT; | 134 | ret = nfs_cache_register_sb(pipefs_sb, cd); |
139 | goto err; | 135 | rpc_put_sb_net(net); |
140 | } | 136 | } |
141 | ret = nfs_cache_register_sb(pipefs_sb, cd); | ||
142 | rpc_put_sb_net(net); | ||
143 | if (!ret) | ||
144 | return ret; | ||
145 | err: | ||
146 | rpc_put_mount(); | ||
147 | return ret; | 137 | return ret; |
148 | } | 138 | } |
149 | 139 | ||
@@ -162,7 +152,6 @@ void nfs_cache_unregister_net(struct net *net, struct cache_detail *cd) | |||
162 | nfs_cache_unregister_sb(pipefs_sb, cd); | 152 | nfs_cache_unregister_sb(pipefs_sb, cd); |
163 | rpc_put_sb_net(net); | 153 | rpc_put_sb_net(net); |
164 | } | 154 | } |
165 | rpc_put_mount(); | ||
166 | } | 155 | } |
167 | 156 | ||
168 | void nfs_cache_init(struct cache_detail *cd) | 157 | void nfs_cache_init(struct cache_detail *cd) |