@@ -94,7 +94,7 @@ struct libcfs_ioctl_data {
#define IOC_LIBCFS_MARK_DEBUG _IOWR('e', 32, IOCTL_LIBCFS_TYPE)
/* IOC_LIBCFS_MEMHOG obsolete in 2.8.0, was _IOWR('e', 36, IOCTL_LIBCFS_TYPE) */
/* lnet ioctls */
-/* IOC_LIBCFS_GET_NI obsolete in 2.16, was _IOWR('e', 50, IOCTL_LIBCFS_TYPE) */
+#define IOC_LIBCFS_GET_NI _IOWR('e', 50, IOCTL_LIBCFS_TYPE)
#define IOC_LIBCFS_FAIL_NID _IOWR('e', 51, IOCTL_LIBCFS_TYPE)
#define IOC_LIBCFS_NOTIFY_ROUTER _IOWR('e', 55, IOCTL_LIBCFS_TYPE)
#define IOC_LIBCFS_UNCONFIGURE _IOWR('e', 56, IOCTL_LIBCFS_TYPE)
@@ -4030,6 +4030,13 @@ LNetCtl(unsigned int cmd, void *arg)
sizeof(struct lnet_ioctl_config_data));
switch (cmd) {
+ case IOC_LIBCFS_GET_NI: {
+ struct lnet_processid id = {};
+
+ rc = LNetGetId(data->ioc_count, &id);
+ data->ioc_nid = lnet_nid_to_nid4(&id.nid);
+ return rc;
+ }
case IOC_LIBCFS_FAIL_NID:
return lnet_fail_nid(data->ioc_nid, data->ioc_count);