/* NOTE! unlike strncmp, affs_match returns 1 for success, 0 for failure.  */
static int affs_match(struct dentry *dentry, const u8 *name2, toupper_t toupper)
/* NOTE! unlike strncmp, affs_match returns 1 for success, 0 for failure.  */
static int affs_match(struct dentry *dentry, const u8 *name2, toupper_t toupper)
{
	const u8 *name = dentry->d_name.name;
	int len = dentry->d_name.len;
	if (len >= 30) {
		if (*name2 < 30)
			return 0;
		len = 30;
	} else if (len != *name2)
		return 0;
	for (name2++; len > 0; len--)
		if (toupper(*name++) != toupper(*name2++))
			return 0;
	return 1;
}