

There is no point in open lockfile O_SYNC now that it's not used in jfsck()
(see jfsck-ignore_lockfile.patch).

While at it, also remove the bogus, racy and unneeded access() call before the
open().

This change (the O_SYNC one, the access() is just code cleanup) improves
performance a huge lot because it avoids small writes and seeking all over the
place. For instance, dbench performance with two processes goes from a 2.40
MB/sec to 4.50 MB/sec.



---

 cur-root/libjio.c |    7 +------
 1 files changed, 1 insertion(+), 6 deletions(-)

diff -puN libjio.c~async_lockfile libjio.c
--- cur/libjio.c~async_lockfile	2004-04-14 23:38:07.000000000 -0300
+++ cur-root/libjio.c	2004-04-30 10:11:24.000000000 -0300
@@ -481,12 +481,7 @@ int jopen(struct jfs *fs, const char *na
 		return -1;
 	
 	snprintf(jlockfile, PATH_MAX, "%s/%s", jdir, "lock");
-	if (access(jlockfile, F_OK) != 0) {
-		/* file doesn't exists, create it */
-		jfd = open(jlockfile, O_RDWR | O_CREAT | O_SYNC, 0600);
-	} else {
-		jfd = open(jlockfile, O_RDWR | O_SYNC, 0600);
-	}
+	jfd = open(jlockfile, O_RDWR | O_CREAT, 0600);
 	if (jfd < 0)
 		return -1;
 	

_
