EXTRA_KCFLAGS="$tmp_flags"
])
+# LC_FILE_UPDATE_TIME
+# 2.6.9 has inode_update_time instead of file_update_time
+AC_DEFUN([LC_FILE_UPDATE_TIME],
+[AC_MSG_CHECKING([if file_update_time is exported])
+LB_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+],[
+ file_update_time(NULL);
+],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_FILE_UPDATE_TIME, 1,
+ [use file_update_time])
+],[
+ AC_MSG_RESULT(no)
+])
+])
+
# LC_FILE_WRITEV
# 2.6.19 replaced writev with aio_write
AC_DEFUN([LC_FILE_WRITEV],
# 2.6.19
LC_INODE_BLKSIZE
LC_VFS_READDIR_U64_INO
+ LC_FILE_UPDATE_TIME
LC_FILE_WRITEV
LC_FILE_READV
#define bio_hw_segments(q, bio) 0
#endif
+#ifdef HAVE_FILE_UPDATE_TIME
+#define ll_update_time(file) file_update_time(file)
+#else
+#define ll_update_time(file) inode_update_time(file->f_mapping->host, 1)
+#endif
+
#endif /* __KERNEL__ */
#endif /* _COMPAT25_H */
}
if (file->f_flags & O_DIRECT) {
+ if (rw == WRITE)
+ ll_update_time(file);
/* do not copy data for O_DIRECT */
rc = ll_direct_IO(rw, file, iov, *ppos, nr_segs, 0);
if (rc > 0)
}
run_test 37 "check i_size is not updated for directory on close (bug 18695) =============="
+test_39() {
+ local originaltime
+ local updatedtime
+ local delay=3
+
+ touch $DIR1/$tfile
+ originaltime=$(stat -c %Y $DIR1/$tfile)
+ log "original modification time is $originaltime"
+ sleep $delay
+ multiop $DIR1/$tfile oO_DIRECT:O_WRONLY:w$((10*1048576))c || error "multiop has failed"
+ updatedtime=$(stat -c %Y $DIR2/$tfile)
+ log "updated modification time is $updatedtime"
+ [ $((updatedtime - originaltime)) -ge $delay ] || error "invalid modification time"
+ rm -rf $DIR/$tfile
+}
+run_test 39 "direct I/O writes should update mtime ========="
+
log "cleanup: ======================================================"
check_and_cleanup_lustre