[lustre-devel] [PATCH 11/22] ext4: over ride current_time

James Simmons jsimmons at infradead.org
Sun Jul 21 18:23:40 PDT 2019


return i_ctime if IS_NOCMTIME is true for inode.

Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 fs/ext4/ext4.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 51b6159..80601a9 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -661,6 +661,13 @@ enum {
 #define EXT4_GOING_FLAGS_LOGFLUSH		0x1	/* flush log but not data */
 #define EXT4_GOING_FLAGS_NOLOGFLUSH		0x2	/* don't flush log nor data */
 
+static inline struct timespec64 ext4_current_time(struct inode *inode)
+{
+	if (IS_NOCMTIME(inode))
+		return inode->i_ctime;
+	return current_time(inode);
+}
+#define current_time(a) ext4_current_time(a)
 
 #if defined(__KERNEL__) && defined(CONFIG_COMPAT)
 /*
-- 
1.8.3.1



More information about the lustre-devel mailing list