add patch improve-code-readability-in-ext4_iget
[ext4-patch-queue.git] / use-ktime_get_real_seconds-for-i_dtime
blobbe0cc68039c4bcf05fbbbec4a9e803fc4fd74ad4
1 ext4: use ktime_get_real_seconds for i_dtime
3 From: Arnd Bergmann <arnd@arndb.de>
5 We only care about the low 32-bit for i_dtime as explained in commit
6 b5f515735bea ("ext4: avoid Y2038 overflow in recently_deleted()"), so
7 the use of get_seconds() is correct here, but that function is getting
8 removed in the process of the y2038 fixes, so let's use the modern
9 ktime_get_real_seconds() here.
11 Reviewed-by: Andreas Dilger <adilger@dilger.ca>
12 Signed-off-by: Arnd Bergmann <arnd@arndb.de>
13 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
14 ---
15  fs/ext4/inode.c | 2 +-
16  1 file changed, 1 insertion(+), 1 deletion(-)
18 diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
19 index 74982a9566a9..3b54227cf2b1 100644
20 --- a/fs/ext4/inode.c
21 +++ b/fs/ext4/inode.c
22 @@ -317,7 +317,7 @@ void ext4_evict_inode(struct inode *inode)
23          * (Well, we could do this if we need to, but heck - it works)
24          */
25         ext4_orphan_del(handle, inode);
26 -       EXT4_I(inode)->i_dtime  = get_seconds();
27 +       EXT4_I(inode)->i_dtime  = (__u32)ktime_get_real_seconds();
29         /*
30          * One subtle ordering requirement: if anything has gone wrong
31 -- 
32 2.9.0