Skip to content

Commit 39cb67b

Browse files
Stanislav KinsburskyTrond Myklebust
authored andcommitted
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>
1 parent 9df69c8 commit 39cb67b

1 file changed

Lines changed: 4 additions & 15 deletions

File tree

‎fs/nfs/cache_lib.c‎

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -126,24 +126,14 @@ int nfs_cache_register_sb(struct super_block *sb, struct cache_detail *cd)
126126

127127
int nfs_cache_register_net(struct net *net, struct cache_detail *cd)
128128
{
129-
struct vfsmount *mnt;
130129
struct super_block *pipefs_sb;
131-
int ret;
130+
int ret = 0;
132131

133-
mnt = rpc_get_mount();
134-
if (IS_ERR(mnt))
135-
return PTR_ERR(mnt);
136132
pipefs_sb = rpc_get_sb_net(net);
137-
if (!pipefs_sb) {
138-
ret = -ENOENT;
139-
goto err;
133+
if (pipefs_sb) {
134+
ret = nfs_cache_register_sb(pipefs_sb, cd);
135+
rpc_put_sb_net(net);
140136
}
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();
147137
return ret;
148138
}
149139

@@ -162,7 +152,6 @@ void nfs_cache_unregister_net(struct net *net, struct cache_detail *cd)
162152
nfs_cache_unregister_sb(pipefs_sb, cd);
163153
rpc_put_sb_net(net);
164154
}
165-
rpc_put_mount();
166155
}
167156

168157
void nfs_cache_init(struct cache_detail *cd)

0 commit comments

Comments
 (0)