Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 297466
b: refs/heads/master
c: 7ea34ac
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Layton authored and J. Bruce Fields committed Mar 26, 2012
1 parent b6eeecc commit 3a613b1
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b3537c35c21f0e6750aa8bd786949b55509c6d0d
refs/heads/master: 7ea34ac15e45b790f2faa7d5f69c560a43f2de70
34 changes: 34 additions & 0 deletions trunk/fs/nfsd/netns.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* per net namespace data structures for nfsd
*
* Copyright (C) 2012, Jeff Layton <jlayton@redhat.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

#ifndef __NFSD_NETNS_H__
#define __NFSD_NETNS_H__

#include <net/net_namespace.h>
#include <net/netns/generic.h>

struct cld_net;

struct nfsd_net {
struct cld_net *cld_net;
};

extern int nfsd_net_id;
#endif /* __NFSD_NETNS_H__ */
15 changes: 14 additions & 1 deletion trunk/fs/nfsd/nfsctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "nfsd.h"
#include "cache.h"
#include "fault_inject.h"
#include "netns.h"

/*
* We have a single directory with several nodes in it.
Expand Down Expand Up @@ -1124,14 +1125,23 @@ static int create_proc_exports_entry(void)
}
#endif

int nfsd_net_id;
static struct pernet_operations nfsd_net_ops = {
.id = &nfsd_net_id,
.size = sizeof(struct nfsd_net),
};

static int __init init_nfsd(void)
{
int retval;
printk(KERN_INFO "Installing knfsd (copyright (C) 1996 okir@monad.swb.de).\n");

retval = register_pernet_subsys(&nfsd_net_ops);
if (retval < 0)
return retval;
retval = nfsd4_init_slabs();
if (retval)
return retval;
goto out_unregister_pernet;
nfs4_state_init();
retval = nfsd_fault_inject_init(); /* nfsd fault injection controls */
if (retval)
Expand Down Expand Up @@ -1169,6 +1179,8 @@ static int __init init_nfsd(void)
nfsd_fault_inject_cleanup();
out_free_slabs:
nfsd4_free_slabs();
out_unregister_pernet:
unregister_pernet_subsys(&nfsd_net_ops);
return retval;
}

Expand All @@ -1184,6 +1196,7 @@ static void __exit exit_nfsd(void)
nfsd4_free_slabs();
nfsd_fault_inject_cleanup();
unregister_filesystem(&nfsd_fs_type);
unregister_pernet_subsys(&nfsd_net_ops);
}

MODULE_AUTHOR("Olaf Kirch <okir@monad.swb.de>");
Expand Down

0 comments on commit 3a613b1

Please sign in to comment.