return ERR_PTR(-ENOENT);
}
+ LAFSI(ino)->filesys = igrab(inodefile);
+
/* surprisingly the inode bdi does not default to the
* super_blocks bdi...
*/
fs->rolled = 0;
fs->ss[0].root = ino = iget_locked(fs->prime_sb, 0);
+ LAFSI(ino)->filesys = ino;
k->root = ino;
err = -ENOMEM;
atomic_inc(&fs->prime_sb->s_active);
fs->ss[s].root = sk->k.root = iget_locked(sb, 0);
+ LAFSI(fs->ss[s].root)->filesys = fs->ss[s].root;
b = lafs_get_block(fs->ss[s].root, 0, NULL, GFP_KERNEL,
MKREF(snap));
b->b.physaddr = fs->ss[s].root_addr;
/* indexing info stays in the block, not in the inode */
struct lafs_inode {
struct inode vfs_inode;
+ struct inode *filesys; /* Inode of containing TypeInodeFile */
struct indexblock *iblock;
struct datablock *dblock;
long cblocks, /* data blocks which are commited to this file */
void lafs_destroy_inode(struct inode *inode)
{
struct datablock *db;
+ struct inode *fsys = LAFSI(inode)->filesys;
BUG_ON(!list_empty(&inode->i_sb_list));
// Cannot test i_list as dispose_list just does list_del
set_bit(I_Destroyed, &LAFSI(inode)->iflags);
putdref(db, MKREF(destroy));
} else {
+ if (fsys != inode)
+ iput(fsys);
+ LAFSI(inode)->filesys = NULL;
+
spin_lock(&inode->i_data.private_lock);
if (LAFSI(inode)->iblock)
LAFS_BUG(atomic_read(&LAFSI(inode)->iblock->b.refcnt),