#include <sys/stat.h>
#include <sys/syscall.h>
-#include <libcfs/libcfs.h>
#include <lustre/lustre_user.h>
#define MAX_HANDLE_SZ 128
#include <endian.h>
#endif
-#include <libcfs/libcfs.h>
-
enum {
/*
* Maximal format name length.
#define EXPORT_SYMBOL(s)
-#include <libcfs/libcfs.h>
#include <../ldlm/interval_tree.c>
#define dprintf(fmt, args...) //printf(fmt, ##args)
#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"
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
-#include <libcfs/libcfs.h>
#include <lustre/lustre_user.h>
typedef struct flag_mapping {
#include <stdlib.h>
#include <unistd.h>
-#include <libcfs/libcfs.h>
#include <lustre/lustreapi.h>
#define ACT_NONE 0
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);
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) {
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;
#include <limits.h>
#include <sys/ioctl.h>
-#include <libcfs/libcfs.h>
#include <lustre_ioctl.h>
struct option longopts[] = {
#include <sys/stat.h>
#include <fcntl.h>
-#include <libcfs/libcfs.h>
#include <lustre_ioctl.h>
int main(int argc, char **argv)
#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
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;
}