/* This is the rename() entry in the inode_operations structure for regular HFS directories. The purpose is to rename an existing file or directory, given the inode for the current directory and the name (and its length) of the existing file/directory and the inode for the new directory and the name (and its length) of the new file/directory. XXX: how do you handle must_be dir?  */
static int hfs_rename(struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, struct dentry *new_dentry)
/* This is the rename() entry in the inode_operations structure for regular HFS directories. The purpose is to rename an existing file or directory, given the inode for the current directory and the name (and its length) of the existing file/directory and the inode for the new directory and the name (and its length) of the new file/directory. XXX: how do you handle must_be dir?  */
static int hfs_rename(struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, struct dentry *new_dentry)
{
	int res;
	if (new_dentry->d_inode) {
		res = hfs_unlink(new_dir, new_dentry);
		if (res)
			return res;
	}
	res = hfs_cat_move(old_dentry->d_inode->i_ino,
			   old_dir, &old_dentry->d_name,
			   new_dir, &new_dentry->d_name);
	if (!res)
		hfs_cat_build_key(old_dir->i_sb,
				  (btree_key *)&HFS_I(old_dentry->d_inode)->cat_key,
				  new_dir->i_ino, &new_dentry->d_name);
	return res;
}