diff --git a/8001-Add-APFS-driver.patch b/8001-Add-APFS-driver.patch index c1715fd..e6b94e2 100644 --- a/8001-Add-APFS-driver.patch +++ b/8001-Add-APFS-driver.patch @@ -1,19 +1,19 @@ -From e30a87f580a83fb5e5ffcbb7ca032fceb4171bec Mon Sep 17 00:00:00 2001 +From ddce5e40e1108c8cde03da1af9a154e23fcd234f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> -Date: Sat, 26 Jul 2025 18:53:16 +0000 +Date: Tue, 16 Sep 2025 18:48:15 +0000 Subject: [PATCH] Add APFS driver --- fs/apfs/Makefile | 28 + - fs/apfs/apfs.h | 1307 ++++++++++++ + fs/apfs/apfs.h | 1316 ++++++++++++ fs/apfs/apfs_raw.h | 1570 ++++++++++++++ fs/apfs/btree.c | 1174 +++++++++++ fs/apfs/compress.c | 478 +++++ fs/apfs/dir.c | 1504 ++++++++++++++ fs/apfs/extents.c | 2374 ++++++++++++++++++++++ fs/apfs/file.c | 224 ++ - fs/apfs/inode.c | 2578 +++++++++++++++++++++++ + fs/apfs/inode.c | 2594 ++++++++++++++++++++++++ fs/apfs/key.c | 337 +++ fs/apfs/libzbitmap.c | 442 ++++ fs/apfs/libzbitmap.h | 31 + @@ -31,7 +31,7 @@ Subject: [PATCH] Add APFS driver fs/apfs/object.c | 315 +++ fs/apfs/snapshot.c | 687 +++++++ fs/apfs/spaceman.c | 1479 ++++++++++++++ - fs/apfs/super.c | 2123 +++++++++++++++++++ + fs/apfs/super.c | 2127 +++++++++++++++++++ fs/apfs/symlink.c | 80 + fs/apfs/transaction.c | 1034 ++++++++++ fs/apfs/unicode.c | 3156 +++++++++++++++++++++++++++++ @@ -39,7 +39,7 @@ Subject: [PATCH] Add APFS driver fs/apfs/version.h | 1 + fs/apfs/xattr.c | 914 +++++++++ fs/apfs/xfield.c | 171 ++ - 34 files changed, 26909 insertions(+) + 34 files changed, 26938 insertions(+) create mode 100644 fs/apfs/Makefile create mode 100644 fs/apfs/apfs.h create mode 100644 fs/apfs/apfs_raw.h @@ -111,10 +111,10 @@ index 000000000..a2dbed980 + make -C $(KERNEL_DIR) M=$(PWD) clean diff --git a/fs/apfs/apfs.h b/fs/apfs/apfs.h new file mode 100644 -index 000000000..2fbcf7b31 +index 000000000..5b65bf50b --- /dev/null +++ b/fs/apfs/apfs.h -@@ -0,0 +1,1307 @@ +@@ -0,0 +1,1316 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (C) 2018 Ernesto A. Fernández @@ -1138,8 +1138,13 @@ index 000000000..2fbcf7b31 +extern int apfs_create_inode_rec(struct super_block *sb, struct inode *inode, + struct dentry *dentry); +extern int apfs_inode_create_exclusive_dstream(struct inode *inode); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0) ++extern int __apfs_write_begin(const struct kiocb *iocb, struct address_space *mapping, loff_t pos, unsigned int len, unsigned int flags, struct page **pagep, void **fsdata); ++extern int __apfs_write_end(const struct kiocb *iocb, struct address_space *mapping, loff_t pos, unsigned int len, unsigned int copied, struct page *page, void *fsdata); ++#else +extern int __apfs_write_begin(struct file *file, struct address_space *mapping, loff_t pos, unsigned int len, unsigned int flags, struct page **pagep, void **fsdata); +extern int __apfs_write_end(struct file *file, struct address_space *mapping, loff_t pos, unsigned int len, unsigned int copied, struct page *page, void *fsdata); ++#endif +extern int apfs_dstream_adj_refcnt(struct apfs_dstream_info *dstream, u32 delta); + +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0) @@ -1178,6 +1183,10 @@ index 000000000..2fbcf7b31 + +extern int apfs_crypto_adj_refcnt(struct super_block *sb, u64 crypto_id, int delta); + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0) ++#define fileattr file_kattr ++#endif ++ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) || RHEL_VERSION_GE(9, 6) +extern int apfs_fileattr_get(struct dentry *dentry, struct fileattr *fa); +extern int apfs_fileattr_set(struct mnt_idmap *idmap, struct dentry *dentry, struct fileattr *fa); @@ -8784,10 +8793,10 @@ index 000000000..3e8a55897 +}; diff --git a/fs/apfs/inode.c b/fs/apfs/inode.c new file mode 100644 -index 000000000..09beeedb9 +index 000000000..2476c1b2c --- /dev/null +++ b/fs/apfs/inode.c -@@ -0,0 +1,2578 @@ +@@ -0,0 +1,2594 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (C) 2018 Ernesto A. Fernández @@ -9260,7 +9269,11 @@ index 000000000..09beeedb9 + return ret; +} + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0) ++int __apfs_write_begin(const struct kiocb *file, struct address_space *mapping, loff_t pos, unsigned int len, unsigned int flags, struct page **pagep, void **fsdata) ++#else +int __apfs_write_begin(struct file *file, struct address_space *mapping, loff_t pos, unsigned int len, unsigned int flags, struct page **pagep, void **fsdata) ++#endif +{ + struct inode *inode = mapping->host; + struct apfs_dstream_info *dstream = &APFS_I(inode)->i_dstream; @@ -9374,7 +9387,11 @@ index 000000000..09beeedb9 + return err; +} + -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0) ++static int apfs_write_begin(const struct kiocb *file, struct address_space *mapping, ++ loff_t pos, unsigned int len, ++ struct folio **foliop, void **fsdata) ++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) +static int apfs_write_begin(struct file *file, struct address_space *mapping, + loff_t pos, unsigned int len, + struct folio **foliop, void **fsdata) @@ -9419,7 +9436,11 @@ index 000000000..09beeedb9 + return err; +} + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0) ++int __apfs_write_end(const struct kiocb *file, struct address_space *mapping, loff_t pos, unsigned int len, unsigned int copied, struct page *page, void *fsdata) ++#else +int __apfs_write_end(struct file *file, struct address_space *mapping, loff_t pos, unsigned int len, unsigned int copied, struct page *page, void *fsdata) ++#endif +{ + struct inode *inode = mapping->host; + struct apfs_dstream_info *dstream = &APFS_I(inode)->i_dstream; @@ -9442,7 +9463,11 @@ index 000000000..09beeedb9 + return ret; +} + -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0) ++static int apfs_write_end(const struct kiocb *file, struct address_space *mapping, ++ loff_t pos, unsigned int len, unsigned int copied, ++ struct folio *folio, void *fsdata) ++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) +static int apfs_write_end(struct file *file, struct address_space *mapping, + loff_t pos, unsigned int len, unsigned int copied, + struct folio *folio, void *fsdata) @@ -19636,10 +19661,10 @@ index 000000000..31bf439e9 +} diff --git a/fs/apfs/super.c b/fs/apfs/super.c new file mode 100644 -index 000000000..4aa83a994 +index 000000000..6ae75a036 --- /dev/null +++ b/fs/apfs/super.c -@@ -0,0 +1,2123 @@ +@@ -0,0 +1,2127 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (C) 2018 Ernesto A. Fernández @@ -21227,7 +21252,11 @@ index 000000000..4aa83a994 + goto failed_cat; + + sb->s_op = &apfs_sops; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0) ++ set_default_d_op(sb, &apfs_dentry_operations); ++#else + sb->s_d_op = &apfs_dentry_operations; ++#endif + sb->s_xattr = apfs_xattr_handlers; + sb->s_maxbytes = MAX_LFS_FILESIZE; + sb->s_time_gran = 1; /* Nanosecond granularity */ @@ -26086,11 +26115,11 @@ index 000000000..e3b7edc51 +#endif /* _APFS_UNICODE_H */ diff --git a/fs/apfs/version.h b/fs/apfs/version.h new file mode 100644 -index 000000000..188282d6a +index 000000000..e16b23c10 --- /dev/null +++ b/fs/apfs/version.h @@ -0,0 +1 @@ -+#define GIT_COMMIT "v0.3.15" ++#define GIT_COMMIT "" diff --git a/fs/apfs/xattr.c b/fs/apfs/xattr.c new file mode 100644 index 000000000..c21b8e469 @@ -27189,5 +27218,5 @@ index 000000000..b8cbe17fd + return total_len; +} -- -2.50.1 +2.51.0 diff --git a/apfs_ver b/apfs_ver index 6516aba..9a3e0ea 100644 --- a/apfs_ver +++ b/apfs_ver @@ -1,2 +1,2 @@ -CURRENT_HASH=de4083a5069ea107e86f862ec52b27b7585bfd02 -RELEASE_VER=0.3.15-1 +CURRENT_HASH=714202fefa9a17b8a06ae32a0b902d3185e49569 +RELEASE_VER=0.3.15-2