static void *mds_ext2_start(struct inode *inode, int nblocks)
{
- return 0;
+ return (void *)1;
}
static int mds_ext2_stop(struct inode *inode, void *handle)
return 0;
}
-static int mds_ext2_setattr(struct inode *inode, void *handle,
+static int mds_ext2_setattr(struct dentry *dentry, void *handle,
struct iattr *iattr)
{
+ struct inode *inode = dentry->d_inode;
+
/* a _really_ horrible hack to avoid removing the data stored
in the block pointers; this data is the object id
this will go into an extended attribute at some point.
}
}
- return 0;
+ if (inode->i_op->setattr)
+ return inode->i_op->setattr(dentry, iattr);
+ else
+ return inode_setattr(inode, iattr);
}
/*
* FIXME: nasty hack - store the object id in the first two
* direct block spots. This should be done with EAs...
*/
+#define EXT2_OBJID_FL 0x40000000
static int mds_ext2_set_objid(struct inode *inode, void *handle, obd_id id)
{
memcpy(inode->u.ext2_i.i_data, &id, sizeof(id));
+ inode->u.ext2_i.i_flags |= EXT2_OBJID_FL;
return 0;
}
return generic_file_read(file, buf, count, offset);
}
+struct mds_fs_operations mds_ext2_fs_ops;
+
+void mds_ext2_delete_inode(struct inode *inode)
+{
+ if (inode->u.ext2_i.i_flags & EXT2_OBJID_FL)
+ mds_ext2_set_objid(inode, NULL, 0);
+
+ mds_ext2_fs_ops.cl_delete_inode(inode);
+}
+
struct mds_fs_operations mds_ext2_fs_ops = {
fs_start: mds_ext2_start,
fs_commit: mds_ext2_stop,
fs_set_objid: mds_ext2_set_objid,
fs_get_objid: mds_ext2_get_objid,
fs_readpage: mds_ext2_readpage,
+ fs_delete_inode:mds_ext2_delete_inode,
+ cl_delete_inode:clear_inode,
};