ext4: clean up feature test macros with predicate functions
Create separate predicate functions to test/set/clear feature flags, thereby replacing the wordy old macros. Furthermore, clean out the places where we open-coded feature tests. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
This commit is contained in:

committed by
Theodore Ts'o

parent
6a797d2737
commit
e2b911c535
@@ -525,12 +525,12 @@ errout:
|
||||
static void ext4_xattr_update_super_block(handle_t *handle,
|
||||
struct super_block *sb)
|
||||
{
|
||||
if (EXT4_HAS_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_EXT_ATTR))
|
||||
if (ext4_has_feature_xattr(sb))
|
||||
return;
|
||||
|
||||
BUFFER_TRACE(EXT4_SB(sb)->s_sbh, "get_write_access");
|
||||
if (ext4_journal_get_write_access(handle, EXT4_SB(sb)->s_sbh) == 0) {
|
||||
EXT4_SET_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_EXT_ATTR);
|
||||
ext4_set_feature_xattr(sb);
|
||||
ext4_handle_dirty_super(handle, sb);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user