/* Marks an entry to the directory index table as free.  */
static void free_index(tid_t tid, struct inode *ip, u32 index, u32 next)
/* Marks an entry to the directory index table as free.  */
static void free_index(tid_t tid, struct inode *ip, u32 index, u32 next)
{
	struct dir_table_slot *dirtab_slot;
	s64 lblock;
	struct metapage *mp = NULL;
	dirtab_slot = find_index(ip, index, &mp, &lblock);
	if (!dirtab_slot)
		return;
	dirtab_slot->flag = DIR_INDEX_FREE;
	dirtab_slot->slot = dirtab_slot->addr1 = 0;
	dirtab_slot->addr2 = cpu_to_le32(next);
	if (mp) {
		lock_index(tid, ip, mp, index);
		mark_metapage_dirty(mp);
		release_metapage(mp);
	} else
		set_cflag(COMMIT_Dirtable, ip);
}