ino_t sn_root_ino; /*the root ino of this snap*/
};
struct smfs_inode_info {
+ /* this first part of struct should be the same as in mds_info_info */
+ struct lustre_id smi_id;
+
+ /* smfs part. */
struct inode *smi_inode;
__u32 smi_flags;
struct snap_inode_info sm_sninfo;
};
#define I2SMI(inode) ((struct smfs_inode_info *) ((inode->u.generic_ip)))
+#define I2FSI(inode) (((inode->u.generic_ip)))
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
+#define S2FSI(sb) (((sb->u.generic_sbp)))
#define S2SMI(sb) ((struct smfs_super_info *) ((sb->u.generic_sbp)))
#define S2CSB(sb) (((struct smfs_super_info *)((sb->u.generic_sbp)))->smsi_sb)
#else
+#define S2FSI(sb) ((sb->s_fs_info))
#define S2SMI(sb) ((struct smfs_super_info *) (sb->s_fs_info))
#define S2CSB(sb) (((struct smfs_super_info *) (sb->s_fs_info))->smsi_sb)
#endif
dst_inode->i_version = src_inode->i_version;
dst_inode->i_state = src_inode->i_state;
dst_inode->i_generation = src_inode->i_generation;
+ dst_inode->i_flags = src_inode->i_flags;
/* This is to make creating special files working. */
dst_inode->i_rdev = src_inode->i_rdev;
{
if (inode && cache_inode) {
duplicate_inode(inode, cache_inode);
- /*Here we must release the cache_inode,
- *Otherwise we will have no chance to
- *do it
+
+ /*
+ * here we must release the cache_inode, otherwise we will have
+ * no chance to do it later.
*/
cache_inode->i_state &=~I_LOCK;
inode->i_blocks = cache_inode->i_blocks;
static inline void pre_smfs_inode(struct inode *inode,
struct inode *cache_inode)
{
- if (inode && cache_inode)
- duplicate_inode(cache_inode, inode);
+ if (inode && cache_inode) {
+ cache_inode->i_state = inode->i_state;
+ // duplicate_inode(cache_inode, inode);
+ }
}
/* instantiate a file handle to the cache file */
{
if (!cache_dentry)
return;
+
+ /*
+ * this is needed because d_unalloc() calls dput(), which in turn calls
+ * iput() on dentry inode.
+ */
if (cache_dentry->d_inode)
igrab(cache_dentry->d_inode);
d_unalloc(cache_dentry);