@@ -81,19 +81,19 @@ ext2_last_byte(struct inode *inode, unsigned long page_nr)
81
81
return last_byte ;
82
82
}
83
83
84
- static void ext2_commit_chunk (struct page * page , loff_t pos , unsigned len )
84
+ static void ext2_commit_chunk (struct folio * folio , loff_t pos , unsigned len )
85
85
{
86
- struct address_space * mapping = page -> mapping ;
86
+ struct address_space * mapping = folio -> mapping ;
87
87
struct inode * dir = mapping -> host ;
88
88
89
89
inode_inc_iversion (dir );
90
- block_write_end (NULL , mapping , pos , len , len , page , NULL );
90
+ block_write_end (NULL , mapping , pos , len , len , & folio -> page , NULL );
91
91
92
92
if (pos + len > dir -> i_size ) {
93
93
i_size_write (dir , pos + len );
94
94
mark_inode_dirty (dir );
95
95
}
96
- unlock_page ( page );
96
+ folio_unlock ( folio );
97
97
}
98
98
99
99
static bool ext2_check_folio (struct folio * folio , int quiet , char * kaddr )
@@ -433,12 +433,11 @@ int ext2_inode_by_name(struct inode *dir, const struct qstr *child, ino_t *ino)
433
433
return 0 ;
434
434
}
435
435
436
- static int ext2_prepare_chunk (struct page * page , loff_t pos , unsigned len )
436
+ static int ext2_prepare_chunk (struct folio * folio , loff_t pos , unsigned len )
437
437
{
438
- return __block_write_begin (page , pos , len , ext2_get_block );
438
+ return __block_write_begin (& folio -> page , pos , len , ext2_get_block );
439
439
}
440
440
441
-
442
441
static int ext2_handle_dirsync (struct inode * dir )
443
442
{
444
443
int err ;
@@ -457,14 +456,14 @@ int ext2_set_link(struct inode *dir, struct ext2_dir_entry_2 *de,
457
456
int err ;
458
457
459
458
folio_lock (folio );
460
- err = ext2_prepare_chunk (& folio -> page , pos , len );
459
+ err = ext2_prepare_chunk (folio , pos , len );
461
460
if (err ) {
462
461
folio_unlock (folio );
463
462
return err ;
464
463
}
465
464
de -> inode = cpu_to_le32 (inode -> i_ino );
466
465
ext2_set_de_type (de , inode );
467
- ext2_commit_chunk (& folio -> page , pos , len );
466
+ ext2_commit_chunk (folio , pos , len );
468
467
if (update_times )
469
468
dir -> i_mtime = inode_set_ctime_current (dir );
470
469
EXT2_I (dir )-> i_flags &= ~EXT2_BTREE_FL ;
@@ -539,7 +538,7 @@ int ext2_add_link (struct dentry *dentry, struct inode *inode)
539
538
540
539
got_it :
541
540
pos = folio_pos (folio ) + offset_in_folio (folio , de );
542
- err = ext2_prepare_chunk (& folio -> page , pos , rec_len );
541
+ err = ext2_prepare_chunk (folio , pos , rec_len );
543
542
if (err )
544
543
goto out_unlock ;
545
544
if (de -> inode ) {
@@ -552,7 +551,7 @@ int ext2_add_link (struct dentry *dentry, struct inode *inode)
552
551
memcpy (de -> name , name , namelen );
553
552
de -> inode = cpu_to_le32 (inode -> i_ino );
554
553
ext2_set_de_type (de , inode );
555
- ext2_commit_chunk (& folio -> page , pos , rec_len );
554
+ ext2_commit_chunk (folio , pos , rec_len );
556
555
dir -> i_mtime = inode_set_ctime_current (dir );
557
556
EXT2_I (dir )-> i_flags &= ~EXT2_BTREE_FL ;
558
557
mark_inode_dirty (dir );
@@ -598,15 +597,15 @@ int ext2_delete_entry(struct ext2_dir_entry_2 *dir, struct folio *folio)
598
597
from = offset_in_folio (folio , pde );
599
598
pos = folio_pos (folio ) + from ;
600
599
folio_lock (folio );
601
- err = ext2_prepare_chunk (& folio -> page , pos , to - from );
600
+ err = ext2_prepare_chunk (folio , pos , to - from );
602
601
if (err ) {
603
602
folio_unlock (folio );
604
603
return err ;
605
604
}
606
605
if (pde )
607
606
pde -> rec_len = ext2_rec_len_to_disk (to - from );
608
607
dir -> inode = 0 ;
609
- ext2_commit_chunk (& folio -> page , pos , to - from );
608
+ ext2_commit_chunk (folio , pos , to - from );
610
609
inode -> i_mtime = inode_set_ctime_current (inode );
611
610
EXT2_I (inode )-> i_flags &= ~EXT2_BTREE_FL ;
612
611
mark_inode_dirty (inode );
@@ -627,7 +626,7 @@ int ext2_make_empty(struct inode *inode, struct inode *parent)
627
626
if (IS_ERR (folio ))
628
627
return PTR_ERR (folio );
629
628
630
- err = ext2_prepare_chunk (& folio -> page , 0 , chunk_size );
629
+ err = ext2_prepare_chunk (folio , 0 , chunk_size );
631
630
if (err ) {
632
631
folio_unlock (folio );
633
632
goto fail ;
@@ -648,7 +647,7 @@ int ext2_make_empty(struct inode *inode, struct inode *parent)
648
647
memcpy (de -> name , "..\0" , 4 );
649
648
ext2_set_de_type (de , inode );
650
649
kunmap_local (kaddr );
651
- ext2_commit_chunk (& folio -> page , 0 , chunk_size );
650
+ ext2_commit_chunk (folio , 0 , chunk_size );
652
651
err = ext2_handle_dirsync (inode );
653
652
fail :
654
653
folio_put (folio );
0 commit comments