]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ext4: add ext4_fc_eligible()
authorNeilBrown <neil@brown.name>
Fri, 20 Mar 2026 00:03:17 +0000 (11:03 +1100)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 10 Apr 2026 01:51:34 +0000 (21:51 -0400)
commit0f5f14f334c85efd80503489f8c7cba1dd64bd51
treec8c76c307aa838b1f98bc8f4242e890095bca161
parent2879374604b72bd43b346777fa05d3ac6dea9c45
ext4: add ext4_fc_eligible()

Testing EXT4_MF_FC_INELIGIBLE is almost always combined with testing
ext4_fc_disabled().  The code can be simplified by combining these two
in a new ext4_fc_eligible().

In ext4_fc_track_inode() this moves the ext4_fc_disabled() test after
ext4_fc_mark_ineligible(), but as that is a non-op when
ext4_fc_disabled() is true, this is no no consequence.

Note that it is important to still call ext4_fc_mark_ineligible() in
ext4_fc_track_inode() even when ext4_fc_eligible() would return true.
ext4_fc_mark_ineligible() does not ONLY set the "INELIGIBLE" flag but
also updates ->s_fc_ineligible_tid to make sure that the flag remains
set until all ineligible transactions have been committed.

Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: NeilBrown <neil@brown.name>
Link: https://patch.msgid.link/20260320000838.3797494-3-neilb@ownmail.net
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/fast_commit.c