O_NOATIME isn't always present
authorJens Axboe <jens.axboe@oracle.com>
Tue, 17 Feb 2009 12:39:40 +0000 (13:39 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 17 Feb 2009 12:39:40 +0000 (13:39 +0100)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
btreplay/btreplay.c

index 23e13b8fc812b389ae8fa5986bbbaedd52ce2e21..2d122ca1b4439a354a31b433d5c017e0f59a2b83 100644 (file)
@@ -1317,11 +1317,18 @@ static void *replay_sub(void *arg)
        char path[MAXPATHLEN];
        struct io_bunch bunch;
        struct thr_info *tip = arg;
+       int oflags;
 
        pin_to_cpu(tip);
 
        sprintf(path, "/dev/%s", map_dev(tip->devnm));
-       tip->ofd = open(path, O_RDWR | O_DIRECT | O_NOATIME);
+
+#ifdef O_NOATIME
+       oflags = O_NOATIME;
+#else
+       oflags = 0;
+#endif
+       tip->ofd = open(path, O_RDWR | O_DIRECT | oflags);
        if (tip->ofd < 0) {
                fatal(path, ERR_SYSCALL, "Failed device open\n");
                /*NOTREACHED*/