diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2015-10-17 22:18:45 +0200 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2015-10-17 22:18:45 +0200 |
commit | 56316a0d28f251dae6a3bc2b6d50e7c25389871f (patch) | |
tree | 3efd106c76cee48c0831930f75cf2b6c160368f6 /fs/jbd2/journal.c | |
parent | ext4: clean up feature test macros with predicate functions (diff) | |
download | linux-56316a0d28f251dae6a3bc2b6d50e7c25389871f.tar.xz linux-56316a0d28f251dae6a3bc2b6d50e7c25389871f.zip |
jbd2: 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>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/jbd2/journal.c')
-rw-r--r-- | fs/jbd2/journal.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 474c1781c0ce..eb8a7546e8a4 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -1523,8 +1523,8 @@ static int journal_get_superblock(journal_t *journal) goto out; } - if (JBD2_HAS_INCOMPAT_FEATURE(journal, JBD2_FEATURE_INCOMPAT_CSUM_V2) && - JBD2_HAS_INCOMPAT_FEATURE(journal, JBD2_FEATURE_INCOMPAT_CSUM_V3)) { + if (jbd2_has_feature_csum2(journal) && + jbd2_has_feature_csum3(journal)) { /* Can't have checksum v2 and v3 at the same time! */ printk(KERN_ERR "JBD2: Can't enable checksumming v2 and v3 " "at the same time!\n"); @@ -1532,7 +1532,7 @@ static int journal_get_superblock(journal_t *journal) } if (jbd2_journal_has_csum_v2or3_feature(journal) && - JBD2_HAS_COMPAT_FEATURE(journal, JBD2_FEATURE_COMPAT_CHECKSUM)) { + jbd2_has_feature_checksum(journal)) { /* Can't have checksum v1 and v2 on at the same time! */ printk(KERN_ERR "JBD2: Can't enable checksumming v1 and v2/3 " "at the same time!\n"); @@ -2198,15 +2198,15 @@ size_t journal_tag_bytes(journal_t *journal) { size_t sz; - if (JBD2_HAS_INCOMPAT_FEATURE(journal, JBD2_FEATURE_INCOMPAT_CSUM_V3)) + if (jbd2_has_feature_csum3(journal)) return sizeof(journal_block_tag3_t); sz = sizeof(journal_block_tag_t); - if (JBD2_HAS_INCOMPAT_FEATURE(journal, JBD2_FEATURE_INCOMPAT_CSUM_V2)) + if (jbd2_has_feature_csum2(journal)) sz += sizeof(__u16); - if (JBD2_HAS_INCOMPAT_FEATURE(journal, JBD2_FEATURE_INCOMPAT_64BIT)) + if (jbd2_has_feature_64bit(journal)) return sz; else return sz - sizeof(__u32); |