/* Returns 0 on success, -EBADR on bad flags.  */
int fiemap_check_flags(struct fiemap_extent_info *fieinfo, u32 fs_flags)
/* Returns 0 on success, -EBADR on bad flags.  */
int fiemap_check_flags(struct fiemap_extent_info *fieinfo, u32 fs_flags)
{
	u32 incompat_flags;
	incompat_flags = fieinfo->fi_flags & ~(FIEMAP_FLAGS_COMPAT & fs_flags);
	if (incompat_flags) {
		fieinfo->fi_flags = incompat_flags;
		return -EBADR;
	}
	return 0;
}