|
1 | | -From 7e8a7ff83e6fb74997a3b7e0e53f5c471986664a Mon Sep 17 00:00:00 2001 |
| 1 | +From 7c0d9187ec318852caaf61e1da26f23da4ed5c47 Mon Sep 17 00:00:00 2001 |
2 | 2 | From: "github-actions[bot]" |
3 | 3 | <41898282+github-actions[bot]@users.noreply.github.com> |
4 | | -Date: Thu, 27 Nov 2025 18:50:01 +0000 |
| 4 | +Date: Wed, 31 Dec 2025 18:53:11 +0000 |
5 | 5 | Subject: [PATCH] Add APFS driver |
6 | 6 |
|
7 | 7 | --- |
8 | 8 | fs/apfs/Makefile | 28 + |
9 | | - fs/apfs/apfs.h | 1316 ++++++++++++ |
| 9 | + fs/apfs/apfs.h | 1343 ++++++++++++ |
10 | 10 | fs/apfs/apfs_raw.h | 1570 ++++++++++++++ |
11 | 11 | fs/apfs/btree.c | 1174 +++++++++++ |
12 | 12 | fs/apfs/compress.c | 478 +++++ |
13 | | - fs/apfs/dir.c | 1504 ++++++++++++++ |
| 13 | + fs/apfs/dir.c | 1505 ++++++++++++++ |
14 | 14 | fs/apfs/extents.c | 2374 ++++++++++++++++++++++ |
15 | 15 | fs/apfs/file.c | 224 ++ |
16 | 16 | fs/apfs/inode.c | 2594 ++++++++++++++++++++++++ |
@@ -39,7 +39,7 @@ Subject: [PATCH] Add APFS driver |
39 | 39 | fs/apfs/version.h | 1 + |
40 | 40 | fs/apfs/xattr.c | 914 +++++++++ |
41 | 41 | fs/apfs/xfield.c | 171 ++ |
42 | | - 34 files changed, 26938 insertions(+) |
| 42 | + 34 files changed, 26966 insertions(+) |
43 | 43 | create mode 100644 fs/apfs/Makefile |
44 | 44 | create mode 100644 fs/apfs/apfs.h |
45 | 45 | create mode 100644 fs/apfs/apfs_raw.h |
@@ -111,10 +111,10 @@ index 000000000..a2dbed980 |
111 | 111 | + make -C $(KERNEL_DIR) M=$(PWD) clean |
112 | 112 | diff --git a/fs/apfs/apfs.h b/fs/apfs/apfs.h |
113 | 113 | new file mode 100644 |
114 | | -index 000000000..5b65bf50b |
| 114 | +index 000000000..5a729fca7 |
115 | 115 | --- /dev/null |
116 | 116 | +++ b/fs/apfs/apfs.h |
117 | | -@@ -0,0 +1,1316 @@ |
| 117 | +@@ -0,0 +1,1343 @@ |
118 | 118 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
119 | 119 | +/* |
120 | 120 | + * Copyright (C) 2018 Ernesto A. Fernández < [email protected]> |
@@ -1333,6 +1333,33 @@ index 000000000..5b65bf50b |
1333 | 1333 | +#define page_has_buffers(page) folio_buffers(page_folio(page)) |
1334 | 1334 | +#endif |
1335 | 1335 | + |
| 1336 | ++static inline int apfs_inode_state_read_once(struct inode *inode) |
| 1337 | ++{ |
| 1338 | ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 19, 0) |
| 1339 | ++ return inode_state_read_once(inode); |
| 1340 | ++#else |
| 1341 | ++ return inode->i_state; |
| 1342 | ++#endif |
| 1343 | ++} |
| 1344 | ++ |
| 1345 | ++static inline void apfs_inode_state_set_raw(struct inode *inode, int flags) |
| 1346 | ++{ |
| 1347 | ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 19, 0) |
| 1348 | ++ inode_state_set_raw(inode, flags); |
| 1349 | ++#else |
| 1350 | ++ inode->i_state |= flags; |
| 1351 | ++#endif |
| 1352 | ++} |
| 1353 | ++ |
| 1354 | ++static inline void apfs_inode_state_clear_raw(struct inode *inode, int flags) |
| 1355 | ++{ |
| 1356 | ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 19, 0) |
| 1357 | ++ inode_state_clear_raw(inode, flags); |
| 1358 | ++#else |
| 1359 | ++ inode->i_state &= ~flags; |
| 1360 | ++#endif |
| 1361 | ++} |
| 1362 | ++ |
1336 | 1363 | +/* |
1337 | 1364 | + * TODO: the following are modified variants of buffer head functions that will |
1338 | 1365 | + * work with the shared block device for the container. The correct approach |
@@ -4673,10 +4700,10 @@ index 000000000..2e05e7a02 |
4673 | 4700 | +} |
4674 | 4701 | diff --git a/fs/apfs/dir.c b/fs/apfs/dir.c |
4675 | 4702 | new file mode 100644 |
4676 | | -index 000000000..bc86e2ceb |
| 4703 | +index 000000000..01f409b45 |
4677 | 4704 | --- /dev/null |
4678 | 4705 | +++ b/fs/apfs/dir.c |
4679 | | -@@ -0,0 +1,1504 @@ |
| 4706 | +@@ -0,0 +1,1505 @@ |
4680 | 4707 | +// SPDX-License-Identifier: GPL-2.0-only |
4681 | 4708 | +/* |
4682 | 4709 | + * Copyright (C) 2018 Ernesto A. Fernández < [email protected]> |
@@ -5934,9 +5961,10 @@ index 000000000..bc86e2ceb |
5934 | 5961 | +{ |
5935 | 5962 | + struct inode *inode = d_inode(dentry); |
5936 | 5963 | + |
5937 | | -+ inode->i_state |= I_LINKABLE; /* Silence warning about nlink 0->1 */ |
| 5964 | ++ /* Silence warning about nlink 0->1 */ |
| 5965 | ++ apfs_inode_state_set_raw(inode, I_LINKABLE); |
5938 | 5966 | + inc_nlink(inode); |
5939 | | -+ inode->i_state &= ~I_LINKABLE; |
| 5967 | ++ apfs_inode_state_clear_raw(inode, I_LINKABLE); |
5940 | 5968 | + |
5941 | 5969 | + apfs_undo_delete_dentry(dentry); |
5942 | 5970 | +} |
@@ -8793,7 +8821,7 @@ index 000000000..3e8a55897 |
8793 | 8821 | +}; |
8794 | 8822 | diff --git a/fs/apfs/inode.c b/fs/apfs/inode.c |
8795 | 8823 | new file mode 100644 |
8796 | | -index 000000000..38f429956 |
| 8824 | +index 000000000..6e38e05ad |
8797 | 8825 | --- /dev/null |
8798 | 8826 | +++ b/fs/apfs/inode.c |
8799 | 8827 | @@ -0,0 +1,2594 @@ |
@@ -9836,7 +9864,7 @@ index 000000000..38f429956 |
9836 | 9864 | + inode = apfs_iget_locked(sb, cnid); |
9837 | 9865 | + if (!inode) |
9838 | 9866 | + return ERR_PTR(-ENOMEM); |
9839 | | -+ if (!(inode->i_state & I_NEW)) |
| 9867 | ++ if (!(apfs_inode_state_read_once(inode) & I_NEW)) |
9840 | 9868 | + return inode; |
9841 | 9869 | + |
9842 | 9870 | + down_read(&nxi->nx_big_sem); |
@@ -21880,7 +21908,7 @@ index 000000000..be4f9df8f |
21880 | 21908 | +}; |
21881 | 21909 | diff --git a/fs/apfs/transaction.c b/fs/apfs/transaction.c |
21882 | 21910 | new file mode 100644 |
21883 | | -index 000000000..3fea8d5fe |
| 21911 | +index 000000000..e743ccb0b |
21884 | 21912 | --- /dev/null |
21885 | 21913 | +++ b/fs/apfs/transaction.c |
21886 | 21914 | @@ -0,0 +1,1034 @@ |
@@ -22354,7 +22382,7 @@ index 000000000..3fea8d5fe |
22354 | 22382 | + curr_err = apfs_update_inode(inode, NULL /* new_name */); |
22355 | 22383 | + if (curr_err) |
22356 | 22384 | + err = curr_err; |
22357 | | -+ inode->i_state &= ~I_DIRTY_ALL; |
| 22385 | ++ apfs_inode_state_clear_raw(inode, I_DIRTY_ALL); |
22358 | 22386 | + |
22359 | 22387 | + /* |
22360 | 22388 | + * The same inode may get dirtied again as soon as we release |
@@ -26115,11 +26143,11 @@ index 000000000..e3b7edc51 |
26115 | 26143 | +#endif /* _APFS_UNICODE_H */ |
26116 | 26144 | diff --git a/fs/apfs/version.h b/fs/apfs/version.h |
26117 | 26145 | new file mode 100644 |
26118 | | -index 000000000..4cdeb4fc4 |
| 26146 | +index 000000000..e16b23c10 |
26119 | 26147 | --- /dev/null |
26120 | 26148 | +++ b/fs/apfs/version.h |
26121 | 26149 | @@ -0,0 +1 @@ |
26122 | | -+#define GIT_COMMIT "v0.3.17" |
| 26150 | ++#define GIT_COMMIT "" |
26123 | 26151 | diff --git a/fs/apfs/xattr.c b/fs/apfs/xattr.c |
26124 | 26152 | new file mode 100644 |
26125 | 26153 | index 000000000..c21b8e469 |
@@ -27218,5 +27246,5 @@ index 000000000..b8cbe17fd |
27218 | 27246 | + return total_len; |
27219 | 27247 | +} |
27220 | 27248 | -- |
27221 | | -2.51.2 |
| 27249 | +2.52.0 |
27222 | 27250 |
|
0 commit comments