Code:
.../SharedFolders/Guest/Linux/prl_fs/inode.c | 52 +++++++++++++++++++
.../Linux/prl_freeze/prlfs_freeze_compat.h | 11 +++-
2 files changed, 61 insertions(+), 2 deletions(-)
diff --git a/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c b/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c
index 4fa559e..c98ff62 100644
--- a/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c
+++ b/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c
@@ -158,6 +158,16 @@ static int do_prlfs_getattr(struct dentry *dentry, struct prlfs_attr *attr)
#define SET_INODE_TIME(t, time) do { (t).tv_sec = (time); } while (0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0)
+#define TIME_TO_SEC(t) t##_sec
+#define SET_INODE_TIME(t, time) do {TIME_TO_SEC(t) = (time); } while (0)
+
+#define prlfs_inode_get_ctime inode_get_ctime
+#define prlfs_inode_set_ctime_to_ts inode_set_ctime_to_ts
+#define prlfs_inode_set_ctime inode_set_ctime
+
+#else // #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0)
+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0)
#define prlfs_inode_get_ctime inode_get_ctime
@@ -194,6 +204,27 @@ static inline struct prlfs_timespec prlfs_inode_set_ctime(struct inode *inode,
}
#endif // #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0) #else
+static inline struct prlfs_timespec prlfs_inode_get_ctime(const struct inode *inode)
+{
+ struct timespec64 timespec = {inode->i_ctime_sec, inode->i_ctime_ns};
+ return timespec;
+}
+static inline struct prlfs_timespec prlfs_inode_set_ctime_to_ts(struct inode *inode,
+ struct prlfs_timespec ts)
+{
+ inode->i_ctime_sec = ts.tv_sec;
+ inode->i_ctime_nsec = ts.tv_nsec;
+ return ts;
+}
+static inline struct prlfs_timespec prlfs_inode_set_ctime(struct inode *inode,
+ prlfs_kerneltime sec, long nsec)
+{
+ struct prlfs_timespec ts = { .tv_sec = sec,
+ .tv_nsec = nsec };
+
+ return prlfs_inode_set_ctime_to_ts(inode, ts);
+}
+#endif // #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0) #else
static void prlfs_change_attributes(struct inode *inode,
@@ -951,8 +982,19 @@ static struct inode *prlfs_get_inode(struct super_block *sb, prl_umode_t mode)
if (inode) {
inode->i_mode = mode;
inode->i_blocks = 0;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0)
+ struct timespec64 ts = prlfs_inode_set_ctime_to_ts(inode,
+ prlfs_current_time(inode));
+
+ inode->i_atime_sec = ts.tv_sec;
+ inode->i_atime_nsec = ts.tv_nsec;
+ inode->i_mtime_sec = ts.tv_sec;
+ inode->i_mtime_nsec = ts.tv_nsec;
+
+#else
inode->i_atime = inode->i_mtime =
prlfs_inode_set_ctime_to_ts(inode, prlfs_current_time(inode));
+#endif // LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0)
if (PRLFS_SB(sb)->share) {
inode->i_uid = current->cred->uid;
inode->i_gid = current->cred->gid;
@@ -997,8 +1039,18 @@ void prlfs_read_inode(struct inode *inode)
struct prlfs_fd *pfd;
inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0)
+ struct timespec64 ts = prlfs_inode_set_ctime_to_ts(inode, prlfs_current_time(inode));
+
+ inode->i_atime_sec = ts.tv_sec;
+ inode->i_atime_nsec = ts.tv_nsec;
+ inode->i_mtime_sec = ts.tv_sec;
+ inode->i_mtime_nsec = ts.tv_nsec;
+
+#else
inode->i_atime = inode->i_mtime =
prlfs_inode_set_ctime_to_ts(inode, prlfs_current_time(inode));
+#endif // LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0)
if (PRLFS_SB(sb)->share) {
inode->i_uid = current->cred->uid;
inode->i_gid = current->cred->gid;
diff --git a/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prlfs_freeze_compat.h b/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prlfs_freeze_compat.h
index 5327712..adf724e 100644
--- a/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prlfs_freeze_compat.h
+++ b/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prlfs_freeze_compat.h
@@ -45,7 +45,14 @@
#define prl_freeze_bdev(bdev) freeze_bdev(bdev)
#define prl_thaw_bdev(bdev, sb) thaw_bdev(bdev)
-#else
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0)
+
+#define prl_freeze_bdev(bdev) bdev_freeze(bdev)
+#define prl_thaw_bdev(bdev, sb) bdev_thaw(bdev)
+
+#endif // LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0)
+
+#else // LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0)
int prl_freeze_bdev(struct block_device *bdev)
{
@@ -62,6 +69,6 @@ int prl_freeze_bdev(struct block_device *bdev)
#define prl_thaw_bdev(bdev, sb) thaw_bdev((bdev), (sb))
-#endif
+#endif // LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0)
#endif
--
2.45.2
5. tar patched code and replace extracted archive