commit d2c828a32a3b019194051ee24607eafee517cc43 Author: Niu Yawei AuthorDate: Mon Feb 9 22:21:00 2015 -0500 LU-6137 ldiskfs: simplify nocmtime patch Simplify the nocmtime patch by patching only ext4_current_time(), this fixed the defect that original patch doesn't handle setacl code path, it can also avoid the risk of future changes adding new places that needs to be fixed. Remove the obsolete xattr-no-update-ctime patch. Signed-off-by: Niu Yawei Change-Id: I02928c4f867e9476f0bc1815dd3256e3d79dadf7 Reviewed-on: http://review.whamcloud.com/13705 Reviewed-by: Bobi Jam Reviewed-by: Bob Glossman Reviewed-by: Fan Yong Signed-off-by: Andreas Dilger Index: linux-4.15.0/fs/ext4/ext4.h =================================================================== --- linux-4.15.0.orig/fs/ext4/ext4.h +++ linux-4.15.0/fs/ext4/ext4.h @@ -655,6 +655,20 @@ enum { #define EXT4_GOING_FLAGS_LOGFLUSH 0x1 /* flush log but not data */ #define EXT4_GOING_FLAGS_NOLOGFLUSH 0x2 /* don't flush log nor data */ +#define current_time(a) ext4_current_time(a) +static inline struct timespec ext4_current_time(struct inode *inode) +{ + struct timespec now = current_kernel_time(); + + if (IS_NOCMTIME(inode)) + return inode->i_ctime; + + /* Copy from fs/inode.c */ + if (unlikely(!inode->i_sb)) + return now; + + return timespec_trunc(now, inode->i_sb->s_time_gran); +} #if defined(__KERNEL__) && defined(CONFIG_COMPAT) /*