kernels/linux-2.4.0/fs/vfat/namei.c
/*
 * 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.
 */
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.
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 char *name;
	int len;
	unsigned long hash;
	len = qstr->len;
	name = qstr->name;
	while (len && name[len-1] == '.')
		len--;
	hash = init_name_hash();
	while (len--)
		hash = partial_name_hash(vfat_tolower(t, *name++), hash);
	qstr->hash = end_name_hash(hash);
	return 0;
}
static int vfat_hashi ( struct dentry * dentry , struct qstr * qstr ) { struct nls_table * t = MSDOS_SB ( dentry -> d_inode -> i_sb ) -> nls_io ; const char * name ; int len ; unsigned long hash ; len = qstr -> len ; name = qstr -> name ; while ( len && name [ len - 1 ] == ' ' ) len -- ; hash = init_name_hash ( ) ; while ( len -- ) hash = partial_name_hash ( vfat_tolower ( t , * name ++ ) , hash ) ; qstr -> hash = end_name_hash ( hash ) ; return 0 ; }
Compute the hash for the vfat name corresponding to the dentry.
Compute the hash for the vfat name corresponding to the dentry .