Skip to content

Commit 3c86d1e

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: convert f2fs_write_end() to use folio
Convert to use folio, so that we can get rid of 'page->index' to prepare for removal of 'index' field in structure page [1]. [1] https://lore.kernel.org/all/[email protected]/ Cc: Matthew Wilcox <[email protected]> Signed-off-by: Chao Yu <[email protected]> Reviewed-by: Li Zetao <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 12e61ce commit 3c86d1e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

fs/f2fs/data.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3698,7 +3698,8 @@ static int f2fs_write_end(struct file *file,
36983698
loff_t pos, unsigned len, unsigned copied,
36993699
struct page *page, void *fsdata)
37003700
{
3701-
struct inode *inode = page->mapping->host;
3701+
struct folio *folio = page_folio(page);
3702+
struct inode *inode = folio->mapping->host;
37023703

37033704
trace_f2fs_write_end(inode, pos, len, copied);
37043705

@@ -3707,17 +3708,17 @@ static int f2fs_write_end(struct file *file,
37073708
* should be PAGE_SIZE. Otherwise, we treat it with zero copied and
37083709
* let generic_perform_write() try to copy data again through copied=0.
37093710
*/
3710-
if (!PageUptodate(page)) {
3711+
if (!folio_test_uptodate(folio)) {
37113712
if (unlikely(copied != len))
37123713
copied = 0;
37133714
else
3714-
SetPageUptodate(page);
3715+
folio_mark_uptodate(folio);
37153716
}
37163717

37173718
#ifdef CONFIG_F2FS_FS_COMPRESSION
37183719
/* overwrite compressed file */
37193720
if (f2fs_compressed_file(inode) && fsdata) {
3720-
f2fs_compress_write_end(inode, fsdata, page->index, copied);
3721+
f2fs_compress_write_end(inode, fsdata, folio->index, copied);
37213722
f2fs_update_time(F2FS_I_SB(inode), REQ_TIME);
37223723

37233724
if (pos + copied > i_size_read(inode) &&
@@ -3730,10 +3731,10 @@ static int f2fs_write_end(struct file *file,
37303731
if (!copied)
37313732
goto unlock_out;
37323733

3733-
set_page_dirty(page);
3734+
folio_mark_dirty(folio);
37343735

37353736
if (f2fs_is_atomic_file(inode))
3736-
set_page_private_atomic(page);
3737+
set_page_private_atomic(folio_page(folio, 0));
37373738

37383739
if (pos + copied > i_size_read(inode) &&
37393740
!f2fs_verity_in_progress(inode)) {

0 commit comments

Comments
 (0)