/* Check whether the journal uses all of a given set of features. Return true (non-zero) if it does.  */
int journal_check_used_features(journal_t *journal, unsigned long compat, unsigned long ro, unsigned long incompat)
/* Check whether the journal uses all of a given set of features. Return true (non-zero) if it does.  */
int journal_check_used_features(journal_t *journal, unsigned long compat, unsigned long ro, unsigned long incompat)
{
	journal_superblock_t *sb;
	if (!compat && !ro && !incompat)
		return 1;
	if (journal->j_format_version == 1)
		return 0;
	sb = journal->j_superblock;
	if (((be32_to_cpu(sb->s_feature_compat) & compat) == compat) &&
	    ((be32_to_cpu(sb->s_feature_ro_compat) & ro) == ro) &&
	    ((be32_to_cpu(sb->s_feature_incompat) & incompat) == incompat))
		return 1;
	return 0;
}