Эх сурвалжийг харах

f2fs: switch to check FI_NO_EXTENT in f2fs_{lookup,update}_extent_cache

This patch switch to check FI_NO_EXTENT in f2fs_{lookup,update}_extent_cache
instead of f2fs_{lookup,update}_extent_tree or {lookup,update}_extent_info.

No functionality modification in this patch.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Chao Yu 10 жил өмнө
parent
commit
91c5d9bce7
1 өөрчлөгдсөн 6 нэмэгдсэн , 12 устгасан
  1. 6 12
      fs/f2fs/data.c

+ 6 - 12
fs/f2fs/data.c

@@ -273,9 +273,6 @@ static bool lookup_extent_info(struct inode *inode, pgoff_t pgofs,
 	pgoff_t start_fofs, end_fofs;
 	pgoff_t start_fofs, end_fofs;
 	block_t start_blkaddr;
 	block_t start_blkaddr;
 
 
-	if (is_inode_flag_set(fi, FI_NO_EXTENT))
-		return false;
-
 	read_lock(&fi->ext_lock);
 	read_lock(&fi->ext_lock);
 	if (fi->ext.len == 0) {
 	if (fi->ext.len == 0) {
 		read_unlock(&fi->ext_lock);
 		read_unlock(&fi->ext_lock);
@@ -306,9 +303,6 @@ static bool update_extent_info(struct inode *inode, pgoff_t fofs,
 	block_t start_blkaddr, end_blkaddr;
 	block_t start_blkaddr, end_blkaddr;
 	int need_update = true;
 	int need_update = true;
 
 
-	if (is_inode_flag_set(fi, FI_NO_EXTENT))
-		return false;
-
 	write_lock(&fi->ext_lock);
 	write_lock(&fi->ext_lock);
 
 
 	start_fofs = fi->ext.fofs;
 	start_fofs = fi->ext.fofs;
@@ -542,9 +536,6 @@ static bool f2fs_lookup_extent_tree(struct inode *inode, pgoff_t pgofs,
 	struct extent_tree *et;
 	struct extent_tree *et;
 	struct extent_node *en;
 	struct extent_node *en;
 
 
-	if (is_inode_flag_set(F2FS_I(inode), FI_NO_EXTENT))
-		return false;
-
 	trace_f2fs_lookup_extent_tree_start(inode, pgofs);
 	trace_f2fs_lookup_extent_tree_start(inode, pgofs);
 
 
 	down_read(&sbi->extent_tree_lock);
 	down_read(&sbi->extent_tree_lock);
@@ -586,9 +577,6 @@ static void f2fs_update_extent_tree(struct inode *inode, pgoff_t fofs,
 	struct extent_info ei, dei;
 	struct extent_info ei, dei;
 	unsigned int endofs;
 	unsigned int endofs;
 
 
-	if (is_inode_flag_set(F2FS_I(inode), FI_NO_EXTENT))
-		return;
-
 	trace_f2fs_update_extent_tree(inode, fofs, blkaddr);
 	trace_f2fs_update_extent_tree(inode, fofs, blkaddr);
 
 
 	down_write(&sbi->extent_tree_lock);
 	down_write(&sbi->extent_tree_lock);
@@ -780,6 +768,9 @@ out:
 static bool f2fs_lookup_extent_cache(struct inode *inode, pgoff_t pgofs,
 static bool f2fs_lookup_extent_cache(struct inode *inode, pgoff_t pgofs,
 							struct extent_info *ei)
 							struct extent_info *ei)
 {
 {
+	if (is_inode_flag_set(F2FS_I(inode), FI_NO_EXTENT))
+		return false;
+
 	if (test_opt(F2FS_I_SB(inode), EXTENT_CACHE))
 	if (test_opt(F2FS_I_SB(inode), EXTENT_CACHE))
 		return f2fs_lookup_extent_tree(inode, pgofs, ei);
 		return f2fs_lookup_extent_tree(inode, pgofs, ei);
 
 
@@ -796,6 +787,9 @@ void f2fs_update_extent_cache(struct dnode_of_data *dn)
 	/* Update the page address in the parent node */
 	/* Update the page address in the parent node */
 	__set_data_blkaddr(dn);
 	__set_data_blkaddr(dn);
 
 
+	if (is_inode_flag_set(fi, FI_NO_EXTENT))
+		return;
+
 	fofs = start_bidx_of_node(ofs_of_node(dn->node_page), fi) +
 	fofs = start_bidx_of_node(ofs_of_node(dn->node_page), fi) +
 							dn->ofs_in_node;
 							dn->ofs_in_node;