Skip to contentSkip to conversation

f2fs: remove unused parameter in f2fs_get_read_data_page()

PATCH In review Jia Yang 2 participants 3 messages Jun 30, 2020 F2FS file system

lore
Share & tools
lore

Jia Yang

author
#0 lore raw

PATCH 1/1 f2fs: remove unused parameter in f2fs_get_read_data_page()

The parameter "op_flags" is not used in f2fs_get_read_data_page(), so it can be removed.

---
 fs/f2fs/data.c | 6 +++---
 fs/f2fs/f2fs.h | 2 +-
 fs/f2fs/gc.c   | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)
fs/f2fs/data.c +3 -3
index 326c63879ddc..f1b85185e9df 100644
@@ -1157,7 +1157,7 @@ int f2fs_get_block(struct dnode_of_data *dn, pgoff_t index)
 }
 
 struct page *f2fs_get_read_data_page(struct inode *inode, pgoff_t index,
-						int op_flags, bool for_write)
+						bool for_write)
 {
 	struct address_space *mapping = inode->i_mapping;
 	struct dnode_of_data dn;
@@ -1237,7 +1237,7 @@ struct page *f2fs_find_data_page(struct inode *inode, pgoff_t index)
 		return page;
 	f2fs_put_page(page, 0);
 
-	page = f2fs_get_read_data_page(inode, index, 0, false);
+	page = f2fs_get_read_data_page(inode, index, false);
 	if (IS_ERR(page))
 		return page;
 
@@ -1263,7 +1263,7 @@ struct page *f2fs_get_lock_data_page(struct inode *inode, pgoff_t index,
 	struct address_space *mapping = inode->i_mapping;
 	struct page *page;
 repeat:
-	page = f2fs_get_read_data_page(inode, index, 0, for_write);
+	page = f2fs_get_read_data_page(inode, index, for_write);
 	if (IS_ERR(page))
 		return page;
 
fs/f2fs/f2fs.h +1 -1
index b35a50f4953c..41ef50714a39 100644
@@ -3441,7 +3441,7 @@ int f2fs_get_block(struct dnode_of_data *dn, pgoff_t index);
 int f2fs_preallocate_blocks(struct kiocb *iocb, struct iov_iter *from);
 int f2fs_reserve_block(struct dnode_of_data *dn, pgoff_t index);
 struct page *f2fs_get_read_data_page(struct inode *inode, pgoff_t index,
-			int op_flags, bool for_write);
+			bool for_write);
 struct page *f2fs_find_data_page(struct inode *inode, pgoff_t index);
 struct page *f2fs_get_lock_data_page(struct inode *inode, pgoff_t index,
 			bool for_write);
fs/f2fs/gc.c +1 -1
index 5b95d5a146eb..487f75d9136c 100644
@@ -1094,7 +1094,7 @@ static int gc_data_segment(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
 			}
 
 			data_page = f2fs_get_read_data_page(inode,
-						start_bidx, REQ_RAHEAD, true);
+						start_bidx, true);
 			up_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
 			if (IS_ERR(data_page)) {
 				iput(inode);
Signature · 8 lines
2.26.0.106.g9fadedd



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
#1 lore raw
Quoted 2 lines · Jia Yang

The parameter "op_flags" is not used in f2fs_get_read_data_page(), so it can be removed.

I don't think so, there is one missing case as below, in where op_flag was set incorrectly in f2fs_grab_read_bio(), we need to add one more parameter to pass op_flag value.

- gc_data_segment
- f2fs_get_read_data_page(.., op_flag = REQ_RAHEAD,..)
- f2fs_submit_page_read
- f2fs_grab_read_bio(.., op_flag = 0, ..)

Quoted 58 lines
---
 fs/f2fs/data.c | 6 +++---
 fs/f2fs/f2fs.h | 2 +-
 fs/f2fs/gc.c   | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)
