kdbus: convert to ctime accessor functions for v6.6 or later version 87/306887/1
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Mon, 26 Feb 2024 08:08:38 +0000 (17:08 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Thu, 29 Feb 2024 00:53:44 +0000 (09:53 +0900)
Since the commit 13bc24457850 ("fs: rename i_ctime field to __i_ctime")
of v6.6, struct inode::i_ctime is renamed as struct inode::__i_ctime.
Also, setting __i_ctime with current time can be done by
inode_set_ctime_current(), so convert with the function.

Change-Id: I7bf775cc6e308015f878123a68eb3d54e3ae76ab
Ref: 4c1698d3033d ("selinux: convert to ctime accessor functions")
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
kernel/kdbus/fs.c

index 537ba60d6d3dac2369f2203b4b8db72641f09231..6ab202e8a43f74f440419d8f64467a2ce905ba4b 100644 (file)
@@ -11,6 +11,7 @@
  * your option) any later version.
  */
 
+#include <linux/version.h>
 #include <linux/dcache.h>
 #include <linux/fs.h>
 #include <linux/fsnotify.h>
@@ -204,7 +205,11 @@ static struct inode *fs_inode_get(struct super_block *sb,
        inode->i_private = kdbus_node_ref(node);
        inode->i_mapping->a_ops = &empty_aops;
        inode->i_mode = node->mode & S_IALLUGO;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,6,0))
+       inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode);
+#else
        inode->i_atime = inode->i_ctime = inode->i_mtime = current_time(inode);
+#endif
        inode->i_uid = node->uid;
        inode->i_gid = node->gid;