mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 01:21:58 +00:00
NFS: simplify and clean cache library
This is a cleanup patch. Such helpers like nfs_cache_init() and nfs_cache_destroy() are redundant, because they are just a wrappers around sunrpc_init_cache_detail() and sunrpc_destroy_cache_detail() respectively. So let's remove them completely and move corresponding logic to nfs_cache_register_net() and nfs_cache_unregister_net() respectively (since they are called together anyway). Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
parent
483479c26a
commit
462b8f6bf1
3 changed files with 4 additions and 16 deletions
|
@ -128,10 +128,13 @@ int nfs_cache_register_net(struct net *net, struct cache_detail *cd)
|
|||
struct super_block *pipefs_sb;
|
||||
int ret = 0;
|
||||
|
||||
sunrpc_init_cache_detail(cd);
|
||||
pipefs_sb = rpc_get_sb_net(net);
|
||||
if (pipefs_sb) {
|
||||
ret = nfs_cache_register_sb(pipefs_sb, cd);
|
||||
rpc_put_sb_net(net);
|
||||
if (ret)
|
||||
sunrpc_destroy_cache_detail(cd);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@ -151,14 +154,5 @@ void nfs_cache_unregister_net(struct net *net, struct cache_detail *cd)
|
|||
nfs_cache_unregister_sb(pipefs_sb, cd);
|
||||
rpc_put_sb_net(net);
|
||||
}
|
||||
}
|
||||
|
||||
void nfs_cache_init(struct cache_detail *cd)
|
||||
{
|
||||
sunrpc_init_cache_detail(cd);
|
||||
}
|
||||
|
||||
void nfs_cache_destroy(struct cache_detail *cd)
|
||||
{
|
||||
sunrpc_destroy_cache_detail(cd);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue