mirror of
https://github.com/linux-apfs/linux-apfs-rw.git
synced 2026-08-18 02:19:59 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a10279ce66 | ||
|
|
7711c4704e | ||
|
|
9619c53686 | ||
|
|
f5b71842e6 | ||
|
|
83205caaad |
No files matched your search
@@ -47,6 +47,7 @@ static inline bool sb_rdonly(const struct super_block *sb) { return sb->s_flags
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(7, 2, 0)
|
||||
#define apfs_submit_bh(op, op_flags, bh) \
|
||||
do { \
|
||||
put_bh(bh); \
|
||||
if (op == REQ_OP_READ) \
|
||||
bh_submit(bh, op | op_flags, bh_end_read); \
|
||||
else \
|
||||
@@ -1346,7 +1347,7 @@ __apfs_getblk(struct super_block *sb, sector_t block)
|
||||
block -= nxi->nx_tier2_bno;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 7, 0)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 7, 0) && !RHEL_VERSION_GE(9, 8)
|
||||
return __getblk_gfp(info->blki_bdev, block, sb->s_blocksize, __GFP_MOVABLE);
|
||||
#else
|
||||
return bdev_getblk(info->blki_bdev, block, sb->s_blocksize, __GFP_MOVABLE);
|
||||
|
||||
@@ -308,6 +308,7 @@ static int apfs_write_single_ip_bitmap(struct super_block *sb, char *bitmap, u32
|
||||
err = apfs_transaction_join(sb, bh);
|
||||
if (err)
|
||||
goto fail;
|
||||
put_bh(bh);
|
||||
bh = NULL;
|
||||
|
||||
spaceman->sm_ip_bmaps[idx].dirty = false;
|
||||
|
||||
@@ -343,8 +343,8 @@ static int apfs_read_main_super(struct super_block *sb)
|
||||
xid = le64_to_cpu(msb_raw->nx_o.o_xid);
|
||||
for (i = 0; i < desc_blocks; ++i) {
|
||||
struct apfs_nx_superblock *desc_raw;
|
||||
bool ignore;
|
||||
|
||||
brelse(desc_bh);
|
||||
desc_bh = apfs_sb_bread(sb, desc_base + i);
|
||||
if (!desc_bh) {
|
||||
apfs_err(sb, "unable to read checkpoint descriptor");
|
||||
@@ -352,18 +352,24 @@ static int apfs_read_main_super(struct super_block *sb)
|
||||
}
|
||||
desc_raw = (struct apfs_nx_superblock *)desc_bh->b_data;
|
||||
|
||||
ignore = false;
|
||||
if (le32_to_cpu(desc_raw->nx_magic) != APFS_NX_MAGIC)
|
||||
continue; /* Not a superblock */
|
||||
ignore = true; /* Not a superblock */
|
||||
if (le64_to_cpu(desc_raw->nx_o.o_xid) <= xid)
|
||||
continue; /* Old */
|
||||
ignore = true; /* Old */
|
||||
if (!apfs_obj_verify_csum(sb, desc_bh))
|
||||
continue; /* Corrupted */
|
||||
ignore = true; /* Corrupted */
|
||||
|
||||
xid = le64_to_cpu(desc_raw->nx_o.o_xid);
|
||||
msb_raw = desc_raw;
|
||||
bno = desc_base + i;
|
||||
brelse(bh);
|
||||
bh = desc_bh;
|
||||
if (ignore) {
|
||||
brelse(desc_bh);
|
||||
} else {
|
||||
xid = le64_to_cpu(desc_raw->nx_o.o_xid);
|
||||
msb_raw = desc_raw;
|
||||
bno = desc_base + i;
|
||||
brelse(bh);
|
||||
bh = desc_bh;
|
||||
}
|
||||
desc_raw = NULL;
|
||||
desc_bh = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -640,6 +640,9 @@ static int apfs_write_ephemeral_objects(struct super_block *sb)
|
||||
}
|
||||
data_len += obj_blkcnt;
|
||||
}
|
||||
brelse(cpm_bh);
|
||||
cpm = NULL;
|
||||
cpm_bh = NULL;
|
||||
|
||||
/*
|
||||
* The checkpoint superblock can't be set until the very end of the
|
||||
|
||||
Reference in new issue
Block a user