From a4f15ad8118d715568968b0a075aa59209e7f446 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Mon, 26 Feb 2024 17:08:38 +0900 Subject: [PATCH] kdbus: convert to ctime accessor functions for v6.6 or later version 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 Signed-off-by: Marek Szyprowski --- kernel/kdbus/fs.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/kdbus/fs.c b/kernel/kdbus/fs.c index 537ba60..6ab202e 100644 --- a/kernel/kdbus/fs.c +++ b/kernel/kdbus/fs.c @@ -11,6 +11,7 @@ * your option) any later version. */ +#include #include #include #include @@ -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; -- 2.34.1