]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ext4: hoist ext4_block_write_begin and replace the __block_write_begin
authorShida Zhang <zhangshida@kylinos.cn>
Fri, 30 Aug 2024 05:37:37 +0000 (13:37 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 4 Sep 2024 02:14:17 +0000 (22:14 -0400)
commit6b730a405037501a260d6efd24782d2737e65d07
tree19f338a659ebd94ec5070aea04a475212627e018
parent3910b513fcdf33030798755c722174ef4a827d2a
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: Jan Kara <jack@suse.cz>
Suggested-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Shida Zhang <zhangshida@kylinos.cn>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20240830053739.3588573-3-zhangshida@kylinos.cn
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/ext4.h
fs/ext4/inline.c
fs/ext4/inode.c