mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	ext4: switch to using write_cache_pages() for data=journal writeout
Instead of using generic_writepages(), let's use write_cache_pages() for writeout of journalled data. It will allow us to stop providing .writepage callback. Our data=journal writeback path would benefit from a larger cleanup and refactoring but that's for a separate cleanup series. Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/20221207112722.22220-10-jack@suse.cz Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
		
							parent
							
								
									f30ff35f62
								
							
						
					
					
						commit
						49977f9762
					
				
					 1 changed files with 9 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -2712,6 +2712,12 @@ static int mpage_prepare_extent_to_map(struct mpage_da_data *mpd)
 | 
			
		|||
	return err;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int ext4_writepage_cb(struct page *page, struct writeback_control *wbc,
 | 
			
		||||
			     void *data)
 | 
			
		||||
{
 | 
			
		||||
	return ext4_writepage(page, wbc);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int ext4_do_writepages(struct mpage_da_data *mpd)
 | 
			
		||||
{
 | 
			
		||||
	struct writeback_control *wbc = mpd->wbc;
 | 
			
		||||
| 
						 | 
				
			
			@ -2738,7 +2744,9 @@ static int ext4_do_writepages(struct mpage_da_data *mpd)
 | 
			
		|||
		goto out_writepages;
 | 
			
		||||
 | 
			
		||||
	if (ext4_should_journal_data(inode)) {
 | 
			
		||||
		ret = generic_writepages(mapping, wbc);
 | 
			
		||||
		blk_start_plug(&plug);
 | 
			
		||||
		ret = write_cache_pages(mapping, wbc, ext4_writepage_cb, NULL);
 | 
			
		||||
		blk_finish_plug(&plug);
 | 
			
		||||
		goto out_writepages;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue