diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-06-19 17:53:26 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-08-04 14:09:56 -0700 |
commit | 3e72f721390dc14e7b33fda812843c0725810106 (patch) | |
tree | 0d0b84a3dc6ee8cfe3ef18a5a0f16f94b3c3ae75 /fs/f2fs/super.c | |
parent | 7daaea256de42da112805703e3c77f08973156b3 (diff) | |
download | blackbird-obmc-linux-3e72f721390dc14e7b33fda812843c0725810106.tar.gz blackbird-obmc-linux-3e72f721390dc14e7b33fda812843c0725810106.zip |
f2fs: use extent_cache by default
We don't need to handle the duplicate extent information.
The integrated rule is:
- update on-disk extent with largest one tracked by in-memory extent_cache
- destroy extent_tree for the truncation case
- drop per-inode extent_cache by shrinker
Reviewed-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/super.c')
-rw-r--r-- | fs/f2fs/super.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 92520228ce71..0083b8559c9b 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -422,7 +422,6 @@ static struct inode *f2fs_alloc_inode(struct super_block *sb) atomic_set(&fi->dirty_pages, 0); fi->i_current_depth = 1; fi->i_advise = 0; - rwlock_init(&fi->ext_lock); init_rwsem(&fi->i_sem); INIT_RADIX_TREE(&fi->inmem_root, GFP_NOFS); INIT_LIST_HEAD(&fi->inmem_pages); @@ -453,12 +452,17 @@ static int f2fs_drop_inode(struct inode *inode) */ if (!inode_unhashed(inode) && inode->i_state & I_SYNC) { if (!inode->i_nlink && !is_bad_inode(inode)) { + /* to avoid evict_inode call simultaneously */ + atomic_inc(&inode->i_count); spin_unlock(&inode->i_lock); /* some remained atomic pages should discarded */ if (f2fs_is_atomic_file(inode)) commit_inmem_pages(inode, true); + /* should remain fi->extent_tree for writepage */ + f2fs_destroy_extent_node(inode); + sb_start_intwrite(inode->i_sb); i_size_write(inode, 0); @@ -473,6 +477,7 @@ static int f2fs_drop_inode(struct inode *inode) F2FS_I(inode)->i_crypt_info); #endif spin_lock(&inode->i_lock); + atomic_dec(&inode->i_count); } return 0; } @@ -721,6 +726,7 @@ static void default_options(struct f2fs_sb_info *sbi) set_opt(sbi, BG_GC); set_opt(sbi, INLINE_DATA); + set_opt(sbi, EXTENT_CACHE); #ifdef CONFIG_F2FS_FS_XATTR set_opt(sbi, XATTR_USER); |