NFS: Add sysfs support for per-container identifier

In order to identify containers to the NFS client, we add a per-net
sysfs attribute that udev can fill with the appropriate identifier.
The identifier could be a unique hostname, but in most cases it
will probably be a persisted uuid.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
This commit is contained in:
Trond Myklebust
2019-01-29 21:40:10 -05:00
parent 10b7a70cbb
commit bf11fbdb20
4 changed files with 135 additions and 0 deletions

View File

@@ -49,6 +49,7 @@
#include "pnfs.h"
#include "nfs.h"
#include "netns.h"
#include "sysfs.h"
#define NFSDBG_FACILITY NFSDBG_CLIENT
@@ -1072,12 +1073,15 @@ void nfs_clients_init(struct net *net)
#endif
spin_lock_init(&nn->nfs_client_lock);
nn->boot_time = ktime_get_real();
nfs_netns_sysfs_setup(nn, net);
}
void nfs_clients_exit(struct net *net)
{
struct nfs_net *nn = net_generic(net, nfs_net_id);
nfs_netns_sysfs_destroy(nn);
nfs_cleanup_cb_ident_idr(net);
WARN_ON_ONCE(!list_empty(&nn->nfs_client_list));
WARN_ON_ONCE(!list_empty(&nn->nfs_volume_list));