Whamcloud - gitweb
LU-1154 clio: rename coo_attr_set to coo_attr_update
[fs/lustre-release.git] / lnet / utils / debug.c
index 8702818..1954a31 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2012, Intel Corporation.
+ * Copyright (c) 2011, 2014, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -59,7 +59,6 @@ static int debug_mask = ~0;
 static const char *libcfs_debug_subsystems[] = LIBCFS_DEBUG_SUBSYS_NAMES;
 static const char *libcfs_debug_masks[] = LIBCFS_DEBUG_MASKS_NAMES;
 
-#ifdef __linux__
 
 #define DAEMON_CTL_NAME         "/proc/sys/lnet/daemon_file"
 #define SUBSYS_DEBUG_CTL_NAME   "/proc/sys/lnet/subsystem_debug"
@@ -93,9 +92,6 @@ dbg_write_cmd(int fd, char *str, int len)
         return (rc == len ? 0 : 1);
 }
 
-#else
-#error - Unknown sysctl convention.
-#endif
 
 static int do_debug_mask(char *name, int enable)
 {
@@ -732,10 +728,12 @@ int jt_dbg_clear_debug_buf(int argc, char **argv)
 int jt_dbg_mark_debug_buf(int argc, char **argv)
 {
        static char scratch[MAX_MARK_SIZE] = "";
-       struct libcfs_ioctl_data data = { 0 };
+       struct libcfs_ioctl_data data;
        char *text;
        int rc;
 
+       memset(&data, 0, sizeof(data));
+
        if (argc > 1) {
                int count, max_size = sizeof(scratch) - 1;
 
@@ -756,18 +754,19 @@ int jt_dbg_mark_debug_buf(int argc, char **argv)
 
        data.ioc_inllen1 = strlen(text) + 1;
        data.ioc_inlbuf1 = text;
-        if (libcfs_ioctl_pack(&data, &buf, max) != 0) {
-                fprintf(stderr, "libcfs_ioctl_pack failed.\n");
-                return -1;
-        }
 
-        rc = l_ioctl(LNET_DEV_ID, IOC_LIBCFS_MARK_DEBUG, buf);
-        if (rc) {
-                fprintf(stderr, "IOC_LIBCFS_MARK_DEBUG failed: %s\n",
-                        strerror(errno));
-                return -1;
-        }
-        return 0;
+       if (libcfs_ioctl_pack(&data, &buf, max) != 0) {
+               fprintf(stderr, "libcfs_ioctl_pack failed.\n");
+               return -1;
+       }
+
+       rc = l_ioctl(LNET_DEV_ID, IOC_LIBCFS_MARK_DEBUG, buf);
+       if (rc) {
+               fprintf(stderr, "IOC_LIBCFS_MARK_DEBUG failed: %s\n",
+                       strerror(errno));
+               return -1;
+       }
+       return 0;
 }
 
 static struct mod_paths {