Commit 6b730a40 authored by Shida Zhang's avatar Shida Zhang Committed by Theodore Ts'o
Browse files

ext4: hoist ext4_block_write_begin and replace the __block_write_begin



Using __block_write_begin() make it inconvenient to journal the
user data dirty process. We can't tell the block layer maintainer,
‘Hey, we want to trace the dirty user data in ext4, can we add some
special code for ext4 in __block_write_begin?’:P

So use ext4_block_write_begin() instead.

The two functions are basically doing the same thing except for the
fscrypt related code. Remove the unnecessary #ifdef since
fscrypt_inode_uses_fs_layer_crypto() returns false (and it's known at
compile time) when !CONFIG_FS_ENCRYPTION.

And hoist the ext4_block_write_begin so that it can be used in other
files.

Suggested-by: default avatarJan Kara <jack@suse.cz>
Suggested-by: default avatarEric Biggers <ebiggers@kernel.org>
Signed-off-by: default avatarShida Zhang <zhangshida@kylinos.cn>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20240830053739.3588573-3-zhangshida@kylinos.cn


Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent 3910b513
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment