@@ -2648,8 +2648,8 @@ static inline bool need_inplace_update(struct f2fs_io_info *fio)
2648
2648
2649
2649
int f2fs_do_write_data_page (struct f2fs_io_info * fio )
2650
2650
{
2651
- struct page * page = fio -> page ;
2652
- struct inode * inode = page -> mapping -> host ;
2651
+ struct folio * folio = page_folio ( fio -> page ) ;
2652
+ struct inode * inode = folio -> mapping -> host ;
2653
2653
struct dnode_of_data dn ;
2654
2654
struct node_info ni ;
2655
2655
bool ipu_force = false;
@@ -2658,14 +2658,14 @@ int f2fs_do_write_data_page(struct f2fs_io_info *fio)
2658
2658
2659
2659
/* Use COW inode to make dnode_of_data for atomic write */
2660
2660
atomic_commit = f2fs_is_atomic_file (inode ) &&
2661
- page_private_atomic (fio -> page );
2661
+ page_private_atomic (folio_page ( folio , 0 ) );
2662
2662
if (atomic_commit )
2663
2663
set_new_dnode (& dn , F2FS_I (inode )-> cow_inode , NULL , NULL , 0 );
2664
2664
else
2665
2665
set_new_dnode (& dn , inode , NULL , NULL , 0 );
2666
2666
2667
2667
if (need_inplace_update (fio ) &&
2668
- f2fs_lookup_read_extent_cache_block (inode , page -> index ,
2668
+ f2fs_lookup_read_extent_cache_block (inode , folio -> index ,
2669
2669
& fio -> old_blkaddr )) {
2670
2670
if (!f2fs_is_valid_blkaddr (fio -> sbi , fio -> old_blkaddr ,
2671
2671
DATA_GENERIC_ENHANCE ))
@@ -2680,16 +2680,16 @@ int f2fs_do_write_data_page(struct f2fs_io_info *fio)
2680
2680
if (fio -> need_lock == LOCK_REQ && !f2fs_trylock_op (fio -> sbi ))
2681
2681
return - EAGAIN ;
2682
2682
2683
- err = f2fs_get_dnode_of_data (& dn , page -> index , LOOKUP_NODE );
2683
+ err = f2fs_get_dnode_of_data (& dn , folio -> index , LOOKUP_NODE );
2684
2684
if (err )
2685
2685
goto out ;
2686
2686
2687
2687
fio -> old_blkaddr = dn .data_blkaddr ;
2688
2688
2689
2689
/* This page is already truncated */
2690
2690
if (fio -> old_blkaddr == NULL_ADDR ) {
2691
- ClearPageUptodate ( page );
2692
- clear_page_private_gcing (page );
2691
+ folio_clear_uptodate ( folio );
2692
+ clear_page_private_gcing (folio_page ( folio , 0 ) );
2693
2693
goto out_writepage ;
2694
2694
}
2695
2695
got_it :
@@ -2715,19 +2715,19 @@ int f2fs_do_write_data_page(struct f2fs_io_info *fio)
2715
2715
if (err )
2716
2716
goto out_writepage ;
2717
2717
2718
- set_page_writeback ( page );
2718
+ folio_start_writeback ( folio );
2719
2719
f2fs_put_dnode (& dn );
2720
2720
if (fio -> need_lock == LOCK_REQ )
2721
2721
f2fs_unlock_op (fio -> sbi );
2722
2722
err = f2fs_inplace_write_data (fio );
2723
2723
if (err ) {
2724
2724
if (fscrypt_inode_uses_fs_layer_crypto (inode ))
2725
2725
fscrypt_finalize_bounce_page (& fio -> encrypted_page );
2726
- end_page_writeback ( page );
2726
+ folio_end_writeback ( folio );
2727
2727
} else {
2728
2728
set_inode_flag (inode , FI_UPDATE_WRITE );
2729
2729
}
2730
- trace_f2fs_do_write_data_page (page_folio ( page ) , IPU );
2730
+ trace_f2fs_do_write_data_page (folio , IPU );
2731
2731
return err ;
2732
2732
}
2733
2733
@@ -2749,17 +2749,17 @@ int f2fs_do_write_data_page(struct f2fs_io_info *fio)
2749
2749
if (err )
2750
2750
goto out_writepage ;
2751
2751
2752
- set_page_writeback ( page );
2752
+ folio_start_writeback ( folio );
2753
2753
2754
2754
if (fio -> compr_blocks && fio -> old_blkaddr == COMPRESS_ADDR )
2755
2755
f2fs_i_compr_blocks_update (inode , fio -> compr_blocks - 1 , false);
2756
2756
2757
2757
/* LFS mode write path */
2758
2758
f2fs_outplace_write_data (& dn , fio );
2759
- trace_f2fs_do_write_data_page (page_folio ( page ) , OPU );
2759
+ trace_f2fs_do_write_data_page (folio , OPU );
2760
2760
set_inode_flag (inode , FI_APPEND_WRITE );
2761
2761
if (atomic_commit )
2762
- clear_page_private_atomic (page );
2762
+ clear_page_private_atomic (folio_page ( folio , 0 ) );
2763
2763
out_writepage :
2764
2764
f2fs_put_dnode (& dn );
2765
2765
out :
0 commit comments