#include <linux/lnet/socklnd.h>
#include <lnetconfig/liblnetconfig.h>
#include <lustre/lustreapi.h>
+#include <lustre_ioctl_old.h>
unsigned int libcfs_debug;
unsigned int libcfs_printk = D_CANTMASK;
int
jt_ptl_list_nids(int argc, char **argv)
{
- struct libcfs_ioctl_data data;
int all = 0, return_nid = 0;
yaml_emitter_t request;
yaml_parser_t reply;
struct nl_sock *sk;
bool done = false;
int rc = 0;
- int count;
all = (argc == 2) && (strcmp(argv[1], "all") == 0);
/* Hack to pass back value */
if (rc == 0)
yaml_parser_log_error(&reply, stderr, NULL);
yaml_parser_delete(&reply);
-old_api:
+old_api: {
+#ifdef IOC_LIBCFS_GET_NI
+ int count;
+
if (sk)
nl_socket_free(sk);
if (rc == 1)
return 0;
for (count = 0;; count++) {
+ struct libcfs_ioctl_data data;
+
LIBCFS_IOC_INIT(data);
data.ioc_count = count;
rc = l_ioctl(LNET_DEV_ID, IOC_LIBCFS_GET_NI, &data);
}
}
- return 0;
+#else
+ rc = -1;
+#endif
+ }
+ return rc;
}
int
int rc;
int timeout;
struct lnet_process_id id;
- struct lnet_process_id ids[LNET_INTERFACES_MAX_DEFAULT];
- lnet_nid_t src = LNET_NID_ANY;
- int maxids = sizeof(ids) / sizeof(ids[0]);
- struct lnet_ioctl_ping_data ping = { { 0 } };
yaml_emitter_t request;
yaml_parser_t reply;
yaml_event_t event;
struct nl_sock *sk;
char *sep;
- int i;
if (argc < 2) {
fprintf(stderr, "usage: %s id [timeout (secs)]\n", argv[0]);
nl_socket_free(sk);
return rc;
old_api:
+#ifdef IOC_LIBCFS_PING_PEER
+ {
+ struct lnet_process_id ids[LNET_INTERFACES_MAX_DEFAULT];
+ int maxids = sizeof(ids) / sizeof(ids[0]);
+ struct lnet_ioctl_ping_data ping = { { 0 } };
+ int i;
+
if (sk)
nl_socket_free(sk);
LIBCFS_IOC_INIT_V2(ping, ping_hdr);
ping.ping_hdr.ioc_len = sizeof(ping);
ping.ping_id = id;
- ping.ping_src = src;
+ ping.ping_src = LNET_NID_ANY;
ping.op_param = timeout;
ping.ping_count = maxids;
ping.ping_buf = ids;
if (ping.ping_count > maxids)
printf("%d out of %d ids listed\n", maxids, ping.ping_count);
-
- return 0;
+ }
+#else
+ rc = -ENOTTY;
+#endif
+ return rc;
}
int jt_ptl_mynid(int argc, char **argv)