Commit 317e1300 authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim

f2fs: kill __is_extent_same

Since commit ee6d182f ("f2fs: remove syncing inode page in all the
cases") delayed inode element updating from inode cache to node page
cache, so once largest cached extent is updated, we can make inode dirty
immediately instead of checking and updating it in the end of extent
cache update.

The above commit didn't clean up unneeded codes in extent_cache.c, let's
finish the job in this patch.
Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 19f4e688
...@@ -413,7 +413,7 @@ static struct extent_node *__insert_extent_tree(struct inode *inode, ...@@ -413,7 +413,7 @@ static struct extent_node *__insert_extent_tree(struct inode *inode,
return en; return en;
} }
static unsigned int f2fs_update_extent_tree_range(struct inode *inode, static void f2fs_update_extent_tree_range(struct inode *inode,
pgoff_t fofs, block_t blkaddr, unsigned int len) pgoff_t fofs, block_t blkaddr, unsigned int len)
{ {
struct f2fs_sb_info *sbi = F2FS_I_SB(inode); struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
...@@ -426,7 +426,7 @@ static unsigned int f2fs_update_extent_tree_range(struct inode *inode, ...@@ -426,7 +426,7 @@ static unsigned int f2fs_update_extent_tree_range(struct inode *inode,
unsigned int pos = (unsigned int)fofs; unsigned int pos = (unsigned int)fofs;
if (!et) if (!et)
return false; return;
trace_f2fs_update_extent_tree_range(inode, fofs, blkaddr, len); trace_f2fs_update_extent_tree_range(inode, fofs, blkaddr, len);
...@@ -434,7 +434,7 @@ static unsigned int f2fs_update_extent_tree_range(struct inode *inode, ...@@ -434,7 +434,7 @@ static unsigned int f2fs_update_extent_tree_range(struct inode *inode,
if (is_inode_flag_set(inode, FI_NO_EXTENT)) { if (is_inode_flag_set(inode, FI_NO_EXTENT)) {
write_unlock(&et->lock); write_unlock(&et->lock);
return false; return;
} }
prev = et->largest; prev = et->largest;
...@@ -531,8 +531,6 @@ static unsigned int f2fs_update_extent_tree_range(struct inode *inode, ...@@ -531,8 +531,6 @@ static unsigned int f2fs_update_extent_tree_range(struct inode *inode,
__free_extent_tree(sbi, et); __free_extent_tree(sbi, et);
write_unlock(&et->lock); write_unlock(&et->lock);
return !__is_extent_same(&prev, &et->largest);
} }
unsigned int f2fs_shrink_extent_tree(struct f2fs_sb_info *sbi, int nr_shrink) unsigned int f2fs_shrink_extent_tree(struct f2fs_sb_info *sbi, int nr_shrink)
......
...@@ -496,13 +496,6 @@ static inline void set_extent_info(struct extent_info *ei, unsigned int fofs, ...@@ -496,13 +496,6 @@ static inline void set_extent_info(struct extent_info *ei, unsigned int fofs,
ei->len = len; ei->len = len;
} }
static inline bool __is_extent_same(struct extent_info *ei1,
struct extent_info *ei2)
{
return (ei1->fofs == ei2->fofs && ei1->blk == ei2->blk &&
ei1->len == ei2->len);
}
static inline bool __is_extent_mergeable(struct extent_info *back, static inline bool __is_extent_mergeable(struct extent_info *back,
struct extent_info *front) struct extent_info *front)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment