diff -Nru linux-apfs-rw-0.3.2/debian/changelog linux-apfs-rw-0.3.2/debian/changelog --- linux-apfs-rw-0.3.2/debian/changelog 2023-12-06 15:50:54.000000000 +0000 +++ linux-apfs-rw-0.3.2/debian/changelog 2024-02-22 12:59:41.000000000 +0000 @@ -1,3 +1,10 @@ +linux-apfs-rw (0.3.2-0ubuntu5) noble; urgency=medium + + * Support linux 6.8 (LP: #2054682): + - debian/patches/0005-Support-for-kernel-6.8.patch + + -- Andrea Righi Thu, 22 Feb 2024 12:59:41 +0000 + linux-apfs-rw (0.3.2-0ubuntu4) noble; urgency=medium * Support linux 6.7 (LP: #2045777): diff -Nru linux-apfs-rw-0.3.2/debian/patches/0005-Support-for-kernel-6.8.patch linux-apfs-rw-0.3.2/debian/patches/0005-Support-for-kernel-6.8.patch --- linux-apfs-rw-0.3.2/debian/patches/0005-Support-for-kernel-6.8.patch 1970-01-01 00:00:00.000000000 +0000 +++ linux-apfs-rw-0.3.2/debian/patches/0005-Support-for-kernel-6.8.patch 2024-02-22 12:59:41.000000000 +0000 @@ -0,0 +1,125 @@ +From: Andrea Righi +Subject: support linux 6.8 +origin: upstream, https://github.com/linux-apfs/linux-apfs-rw + + apfs.h | 4 ++++ + file.c | 17 ++++++++++++++++- + super.c | 23 +++++++++++++++++++---- + 6 files changed, 42 insertions(+), 21 deletions(-) + +Index: linux-apfs-rw-0.3.2/file.c +=================================================================== +--- linux-apfs-rw-0.3.2.orig/file.c ++++ linux-apfs-rw-0.3.2/file.c +@@ -5,6 +5,9 @@ + + #include "apfs.h" + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 8, 0) ++#include ++#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0) + typedef int vm_fault_t; + #endif +@@ -158,6 +161,16 @@ int apfs_fsync(struct file *file, loff_t + return apfs_sync_fs(sb, true /* wait */); + } + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 8, 0) ++static ssize_t apfs_copy_file_range(struct file *src_file, loff_t src_off, ++ struct file *dst_file, loff_t dst_off, ++ size_t len, unsigned int flags) ++{ ++ return (splice_copy_file_range(src_file, src_off, ++ dst_file, dst_off, len)); ++} ++#endif ++ + const struct file_operations apfs_file_operations = { + .llseek = generic_file_llseek, + .read_iter = generic_file_read_iter, +@@ -166,7 +179,11 @@ const struct file_operations apfs_file_o + .open = generic_file_open, + .fsync = apfs_fsync, + .unlocked_ioctl = apfs_file_ioctl, ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 8, 0) ++ .copy_file_range = apfs_copy_file_range, ++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0) + .copy_file_range = generic_copy_file_range, ++#endif + .remap_file_range = apfs_remap_file_range, + }; + +Index: linux-apfs-rw-0.3.2/super.c +=================================================================== +--- linux-apfs-rw-0.3.2.orig/super.c ++++ linux-apfs-rw-0.3.2/super.c +@@ -278,6 +278,9 @@ static void apfs_update_software_info(st + ASSERT(strlen(APFS_MODULE_ID_STRING) < APFS_MODIFIED_NAMELEN); + mod_by = raw->apfs_modified_by; + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 8, 0) ++ sbi->sbi_bdev_handle = sb->s_bdev_handle; ++#endif + /* This check could be optimized away, but does it matter? */ + if (!strcmp(mod_by->id, APFS_MODULE_ID_STRING)) + return; +@@ -300,7 +303,8 @@ static inline void apfs_unmap_main_super + struct apfs_nxsb_info *nxi = sbi->s_nxi; + __mode mode = __MODE_READ | __MODE_EXCL; + struct apfs_object *obj = NULL; +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 8, 0) ++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 0) + void *holder = NULL; + #endif + +@@ -319,7 +323,10 @@ static inline void apfs_unmap_main_super + obj->o_bh = NULL; + obj = NULL; + +-#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 8, 0) ++ if (!IS_ERR_OR_NULL(sbi->sbi_bdev_handle)) ++ bdev_release(sbi->sbi_bdev_handle); ++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 0) + blkdev_put(nxi->nx_bdev, mode); + #else + blkdev_put(nxi->nx_bdev, holder); +@@ -1513,13 +1520,20 @@ static int apfs_attach_nxi(struct apfs_s + + nxi = apfs_nx_find_by_dev(dev); + if (!nxi) { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 8, 0) ++ struct bdev_handle *handle; ++#endif + struct block_device *bdev; + + nxi = kzalloc(sizeof(*nxi), GFP_KERNEL); + if (!nxi) + return -ENOMEM; + +-#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0) ++ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 8, 0) ++ handle = bdev_open_by_path(dev_name, mode, &apfs_fs_type, NULL); ++ bdev = handle->bdev; ++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 0) + bdev = blkdev_get_by_path(dev_name, mode, &apfs_fs_type); + #else + bdev = blkdev_get_by_path(dev_name, mode, &apfs_fs_type, NULL); +Index: linux-apfs-rw-0.3.2/apfs.h +=================================================================== +--- linux-apfs-rw-0.3.2.orig/apfs.h ++++ linux-apfs-rw-0.3.2/apfs.h +@@ -283,6 +283,10 @@ struct apfs_sb_info { + struct list_head list; /* List of mounted volumes in container */ + struct apfs_superblock *s_vsb_raw; /* On-disk volume sb */ + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 8, 0) ++ struct bdev_handle *sbi_bdev_handle; ++#endif ++ + char *s_snap_name; /* Label for the mounted snapshot */ + u64 s_snap_xid; /* Transaction id for mounted snapshot */ + diff -Nru linux-apfs-rw-0.3.2/debian/patches/series linux-apfs-rw-0.3.2/debian/patches/series --- linux-apfs-rw-0.3.2/debian/patches/series 2023-12-06 15:50:54.000000000 +0000 +++ linux-apfs-rw-0.3.2/debian/patches/series 2024-02-22 12:59:41.000000000 +0000 @@ -2,3 +2,4 @@ 0002-linux-6.5-fix-blkdev_get_by_path-holder-and-superblo.patch 0003-Fix-for-the-kernel-6.6-build-errors.patch 0004-Support-for-kernel-6.7.patch +0005-Support-for-kernel-6.8.patch