From b37f29341b9aec1b6e45d55b6f7a1bc5b2723f7a Mon Sep 17 00:00:00 2001 From: Coleman Kane Date: Mon, 11 Sep 2023 23:21:29 -0400 Subject: Linux 6.6 compat: use inode_get/set_ctime*(...) In Linux commit 13bc24457850583a2e7203ded05b7209ab4bc5ef, direct access to the i_ctime member of struct inode was removed. The new approach is to use accessor methods that exclusively handle passing the timestamp around by value. This change adds new tests for each of these functions and introduces zpl_* equivalents in include/os/linux/zfs/sys/zpl.h. In where the inode_get/set_ctime*() functions exist, these zpl_* calls will be mapped to the new functions. On older kernels, these macros just wrap direct-access calls. The code that operated on an address of ip->i_ctime to call ZFS_TIME_DECODE() now will take a local copy using zpl_inode_get_ctime(), and then pass the address of the local copy when performing the ZFS_TIME_DECODE() call, in all cases, rather than directly accessing the member. Reviewed-by: Brian Behlendorf Signed-off-by: Coleman Kane Closes #15263 Closes #15257 --- module/os/linux/zfs/zpl_inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/os/linux/zfs/zpl_inode.c') diff --git a/module/os/linux/zfs/zpl_inode.c b/module/os/linux/zfs/zpl_inode.c index 5f5ad186a61c..ef50f8687779 100644 --- a/module/os/linux/zfs/zpl_inode.c +++ b/module/os/linux/zfs/zpl_inode.c @@ -774,7 +774,7 @@ zpl_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry) return (-EMLINK); crhold(cr); - ip->i_ctime = current_time(ip); + zpl_inode_set_ctime_to_ts(ip, current_time(ip)); /* Must have an existing ref, so igrab() cannot return NULL */ VERIFY3P(igrab(ip), !=, NULL); -- cgit v1.2.3