jbd2: precompute number of transaction descriptor blocks
authorJan Kara <jack@suse.cz>
Mon, 24 Jun 2024 17:01:18 +0000 (19:01 +0200)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 9 Jul 2024 03:59:37 +0000 (23:59 -0400)
commite3a00a23781c1f2fcda98a7aecaac515558e7a35
treeab0886700f3f7bb50f266e4b0077f759cb9b57c5
parent4aa99c71e42ad60178c1154ec24e3df9c684fb67
jbd2: precompute number of transaction descriptor blocks

Instead of computing the number of descriptor blocks a transaction can
have each time we need it (which is currently when starting each
transaction but will become more frequent later) precompute the number
once during journal initialization together with maximum transaction
size. We perform the precomputation whenever journal feature set is
updated similarly as for computation of
journal->j_revoke_records_per_block.

CC: stable@vger.kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Zhang Yi <yi.zhang@huawei.com>
Link: https://patch.msgid.link/20240624170127.3253-2-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/jbd2/journal.c
fs/jbd2/transaction.c
include/linux/jbd2.h