f2fs: Convert gc_data_segment() to use a folio
Use f2fs_get_read_data_folio() instead of f2fs_get_read_data_page(). Saves a hidden call to compound_head() in f2fs_put_page(). Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
committed by
Jaegeuk Kim
parent
ab907aa2a2
commit
a86e109ee2
+4
-4
@@ -1542,7 +1542,6 @@ next_step:
|
||||
entry = sum;
|
||||
|
||||
for (off = 0; off < usable_blks_in_seg; off++, entry++) {
|
||||
struct page *data_page;
|
||||
struct inode *inode;
|
||||
struct node_info dni; /* dnode info for the data */
|
||||
unsigned int ofs_in_node, nofs;
|
||||
@@ -1585,6 +1584,7 @@ next_step:
|
||||
ofs_in_node = le16_to_cpu(entry->ofs_in_node);
|
||||
|
||||
if (phase == 3) {
|
||||
struct folio *data_folio;
|
||||
int err;
|
||||
|
||||
inode = f2fs_iget(sb, dni.ino);
|
||||
@@ -1635,15 +1635,15 @@ next_step:
|
||||
continue;
|
||||
}
|
||||
|
||||
data_page = f2fs_get_read_data_page(inode, start_bidx,
|
||||
data_folio = f2fs_get_read_data_folio(inode, start_bidx,
|
||||
REQ_RAHEAD, true, NULL);
|
||||
f2fs_up_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
|
||||
if (IS_ERR(data_page)) {
|
||||
if (IS_ERR(data_folio)) {
|
||||
iput(inode);
|
||||
continue;
|
||||
}
|
||||
|
||||
f2fs_put_page(data_page, 0);
|
||||
f2fs_folio_put(data_folio, false);
|
||||
add_gc_inode(gc_list, inode);
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user