Skip to content

Commit

Permalink
Fix APFS driver
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaGarg8 committed Aug 25, 2024
1 parent 277b278 commit 91849e0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions 8001-Add-APFS-driver.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6098,7 +6098,7 @@ index 000000000..c8ae4092a
+#include <linux/blk_types.h>
+#include "apfs.h"
+
+#define MAX(X, Y) ((X) <= (Y) ? (Y) : (X))
+#define APFS_MAX(X, Y) ((X) <= (Y) ? (Y) : (X))
+
+/**
+ * apfs_ext_is_hole - Does this extent represent a hole in a sparse file?
Expand Down Expand Up @@ -8063,7 +8063,7 @@ index 000000000..c8ae4092a
+ prev_end = prev_ext.bno + prev_ext.blkcount;
+ if (prev_end < *paddr_end) {
+ /* The extent to put is part of a snapshot */
+ tmp.phys_block_num = MAX(prev_end, paddr_min);
+ tmp.phys_block_num = APFS_MAX(prev_end, paddr_min);
+ tmp.len = (*paddr_end - tmp.phys_block_num) << sb->s_blocksize_bits;
+ ret = apfs_create_update_pext(query, &tmp, -1);
+ *paddr_end = tmp.phys_block_num;
Expand Down Expand Up @@ -8203,7 +8203,7 @@ index 000000000..c8ae4092a
+ prev_end = prev_ext.bno + prev_ext.blkcount;
+ if (prev_end < *paddr_end) {
+ /* The extent to take is part of a snapshot */
+ tmp.phys_block_num = MAX(prev_end, paddr_min);
+ tmp.phys_block_num = APFS_MAX(prev_end, paddr_min);
+ tmp.len = (*paddr_end - tmp.phys_block_num) << sb->s_blocksize_bits;
+ ret = apfs_create_update_pext(query, &tmp, +1);
+ *paddr_end = tmp.phys_block_num;
Expand Down

0 comments on commit 91849e0

Please sign in to comment.