A NECESSARY AND SUFFICIENT CONDITION FOR CERTAIN MARTINGALE INEQUALITIES IN BANACH FUNCTION SPACES