aboutsummaryrefslogtreecommitdiff
path: root/fs/nfs/client.c
diff options
context:
space:
mode:
authorTrond Myklebust2019-01-29 21:40:10 -0500
committerTrond Myklebust2019-07-06 14:54:49 -0400
commitbf11fbdb20b385157b046ea7781f04d0c62554a3 (patch)
treefc24ca63f5e1529f713cc9243716dfc45075bd36 /fs/nfs/client.c
parent10b7a70cbb81a62353f763c3343ac0c48410696f (diff)
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>
Diffstat (limited to 'fs/nfs/client.c')
-rw-r--r--fs/nfs/client.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 0acb104f7b00..6e7aeb543f6a 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -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));