Skip to content
Snippets Groups Projects
Commit 4aec4547 authored by Wang Di's avatar Wang Di
Browse files

update .snap on smfs

parent dbf4afc8
No related branches found
No related tags found
No related merge requests found
......@@ -64,10 +64,11 @@ static void smfs_init_inode_info (struct inode *inode, void *opaque)
static void smfs_clear_inode_info(struct inode *inode)
{
struct inode *cache_inode = I2CI(inode);
LASSERTF(atomic_read(&cache_inode->i_count) == 1,
"cache inode %lu i_count %d not 0\n", cache_inode->i_ino,
"inode %lu i_count %d != 1\n", cache_inode->i_ino,
atomic_read(&cache_inode->i_count));
iput(cache_inode);
OBD_FREE(I2SMI(inode), sizeof(struct smfs_inode_info));
}
......@@ -268,8 +269,8 @@ static void smfs_put_inode(struct inode *inode)
CDEBUG(D_INFO, "cache_inode i_count ino %lu i_count %d\n",
inode->i_ino, atomic_read(&inode->i_count));
if (atomic_read(&cache_inode->i_count) > 1 &&
cache_inode != cache_inode->i_sb->s_root->d_inode) {
if (atomic_read(&cache_inode->i_count) > 1 /*&&
cache_inode != cache_inode->i_sb->s_root->d_inode*/) {
CDEBUG(D_INFO, "cache_inode i_count ino %lu i_count %d\n",
cache_inode->i_ino,
atomic_read(&cache_inode->i_count) - 1);
......@@ -306,8 +307,8 @@ static void smfs_clear_inode(struct inode *inode)
cache_inode = I2CI(inode);
if (cache_inode != cache_inode->i_sb->s_root->d_inode)
smfs_clear_inode_info(inode);
smfs_clear_inode_info(inode);
EXIT;
return;
}
......
......@@ -131,6 +131,8 @@ struct smfs_hook_ops *smfs_unregister_hook_ops(struct smfs_super_info *smb,
/*smfs_lib.c*/
void smfs_put_super(struct super_block *sb);
int smfs_fill_super(struct super_block *sb, void *data, int silent);
void smfs_cleanup_hooks(struct smfs_super_info *smb);
/*sysctl.c*/
extern int sm_debug_level;
extern int sm_inodes;
......
......@@ -163,8 +163,6 @@ err_out:
static int smfs_umount_cache(struct smfs_super_info *smb)
{
iput(smb->smsi_sb->s_root->d_inode);
dput(smb->smsi_sb->s_root);
mntput(smb->smsi_mnt);
smfs_cleanup_sm_ops(smb);
smfs_cleanup_fsfilt_ops(smb);
......@@ -216,7 +214,7 @@ static void smfs_cleanup_smb(struct super_block *sb)
EXIT;
return;
}
static void smfs_cleanup_hooks(struct smfs_super_info *smb)
void smfs_cleanup_hooks(struct smfs_super_info *smb)
{
if (SMFS_CACHE_HOOK(smb))
......@@ -227,15 +225,16 @@ static void smfs_cleanup_hooks(struct smfs_super_info *smb)
if (SMFS_DO_COW(smb))
smfs_cow_cleanup(smb);
#endif
smfs_cleanup_hook_ops(smb);
}
void smfs_put_super(struct super_block *sb)
{
struct smfs_super_info *smfs_info = S2SMI(sb);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
smfs_cleanup_hooks(smfs_info);
smfs_cleanup_hook_ops(smfs_info);
#endif
if (sb)
smfs_umount_cache(smfs_info);
smfs_cleanup_smb(sb);
......
......@@ -69,12 +69,16 @@ struct super_block *smfs_get_sb(struct file_system_type *fs_type, int flags,
{
return get_sb_nodev(fs_type, flags, data, smfs_fill_super);
}
void smfs_kill_super(struct super_block *sb)
{
smfs_cleanup_hooks(S2SMI(sb));
kill_anon_super(sb);
}
static struct file_system_type smfs_type = {
.owner = THIS_MODULE,
.name = "smfs",
.get_sb = smfs_get_sb,
.kill_sb = kill_anon_super,
.kill_sb = smfs_kill_super,
};
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment