Teuthology does a make in the workunits dir, so move this in there.
Signed-off-by: Sage Weil <sage@inktank.com>
-DIRS= workunits btrfs fs
+DIRS= workunits btrfs
all:
for d in $(DIRS) ; do ( cd $$d ; $(MAKE) all ) ; done
+++ /dev/null
-CFLAGS = -Wall -Wextra -D_GNU_SOURCE
-
-TARGETS = test_o_trunc
-
-.c:
- $(CC) $(CFLAGS) $@.c -o $@
-
-all: $(TARGETS)
-
-clean:
- rm $(TARGETS)
+++ /dev/null
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdlib.h>
-
-int main(int argc, char *argv[])
-{
- int fd, ret;
- char obuf[32], ibuf[1024];
- int n, max = 0;
-
- if (argc > 2)
- max = atoi(argv[2]);
- if (!max)
- max = 600;
-
- memset(obuf, 0xff, sizeof(obuf));
-
- for (n = 1; n <= max; ++n) {
- fd = open(argv[1], O_RDWR | O_CREAT | O_TRUNC, 0644);
- printf("%d/%d: open fd = %d\n", n, max, fd);
-
- ret = write(fd, obuf, sizeof(obuf));
- printf("write ret = %d\n", ret);
-
- sleep(1);
-
- ret = write(fd, obuf, sizeof(obuf));
- printf("write ret = %d\n", ret);
-
- ret = pread(fd, ibuf, sizeof(ibuf), 0);
- printf("pread ret = %d\n", ret);
-
- if (memcmp(obuf, ibuf, sizeof(obuf))) {
- printf("mismatch\n");
- break;
- }
- close(fd);
- }
- return 0;
-}
-DIRS = direct_io
+DIRS = direct_io fs
all:
for d in $(DIRS) ; do ( cd $$d ; $(MAKE) all ) ; done
--- /dev/null
+test_o_trunc
--- /dev/null
+CFLAGS = -Wall -Wextra -D_GNU_SOURCE
+
+TARGETS = test_o_trunc
+
+.c:
+ $(CC) $(CFLAGS) $@.c -o $@
+
+all: $(TARGETS)
+
+clean:
+ rm $(TARGETS)
--- /dev/null
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+
+int main(int argc, char *argv[])
+{
+ int fd, ret;
+ char obuf[32], ibuf[1024];
+ int n, max = 0;
+
+ if (argc > 2)
+ max = atoi(argv[2]);
+ if (!max)
+ max = 600;
+
+ memset(obuf, 0xff, sizeof(obuf));
+
+ for (n = 1; n <= max; ++n) {
+ fd = open(argv[1], O_RDWR | O_CREAT | O_TRUNC, 0644);
+ printf("%d/%d: open fd = %d\n", n, max, fd);
+
+ ret = write(fd, obuf, sizeof(obuf));
+ printf("write ret = %d\n", ret);
+
+ sleep(1);
+
+ ret = write(fd, obuf, sizeof(obuf));
+ printf("write ret = %d\n", ret);
+
+ ret = pread(fd, ibuf, sizeof(ibuf), 0);
+ printf("pread ret = %d\n", ret);
+
+ if (memcmp(obuf, ibuf, sizeof(obuf))) {
+ printf("mismatch\n");
+ break;
+ }
+ close(fd);
+ }
+ return 0;
+}