Whamcloud - gitweb
LU-6245 tests: remove libcfs.h from test applications 29/14629/2
authorJames Simmons <uja.ornl@yahoo.com>
Tue, 28 Apr 2015 14:27:13 +0000 (10:27 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 7 May 2015 16:19:00 +0000 (16:19 +0000)
Since user land libcfs is mostly gone libcfs.h can be
removed in the appilcations used for the test suite.

Change-Id: I8104655a750533ece9c74b2ee06cd197abfd3354
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: http://review.whamcloud.com/14629
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: frank zago <fzago@cray.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/check_fhandle_syscalls.c
lustre/tests/iam_ut.c
lustre/tests/it_test.c
lustre/tests/lp_utils.c
lustre/tests/openfile.c
lustre/tests/rwv.c
lustre/tests/statmany.c
lustre/tests/statone.c
lustre/tests/test_brw.c

index 95e3002..4460dbf 100644 (file)
@@ -43,7 +43,6 @@
 #include <sys/stat.h>
 #include <sys/syscall.h>
 
-#include <libcfs/libcfs.h>
 #include <lustre/lustre_user.h>
 
 #define MAX_HANDLE_SZ 128
index d28e775..7c9988a 100644 (file)
@@ -53,8 +53,6 @@
 #include <endian.h>
 #endif
 
-#include <libcfs/libcfs.h>
-
 enum {
         /*
          * Maximal format name length.
index 6e00512..a31e0b3 100644 (file)
@@ -45,7 +45,6 @@
 
 #define EXPORT_SYMBOL(s)
 
-#include <libcfs/libcfs.h>
 #include <../ldlm/interval_tree.c>
 
 #define dprintf(fmt, args...) //printf(fmt, ##args)
index 6a2eddd..f9ebea3 100644 (file)
@@ -49,7 +49,6 @@
 #include <sys/ioctl.h>
 #include <fcntl.h>
 #include <errno.h>
-#include <libcfs/libcfs.h>
 #include "lustre/lustre_user.h"
 #include "lustre/tests/lp_utils.h"
 
index da10c49..779fab6 100644 (file)
@@ -49,7 +49,6 @@
 #include <string.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <libcfs/libcfs.h>
 #include <lustre/lustre_user.h>
 
 typedef struct flag_mapping {
index 5b3474f..1bcca57 100644 (file)
@@ -43,7 +43,6 @@
 #include <stdlib.h>
 #include <unistd.h>
 
-#include <libcfs/libcfs.h>
 #include <lustre/lustreapi.h>
 
 #define ACT_NONE        0
@@ -175,13 +174,15 @@ int main(int argc, char** argv)
                 iv->iov_len = strtoul(argv[optind++], &end, 0);
                 if (*end) {
                         printf("Error iov size\n");
-                        GOTO(out, rc = 1);
+                       rc = 1;
+                       goto out;
                 }
                 iv->iov_base = mmap(NULL, iv->iov_len, PROT_READ | PROT_WRITE,
                                     MAP_PRIVATE | MAP_ANON, 0, 0);
                 if (iv->iov_base == MAP_FAILED) {
                         printf("No memory %s\n", strerror(errno));
-                        GOTO(out, rc = 1);
+                       rc = 1;
+                       goto out;
                 }
                 if (act & ACT_WRITE)
                         memset(iv->iov_base, pad, iv->iov_len);
@@ -196,7 +197,8 @@ int main(int argc, char** argv)
 
         if ((act & ACT_SEEK) && (lseek64(fd, offset, SEEK_SET) < 0)) {
                 printf("Cannot seek %s\n", strerror(errno));
-                GOTO(out, rc == 1);
+               rc = 1;
+               goto out;
         }
 
         if (act & ACT_WRITE) {
@@ -204,19 +206,23 @@ int main(int argc, char** argv)
                 if (rc != len) {
                         printf("Write error: %s (rc = %d, len = %ld)\n",
                                 strerror(errno), rc, len);
-                        GOTO(out, rc = 1);
+                       rc = 1;
+                       goto out;
                 }
         } else if (act & ACT_READ) {
                 rc = readv(fd, iov, iovcnt);
                 if (rc != len) {
                         printf("Read error: %s rc = %d\n", strerror(errno), rc);
-                        GOTO(out, rc = 1);
+                       rc = 1;
+                       goto out;
                 }
 
                 /* It should return zeroed buf if the read hits hole.*/
                 if (((act & ACT_READHOLE) || (act & ACT_VERIFY)) &&
-                    data_verify(iov, iovcnt, pad))
-                        GOTO(out, rc = 1);
+                   data_verify(iov, iovcnt, pad)) {
+                       rc = 1;
+                       goto out;
+               }
         }
 
         rc = 0;
index 555bacd..b12a1ae 100644 (file)
@@ -47,7 +47,6 @@
 #include <limits.h>
 #include <sys/ioctl.h>
 
-#include <libcfs/libcfs.h>
 #include <lustre_ioctl.h>
 
 struct option longopts[] = {
index 7a0f4d1..202aa53 100644 (file)
@@ -40,7 +40,6 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 
-#include <libcfs/libcfs.h>
 #include <lustre_ioctl.h>
 
 int main(int argc, char **argv)
index 36ffd68..d0773e9 100644 (file)
 #include <sys/mman.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <linux/types.h>
 
-#include <libcfs/libcfs.h>
+#include <libcfs/types.h>
+#include <libcfs/byteorder.h>
 
 #define READ  1
 #define WRITE 2
@@ -77,24 +79,24 @@ int block_debug_check(char *who, void *addr, int size, __u64 off, __u64 id)
         ne_off = le64_to_cpu(off);
         id = le64_to_cpu(id);
         if (memcmp(addr, (char *)&ne_off, LPDS)) {
-                CERROR("%s: for offset "LPU64" off: "LPX64" != "LPX64"\n",
+               fprintf(stderr, "%s: for offset "LPU64" off: "LPX64" != "LPX64"\n",
                        who, off, *(__u64 *)addr, ne_off);
                 err = -EINVAL;
         }
         if (memcmp(addr + LPDS, (char *)&id, LPDS)) {
-                CERROR("%s: for offset "LPU64" id: "LPX64" != "LPX64"\n",
+               fprintf(stderr, "%s: for offset "LPU64" id: "LPX64" != "LPX64"\n",
                        who, off, *(__u64 *)(addr + LPDS), id);
                 err = -EINVAL;
         }
 
         addr += size - LPDS - LPDS;
         if (memcmp(addr, (char *)&ne_off, LPDS)) {
-                CERROR("%s: for offset "LPU64" end off: "LPX64" != "LPX64"\n",
+               fprintf(stderr, "%s: for offset "LPU64" end off: "LPX64" != "LPX64"\n",
                        who, off, *(__u64 *)addr, ne_off);
                 err = -EINVAL;
         }
         if (memcmp(addr + LPDS, (char *)&id, LPDS)) {
-                CERROR("%s: for offset "LPU64" end id: "LPX64" != "LPX64"\n",
+               fprintf(stderr, "%s: for offset "LPU64" end id: "LPX64" != "LPX64"\n",
                        who, off, *(__u64 *)(addr + LPDS), id);
                 err = -EINVAL;
         }