diff options
author | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2010-08-20 10:46:06 -0400 |
---|---|---|
committer | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2010-10-22 20:24:33 -0400 |
commit | b91c9a97c9333c87fe2a0c94b3b22b24df1c5fc2 (patch) | |
tree | c407ef3a87117f9ecb92b54bebb055110cafb64f | |
parent | 9566a7a851eb7201e3207eab53ee81efd0850fee (diff) |
nilfs2: allow nilfs_destroy_inode to destroy metadata file inodes
The current nilfs_destroy_inode() doesn't handle metadata file inodes
including gc inodes (dummy inodes used for garbage collection).
This allows nilfs_destroy_inode() to destroy inodes of metadata files.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
-rw-r--r-- | fs/nilfs2/mdt.c | 2 | ||||
-rw-r--r-- | fs/nilfs2/super.c | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/fs/nilfs2/mdt.c b/fs/nilfs2/mdt.c index d01aff4957d9..ee943a342e1d 100644 --- a/fs/nilfs2/mdt.c +++ b/fs/nilfs2/mdt.c | |||
@@ -577,7 +577,5 @@ void nilfs_mdt_destroy(struct inode *inode) | |||
577 | nilfs_palloc_destroy_cache(inode); | 577 | nilfs_palloc_destroy_cache(inode); |
578 | nilfs_mdt_clear(inode); | 578 | nilfs_mdt_clear(inode); |
579 | 579 | ||
580 | kfree(mdi->mi_bgl); /* kfree(NULL) is safe */ | ||
581 | kfree(mdi); | ||
582 | nilfs_destroy_inode(inode); | 580 | nilfs_destroy_inode(inode); |
583 | } | 581 | } |
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c index 9f4913f78408..51576b4dbf7a 100644 --- a/fs/nilfs2/super.c +++ b/fs/nilfs2/super.c | |||
@@ -167,6 +167,12 @@ struct inode *nilfs_alloc_inode(struct super_block *sb) | |||
167 | 167 | ||
168 | void nilfs_destroy_inode(struct inode *inode) | 168 | void nilfs_destroy_inode(struct inode *inode) |
169 | { | 169 | { |
170 | struct nilfs_mdt_info *mdi = NILFS_MDT(inode); | ||
171 | |||
172 | if (mdi) { | ||
173 | kfree(mdi->mi_bgl); /* kfree(NULL) is safe */ | ||
174 | kfree(mdi); | ||
175 | } | ||
170 | kmem_cache_free(nilfs_inode_cachep, NILFS_I(inode)); | 176 | kmem_cache_free(nilfs_inode_cachep, NILFS_I(inode)); |
171 | } | 177 | } |
172 | 178 | ||