/* This is the rmdir() entry in the inode_operations structure for regular HFS directories. The purpose is to delete an existing directory, given the inode for the parent directory and the name (and its length) of the existing directory.  */
static int hfs_rmdir(struct inode *dir, struct dentry *dentry)
/* This is the rmdir() entry in the inode_operations structure for regular HFS directories. The purpose is to delete an existing directory, given the inode for the parent directory and the name (and its length) of the existing directory.  */
static int hfs_rmdir(struct inode *dir, struct dentry *dentry)
{
	struct inode *inode;
	int res;
	inode = dentry->d_inode;
	if (inode->i_size != 2)
		return -ENOTEMPTY;
	res = hfs_cat_delete(inode->i_ino, dir, &dentry->d_name);
	if (res)
		return res;
	clear_nlink(inode);
	inode->i_ctime = CURRENT_TIME_SEC;
	hfs_delete_inode(inode);
	mark_inode_dirty(inode);
	return 0;
}