@@ -2222,7 +2222,7 @@ static void __block_commit_write(struct folio *folio, size_t from, size_t to)
22222222 * The filesystem needs to handle block truncation upon failure.
22232223 */
22242224int block_write_begin (struct address_space * mapping , loff_t pos , unsigned len ,
2225- struct page * * pagep , get_block_t * get_block )
2225+ struct folio * * foliop , get_block_t * get_block )
22262226{
22272227 pgoff_t index = pos >> PAGE_SHIFT ;
22282228 struct folio * folio ;
@@ -2240,7 +2240,7 @@ int block_write_begin(struct address_space *mapping, loff_t pos, unsigned len,
22402240 folio = NULL ;
22412241 }
22422242
2243- * pagep = & folio -> page ;
2243+ * foliop = folio ;
22442244 return status ;
22452245}
22462246EXPORT_SYMBOL (block_write_begin );
@@ -2467,19 +2467,19 @@ int generic_cont_expand_simple(struct inode *inode, loff_t size)
24672467{
24682468 struct address_space * mapping = inode -> i_mapping ;
24692469 const struct address_space_operations * aops = mapping -> a_ops ;
2470- struct page * page ;
2470+ struct folio * folio ;
24712471 void * fsdata = NULL ;
24722472 int err ;
24732473
24742474 err = inode_newsize_ok (inode , size );
24752475 if (err )
24762476 goto out ;
24772477
2478- err = aops -> write_begin (NULL , mapping , size , 0 , & page , & fsdata );
2478+ err = aops -> write_begin (NULL , mapping , size , 0 , & folio , & fsdata );
24792479 if (err )
24802480 goto out ;
24812481
2482- err = aops -> write_end (NULL , mapping , size , 0 , 0 , page_folio ( page ) , fsdata );
2482+ err = aops -> write_end (NULL , mapping , size , 0 , 0 , folio , fsdata );
24832483 BUG_ON (err > 0 );
24842484
24852485out :
@@ -2493,7 +2493,7 @@ static int cont_expand_zero(struct file *file, struct address_space *mapping,
24932493 struct inode * inode = mapping -> host ;
24942494 const struct address_space_operations * aops = mapping -> a_ops ;
24952495 unsigned int blocksize = i_blocksize (inode );
2496- struct page * page ;
2496+ struct folio * folio ;
24972497 void * fsdata = NULL ;
24982498 pgoff_t index , curidx ;
24992499 loff_t curpos ;
@@ -2512,12 +2512,12 @@ static int cont_expand_zero(struct file *file, struct address_space *mapping,
25122512 len = PAGE_SIZE - zerofrom ;
25132513
25142514 err = aops -> write_begin (file , mapping , curpos , len ,
2515- & page , & fsdata );
2515+ & folio , & fsdata );
25162516 if (err )
25172517 goto out ;
2518- zero_user ( page , zerofrom , len );
2518+ folio_zero_range ( folio , offset_in_folio ( folio , curpos ) , len );
25192519 err = aops -> write_end (file , mapping , curpos , len , len ,
2520- page_folio ( page ) , fsdata );
2520+ folio , fsdata );
25212521 if (err < 0 )
25222522 goto out ;
25232523 BUG_ON (err != len );
@@ -2545,12 +2545,12 @@ static int cont_expand_zero(struct file *file, struct address_space *mapping,
25452545 len = offset - zerofrom ;
25462546
25472547 err = aops -> write_begin (file , mapping , curpos , len ,
2548- & page , & fsdata );
2548+ & folio , & fsdata );
25492549 if (err )
25502550 goto out ;
2551- zero_user ( page , zerofrom , len );
2551+ folio_zero_range ( folio , offset_in_folio ( folio , curpos ) , len );
25522552 err = aops -> write_end (file , mapping , curpos , len , len ,
2553- page_folio ( page ) , fsdata );
2553+ folio , fsdata );
25542554 if (err < 0 )
25552555 goto out ;
25562556 BUG_ON (err != len );
@@ -2566,7 +2566,7 @@ static int cont_expand_zero(struct file *file, struct address_space *mapping,
25662566 */
25672567int cont_write_begin (struct file * file , struct address_space * mapping ,
25682568 loff_t pos , unsigned len ,
2569- struct page * * pagep , void * * fsdata ,
2569+ struct folio * * foliop , void * * fsdata ,
25702570 get_block_t * get_block , loff_t * bytes )
25712571{
25722572 struct inode * inode = mapping -> host ;
@@ -2584,7 +2584,7 @@ int cont_write_begin(struct file *file, struct address_space *mapping,
25842584 (* bytes )++ ;
25852585 }
25862586
2587- return block_write_begin (mapping , pos , len , pagep , get_block );
2587+ return block_write_begin (mapping , pos , len , foliop , get_block );
25882588}
25892589EXPORT_SYMBOL (cont_write_begin );
25902590
0 commit comments