/* Given the ID of the parent and the name build a search key.  */
void hfs_cat_build_key(struct super_block *sb, btree_key *key, u32 parent, struct qstr *name)
/* Given the ID of the parent and the name build a search key.  */
void hfs_cat_build_key(struct super_block *sb, btree_key *key, u32 parent, struct qstr *name)
{
	key->cat.reserved = 0;
	key->cat.ParID = cpu_to_be32(parent);
	if (name) {
		hfs_asc2mac(sb, &key->cat.CName, name);
		key->key_len = 6 + key->cat.CName.len;
	} else {
		memset(&key->cat.CName, 0, sizeof(struct hfs_name));
		key->key_len = 6;
	}
}