#include "callback.h"
#include "pnfs.h"
#include "netns.h"
+#include "sysfs.h"
#include "nfs4idmap.h"
#include "nfs4session.h"
#include "fscache.h"
}
static size_t
-nfs4_get_uniquifier(char *buf, size_t buflen)
+nfs4_get_uniquifier(struct nfs_client *clp, char *buf, size_t buflen)
{
+ struct nfs_net *nn = net_generic(clp->cl_net, nfs_net_id);
+ struct nfs_netns_client *nn_clp = nn->nfs_client;
+ const char *id;
+
buf[0] = '\0';
- if (nfs4_client_id_uniquifier[0] != '\0')
+ if (nn_clp) {
+ rcu_read_lock();
+ id = rcu_dereference(nn_clp->identifier);
+ if (id)
+ strscpy(buf, id, buflen);
+ rcu_read_unlock();
+ }
+
+ if (nfs4_client_id_uniquifier[0] != '\0' && buf[0] == '\0')
strscpy(buf, nfs4_client_id_uniquifier, buflen);
return strlen(buf);
1;
rcu_read_unlock();
- buflen = nfs4_get_uniquifier(buf, sizeof(buf));
+ buflen = nfs4_get_uniquifier(clp, buf, sizeof(buf));
if (buflen)
len += buflen + 1;
len = 10 + 10 + 1 + 10 + 1 +
strlen(clp->cl_rpcclient->cl_nodename) + 1;
- buflen = nfs4_get_uniquifier(buf, sizeof(buf));
+ buflen = nfs4_get_uniquifier(clp, buf, sizeof(buf));
if (buflen)
len += buflen + 1;