/* first find if there are indirected at the clone_index */
redirected = snapops->get_indirect(cache_inode, NULL,
- clone_info->clone_index);
+ clone_info->clone_index);
/* if not found, get the FIRST index after this and before NOW */
/* XXX fix this later, now use tbl_count, not NOW */
if (!redirected) {
int index;
+
+ memset(my_table, 0, sizeof(my_table));
clone_slot = snap_index2slot(table, clone_info->clone_index);
for (slot = table->tbl_count-1; slot >= clone_slot; slot --) {
- my_table[slot-clone_slot+1] = table->snap_items[slot].index;
+ my_table[slot - clone_slot + 1] = table->snap_items[slot].index;
}
- index = table->tbl_count - clone_slot + 1;
+ index = table->tbl_count - clone_slot;
redirected = snapops->get_indirect(cache_inode, my_table, index);
}
ind = snapops->create_indirect(inode, snap.index, snap.gen, parent_ino, del);
if(!ind)
RETURN(-EINVAL);
+ init_filter_data(ind, 0);
+ set_filter_ops(cache, ind);
iput(ind);
RETURN(0);
}