1 We won't change i_xtime in ldiskfs code path. But also
2 need keep normal function out of Lustre. So we using
3 S_NOCMTIME to indicate invoked from Lustre.
5 Index: linux-4.15.0/fs/ext4/ext4.h
6 ===================================================================
7 --- linux-4.15.0.orig/fs/ext4/ext4.h
8 +++ linux-4.15.0/fs/ext4/ext4.h
9 @@ -655,6 +655,20 @@ enum {
10 #define EXT4_GOING_FLAGS_LOGFLUSH 0x1 /* flush log but not data */
11 #define EXT4_GOING_FLAGS_NOLOGFLUSH 0x2 /* don't flush log nor data */
13 +#define current_time(a) ext4_current_time(a)
14 +static inline struct timespec ext4_current_time(struct inode *inode)
16 + struct timespec now = current_kernel_time();
18 + if (IS_NOCMTIME(inode))
19 + return inode->i_ctime;
21 + /* Copy from fs/inode.c */
22 + if (unlikely(!inode->i_sb))
25 + return timespec_trunc(now, inode->i_sb->s_time_gran);
28 #if defined(__KERNEL__) && defined(CONFIG_COMPAT)