Thread (4 messages) flat view 4 messages, 2 authors, 2018-01-19

Re: aio fsync revisited

From: Christoph Hellwig <hch@lst.de>
Date: 2018-01-19 19:06:11
Also in: linux-fsdevel, lkml
Subsystem: kernel build + files below scripts/ (unless maintained elsewhere), the rest · Maintainers: Nathan Chancellor, Nicolas Schier, Linus Torvalds

On Fri, Jan 19, 2018 at 09:46:14AM +1100, Dave Chinner wrote:
After I get back from LCA (all next week) I'll update the fsmark
aio patches I have and retest this. The code looks pretty similar to
the last "generic aio fsync" patch I wrote, so I'm guessing that the
results will be pretty similar, too.
Your patch applied as-is, as that's what I've been using to test the
feature.  Howerever I needed the following fixups to actually make
the compiler and linker happy:
diff --git a/Makefile b/Makefile
index 9b75ce3..ce5f54b 100644
--- a/Makefile
+++ b/Makefile
@@ -11,13 +11,14 @@ DIR2= /test/dir2
 
 COBJS= fs_mark.o lib_timing.o
 CFLAGS= -O2 -Wall -D_FILE_OFFSET_BITS=64
+LDFLAGS= -laio
 
 all: fs_mark 
 
 fs_mark.o: fs_mark.c fs_mark.h
 
 fs_mark: fs_mark.o lib_timing.o
-	${CC} -o fs_mark fs_mark.o lib_timing.o
+	${CC} ${LDFLAGS} -o fs_mark fs_mark.o lib_timing.o
 
 test: fs_mark
 	./fs_mark -d ${DIR1} -d ${DIR2} -s 51200 -n 4096
diff --git a/fs_mark.c b/fs_mark.c
index 8f8fb84..4a4103d 100644
--- a/fs_mark.c
+++ b/fs_mark.c
@@ -135,7 +135,7 @@ get_fsync_completions(int threshold)
 		aio_flight -= r;
 		for (i = 0; i < r; ++i) {
 			if (ioevents[i].res)
-				printf("FAIL! aio_fsync returned %d\n",
+				printf("FAIL! aio_fsync returned %zd\n",
 					ioevents[i].res);
 		}
 		usleep(1000);
@@ -162,6 +162,7 @@ do_fsync(int fd)
 		cleanup_exit();
 	}
 
+	return 0;
 }
 
 /*
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help