/* Check whether the journaling code supports the use of all of a given set of features on this journal. Return true (non-zero) if it can.  */
int jbd2_journal_check_available_features(journal_t *journal, unsigned long compat, unsigned long ro, unsigned long incompat)
/* Check whether the journaling code supports the use of all of a given set of features on this journal. Return true (non-zero) if it can.  */
int jbd2_journal_check_available_features(journal_t *journal, unsigned long compat, unsigned long ro, unsigned long incompat)
{
	journal_superblock_t *sb;
	if (!compat && !ro && !incompat)
		return 1;
	sb = journal->j_superblock;
	if (journal->j_format_version != 2)
		return 0;
	if ((compat   & JBD2_KNOWN_COMPAT_FEATURES) == compat &&
	    (ro       & JBD2_KNOWN_ROCOMPAT_FEATURES) == ro &&
	    (incompat & JBD2_KNOWN_INCOMPAT_FEATURES) == incompat)
		return 1;
	return 0;
}