Skip to content

Commit

Permalink
nfsd: allocate id-to-name and name-to-id caches in per-net operations.
Browse files Browse the repository at this point in the history
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
  • Loading branch information
Stanislav Kinsbursky authored and J. Bruce Fields committed Apr 12, 2012
1 parent 9e75a4d commit f69adb2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions fs/nfsd/nfsctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1145,14 +1145,20 @@ static __net_init int nfsd_init_net(struct net *net)
retval = nfsd_export_init(net);
if (retval)
goto out_export_error;
retval = nfsd_idmap_init(net);
if (retval)
goto out_idmap_error;
return 0;

out_idmap_error:
nfsd_export_shutdown(net);
out_export_error:
return retval;
}

static __net_exit void nfsd_exit_net(struct net *net)
{
nfsd_idmap_shutdown(net);
nfsd_export_shutdown(net);
}

Expand Down Expand Up @@ -1186,21 +1192,16 @@ static int __init init_nfsd(void)
if (retval)
goto out_free_stat;
nfsd_lockd_init(); /* lockd->nfsd callbacks */
retval = nfsd_idmap_init(&init_net);
if (retval)
goto out_free_lockd;
retval = create_proc_exports_entry();
if (retval)
goto out_free_idmap;
goto out_free_lockd;
retval = register_filesystem(&nfsd_fs_type);
if (retval)
goto out_free_all;
return 0;
out_free_all:
remove_proc_entry("fs/nfs/exports", NULL);
remove_proc_entry("fs/nfs", NULL);
out_free_idmap:
nfsd_idmap_shutdown(&init_net);
out_free_lockd:
nfsd_lockd_shutdown();
nfsd_reply_cache_shutdown();
Expand All @@ -1223,7 +1224,6 @@ static void __exit exit_nfsd(void)
remove_proc_entry("fs/nfs", NULL);
nfsd_stat_shutdown();
nfsd_lockd_shutdown();
nfsd_idmap_shutdown(&init_net);
nfsd4_free_slabs();
nfsd_fault_inject_cleanup();
unregister_filesystem(&nfsd_fs_type);
Expand Down

0 comments on commit f69adb2

Please sign in to comment.