/* Compute the hash for the vfat name corresponding to the dentry. Note: if the name is invalid, we leave the hash code unchanged so that the existing dentry can be used. The vfat fs routines will return ENOENT or EINVAL as appropriate.  */
static int vfat_hashi(struct dentry *dentry, struct qstr *qstr)
/* Compute the hash for the vfat name corresponding to the dentry. Note: if the name is invalid, we leave the hash code unchanged so that the existing dentry can be used. The vfat fs routines will return ENOENT or EINVAL as appropriate.  */
static int vfat_hashi(struct dentry *dentry, struct qstr *qstr)
{
	struct nls_table *t = MSDOS_SB(dentry->d_inode->i_sb)->nls_io;
	const unsigned char *name;
	unsigned int len;
	unsigned long hash;
	name = qstr->name;
	len = vfat_striptail_len(qstr);
	hash = init_name_hash();
	while (len--)
		hash = partial_name_hash(nls_tolower(t, *name++), hash);
	qstr->hash = end_name_hash(hash);
	return 0;
}