You've already forked linux-apfs-rw
mirror of
https://github.com/linux-apfs/linux-apfs-rw.git
synced 2026-05-01 15:01:34 -07:00
Fix build for Linux 6.0
Milan P. Stanić reports via email that the submit_bh() api has changed in Linux 6.0, and the driver no longer builds. Implement a simple macro wrapper called apfs_submit_bh() to fix this without littering the code with version checks. Signed-off-by: Ernesto A. Fernández <ernesto@corellium.com>
This commit is contained in:
@@ -30,6 +30,13 @@ static inline bool sb_rdonly(const struct super_block *sb) { return sb->s_flags
|
||||
#define lockdep_assert_held_write(l) ((void)(l))
|
||||
#endif
|
||||
|
||||
/* Compatibility wrapper around submit_bh() */
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0)
|
||||
#define apfs_submit_bh(op, op_flags, bh) submit_bh(op, op_flags, bh)
|
||||
#else
|
||||
#define apfs_submit_bh(op, op_flags, bh) submit_bh(op | op_flags, bh)
|
||||
#endif
|
||||
|
||||
#define APFS_IOC_SET_DFLT_PFK _IOW('@', 0x80, struct apfs_wrapped_crypto_state)
|
||||
#define APFS_IOC_SET_DIR_CLASS _IOW('@', 0x81, u32)
|
||||
#define APFS_IOC_SET_PFK _IOW('@', 0x82, struct apfs_wrapped_crypto_state)
|
||||
|
||||
@@ -475,7 +475,7 @@ static int apfs_write_begin(struct file *file, struct address_space *mapping,
|
||||
get_bh(bh);
|
||||
lock_buffer(bh);
|
||||
bh->b_end_io = end_buffer_read_sync;
|
||||
submit_bh(REQ_OP_READ, 0, bh);
|
||||
apfs_submit_bh(REQ_OP_READ, 0, bh);
|
||||
wait_on_buffer(bh);
|
||||
if (!buffer_uptodate(bh)) {
|
||||
err = -EIO;
|
||||
|
||||
+1
-1
@@ -602,7 +602,7 @@ static int apfs_transaction_commit_nx(struct super_block *sb)
|
||||
clear_buffer_dirty(bh);
|
||||
lock_buffer(bh);
|
||||
bh->b_end_io = apfs_end_buffer_write_sync;
|
||||
submit_bh(REQ_OP_WRITE, REQ_SYNC, bh);
|
||||
apfs_submit_bh(REQ_OP_WRITE, REQ_SYNC, bh);
|
||||
}
|
||||
err = apfs_checkpoint_end(sb);
|
||||
if (err)
|
||||
|
||||
Reference in New Issue
Block a user