summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorSage Weil <sage.weil@dreamhost.com>2011-06-13 22:11:51 -0700
committerSage Weil <sage.weil@dreamhost.com>2011-06-13 22:11:51 -0700
commit66229c7a54a98ecc0afd9c075d28edd89b94019f (patch)
tree659d95bca0a9beac324655bfcfe26dcb251a2adc /qa
parent71543246d37df9368d6e48d4ebd4a3387cc06cc3 (diff)
downloadceph-66229c7a54a98ecc0afd9c075d28edd89b94019f.tar.gz
qa: direct_io: fix warnings
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Diffstat (limited to 'qa')
-rw-r--r--qa/workunits/direct_io/Makefile.am2
-rw-r--r--qa/workunits/direct_io/test_short_dio_read.c4
-rw-r--r--qa/workunits/direct_io/test_sync_io.c21
3 files changed, 17 insertions, 10 deletions
diff --git a/qa/workunits/direct_io/Makefile.am b/qa/workunits/direct_io/Makefile.am
index 56e7a3d7d20..d41c4be6442 100644
--- a/qa/workunits/direct_io/Makefile.am
+++ b/qa/workunits/direct_io/Makefile.am
@@ -3,6 +3,8 @@ AUTOMAKE_OPTIONS = gnu
SUBDIRS =
bin_PROGRAMS =
+AM_CFLAGS = -Wall
+
direct_io_test_SOURCES = direct_io_test.c
test_sync_io_SOURCES = test_sync_io.c
test_short_dio_read_SOURCES = test_short_dio_read.c
diff --git a/qa/workunits/direct_io/test_short_dio_read.c b/qa/workunits/direct_io/test_short_dio_read.c
index 0f6a8257986..f9cce468ec5 100644
--- a/qa/workunits/direct_io/test_short_dio_read.c
+++ b/qa/workunits/direct_io/test_short_dio_read.c
@@ -8,7 +8,7 @@
int main(int argc, char **argv)
{
char buf[409600];
- int fd = open("shortfile", O_WRONLY|O_CREAT);
+ int fd = open("shortfile", O_WRONLY|O_CREAT, 0644);
ssize_t r;
printf("writing first 3 bytes of 10k file\n");
@@ -22,7 +22,7 @@ int main(int argc, char **argv)
r = read(fd, buf, sizeof(buf));
close(fd);
- printf("got %d\n", r);
+ printf("got %d\n", (int)r);
if (r != 10000)
return 1;
return 0;
diff --git a/qa/workunits/direct_io/test_sync_io.c b/qa/workunits/direct_io/test_sync_io.c
index a5b8c6a251a..c9042011a85 100644
--- a/qa/workunits/direct_io/test_sync_io.c
+++ b/qa/workunits/direct_io/test_sync_io.c
@@ -9,6 +9,8 @@
#include <inttypes.h>
#include <linux/types.h>
#include <stdlib.h>
+#include <string.h>
+#include <sys/ioctl.h>
//#include "../client/ioctl.h"
@@ -39,7 +41,8 @@ int verify_pattern(char *buf, size_t len, uint64_t off)
uint64_t expected = i + off;
uint64_t actual = *(uint64_t*)(buf + i);
if (expected != actual) {
- printf("error: offset %llu had %llu\n", expected, actual);
+ printf("error: offset %llu had %llu\n", (unsigned long long)expected,
+ (unsigned long long)actual);
exit(1);
return -1;
}
@@ -59,7 +62,8 @@ void generate_pattern(void *buf, size_t len, uint64_t offset)
int read_direct(int buf_align, uint64_t offset, int len)
{
- printf("read_direct buf_align %d offset %llu len %d\n", buf_align, offset, len);
+ printf("read_direct buf_align %d offset %llu len %d\n", buf_align,
+ (unsigned long long)offset, len);
int fd = open("foo", O_RDONLY|O_DIRECT);
void *rawbuf;
posix_memalign(&rawbuf, 4096, len + buf_align);
@@ -74,7 +78,8 @@ int read_direct(int buf_align, uint64_t offset, int len)
int read_sync(int buf_align, uint64_t offset, int len)
{
- printf("read_sync buf_align %d offset %llu len %d\n", buf_align, offset, len);
+ printf("read_sync buf_align %d offset %llu len %d\n", buf_align,
+ (unsigned long long)offset, len);
int fd = open("foo", O_RDONLY);
ioctl(fd, CEPH_IOC_SYNCIO);
void *rawbuf;
@@ -90,7 +95,8 @@ int read_sync(int buf_align, uint64_t offset, int len)
int write_direct(int buf_align, uint64_t offset, int len)
{
- printf("write_direct buf_align %d offset %llu len %d\n", buf_align, offset, len);
+ printf("write_direct buf_align %d offset %llu len %d\n", buf_align,
+ (unsigned long long)offset, len);
int fd = open("foo", O_WRONLY|O_DIRECT|O_CREAT, 0644);
void *rawbuf;
posix_memalign(&rawbuf, 4096, len + buf_align);
@@ -117,8 +123,9 @@ int write_direct(int buf_align, uint64_t offset, int len)
int write_sync(int buf_align, uint64_t offset, int len)
{
- printf("write_sync buf_align %d offset %llu len %d\n", buf_align, offset, len);
- int fd = open("foo", O_WRONLY|O_CREAT);
+ printf("write_sync buf_align %d offset %llu len %d\n", buf_align,
+ (unsigned long long)offset, len);
+ int fd = open("foo", O_WRONLY|O_CREAT, 0644);
ioctl(fd, CEPH_IOC_SYNCIO);
void *rawbuf;
posix_memalign(&rawbuf, 4096, len + buf_align);
@@ -145,8 +152,6 @@ int write_sync(int buf_align, uint64_t offset, int len)
int main(int argc, char **argv)
{
- char *buf;
- int fd;
uint64_t i, j, k;
int read = 1;
int write = 1;