fs/f2fs/data.c +3 -3
index 326c63879ddc..f1b85185e9df 100644
@@ -1157,7 +1157,7 @@ int f2fs_get_block(struct dnode_of_data *dn, pgoff_t index)
 }
 
 struct page *f2fs_get_read_data_page(struct inode *inode, pgoff_t index,
-						int op_flags, bool for_write)
+						bool for_write)
 {
 	struct address_space *mapping = inode->i_mapping;
 	struct dnode_of_data dn;
@@ -1237,7 +1237,7 @@ struct page *f2fs_find_data_page(struct inode *inode, pgoff_t index)
 		return page;
 	f2fs_put_page(page, 0);
 
-	page = f2fs_get_read_data_page(inode, index, 0, false);
+	page = f2fs_get_read_data_page(inode, index, false);
 	if (IS_ERR(page))
 		return page;
 
@@ -1263,7 +1263,7 @@ struct page *f2fs_get_lock_data_page(struct inode *inode, pgoff_t index,
 	struct address_space *mapping = inode->i_mapping;
 	struct page *page;
 repeat:
-	page = f2fs_get_read_data_page(inode, index, 0, for_write);
+	page = f2fs_get_read_data_page(inode, index, for_write);
 	if (IS_ERR(page))
 		return page;
 
fs/f2fs/f2fs.h +1 -1
index b35a50f4953c..41ef50714a39 100644
@@ -3441,7 +3441,7 @@ int f2fs_get_block(struct dnode_of_data *dn, pgoff_t index);
 int f2fs_preallocate_blocks(struct kiocb *iocb, struct iov_iter *from);
 int f2fs_reserve_block(struct dnode_of_data *dn, pgoff_t index);
 struct page *f2fs_get_read_data_page(struct inode *inode, pgoff_t index,
-			int op_flags, bool for_write);
+			bool for_write);
 struct page *f2fs_find_data_page(struct inode *inode, pgoff_t index);
 struct page *f2fs_get_lock_data_page(struct inode *inode, pgoff_t index,
 			bool for_write);
fs/f2fs/gc.c +0 -0
index 5b95d5a146eb..487f75d9136c 100644

fs/f2fs/gc.c static int gc_data_segment(struct f2fs_sb_info *sbi, struct f2fs_summary *sum, · line 1100

Quoted 8 lines
fs/f2fs/gc.c +1 -1
@@ -1094,7 +1094,7 @@ static int gc_data_segment(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
 			}
 
 			data_page = f2fs_get_read_data_page(inode,
-						start_bidx, REQ_RAHEAD, true);
+						start_bidx, true);
 			up_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
 			if (IS_ERR(data_page)) {
 				iput(inode);

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

author
#2 lore raw
Quoted 15 lines · Jia Yang
Quoted 2 lines

The parameter "op_flags" is not used in f2fs_get_read_data_page(), so it can be removed.

I don't think so, there is one missing case as below, in where op_flag was set incorrectly in f2fs_grab_read_bio(), we need to add one more parameter to pass op_flag value.

- gc_data_segment
- f2fs_get_read_data_page(.., op_flag = REQ_RAHEAD,..)
- f2fs_submit_page_read
- f2fs_grab_read_bio(.., op_flag = 0, ..)

Thanks for your suggestion, I will submit a new patch later as you suggested.

Quoted 59 lines
Quoted 59 lines
---
 fs/f2fs/data.c | 6 +++---
 fs/f2fs/f2fs.h | 2 +-
 fs/f2fs/gc.c   | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)
fs/f2fs/data.c +3 -3
index 326c63879ddc..f1b85185e9df 100644
@@ -1157,7 +1157,7 @@ int f2fs_get_block(struct dnode_of_data *dn, pgoff_t index)
 }
 
 struct page *f2fs_get_read_data_page(struct inode *inode, pgoff_t index,
-						int op_flags, bool for_write)
+						bool for_write)
 {
 	struct address_space *mapping = inode->i_mapping;
 	struct dnode_of_data dn;
@@ -1237,7 +1237,7 @@ struct page *f2fs_find_data_page(struct inode *inode, pgoff_t index)
 		return page;
 	f2fs_put_page(page, 0);
 
-	page = f2fs_get_read_data_page(inode, index, 0, false);
+	page = f2fs_get_read_data_page(inode, index, false);
 	if (IS_ERR(page))
 		return page;
 
@@ -1263,7 +1263,7 @@ struct page *f2fs_get_lock_data_page(struct inode *inode, pgoff_t index,
 	struct address_space *mapping = inode->i_mapping;
 	struct page *page;
 repeat:
-	page = f2fs_get_read_data_page(inode, index, 0, for_write);
+	page = f2fs_get_read_data_page(inode, index, for_write);
 	if (IS_ERR(page))
 		return page;
 
fs/f2fs/f2fs.h +1 -1
index b35a50f4953c..41ef50714a39 100644
@@ -3441,7 +3441,7 @@ int f2fs_get_block(struct dnode_of_data *dn, pgoff_t index);
 int f2fs_preallocate_blocks(struct kiocb *iocb, struct iov_iter *from);
 int f2fs_reserve_block(struct dnode_of_data *dn, pgoff_t index);
 struct page *f2fs_get_read_data_page(struct inode *inode, pgoff_t index,
-			int op_flags, bool for_write);
+			bool for_write);
 struct page *f2fs_find_data_page(struct inode *inode, pgoff_t index);
 struct page *f2fs_get_lock_data_page(struct inode *inode, pgoff_t index,
 			bool for_write);
fs/f2fs/gc.c +0 -0
index 5b95d5a146eb..487f75d9136c 100644
@@ -1094,7 +1094,7 @@ static int gc_data_segment(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
 			}
 
Quoted 9 lines

fs/f2fs/gc.c static int gc_data_segment(struct f2fs_sb_info *sbi, struct f2fs_summary *sum, · line 1100

Quoted 7 lines
fs/f2fs/gc.c +1 -1
 			data_page = f2fs_get_read_data_page(inode,
-						start_bidx, REQ_RAHEAD, true);
+						start_bidx, true);
 			up_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
 			if (IS_ERR(data_page)) {
 				iput(inode);

.

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel