forked from mirrors/linux
		
	ext4: Drop special handling of journalled data from ext4_sync_file()
Now that ext4_writepages() make sure all pages with journalled data are stable on disk, we don't need special handling of journalled data in ext4_sync_file(). Signed-off-by: Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/20230329154950.19720-6-jack@suse.cz Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
		
							parent
							
								
									1f1a55f0bf
								
							
						
					
					
						commit
						e360c6ed72
					
				
					 1 changed files with 0 additions and 11 deletions
				
			
		|  | @ -153,23 +153,12 @@ int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync) | ||||||
| 		goto out; | 		goto out; | ||||||
| 
 | 
 | ||||||
| 	/*
 | 	/*
 | ||||||
| 	 * data=writeback,ordered: |  | ||||||
| 	 *  The caller's filemap_fdatawrite()/wait will sync the data. | 	 *  The caller's filemap_fdatawrite()/wait will sync the data. | ||||||
| 	 *  Metadata is in the journal, we wait for proper transaction to | 	 *  Metadata is in the journal, we wait for proper transaction to | ||||||
| 	 *  commit here. | 	 *  commit here. | ||||||
| 	 * |  | ||||||
| 	 * data=journal: |  | ||||||
| 	 *  filemap_fdatawrite won't do anything (the buffers are clean). |  | ||||||
| 	 *  ext4_force_commit will write the file data into the journal and |  | ||||||
| 	 *  will wait on that. |  | ||||||
| 	 *  filemap_fdatawait() will encounter a ton of newly-dirtied pages |  | ||||||
| 	 *  (they were dirtied by commit).  But that's OK - the blocks are |  | ||||||
| 	 *  safe in-journal, which is all fsync() needs to ensure. |  | ||||||
| 	 */ | 	 */ | ||||||
| 	if (!sbi->s_journal) | 	if (!sbi->s_journal) | ||||||
| 		ret = ext4_fsync_nojournal(inode, datasync, &needs_barrier); | 		ret = ext4_fsync_nojournal(inode, datasync, &needs_barrier); | ||||||
| 	else if (ext4_should_journal_data(inode)) |  | ||||||
| 		ret = ext4_force_commit(inode->i_sb); |  | ||||||
| 	else | 	else | ||||||
| 		ret = ext4_fsync_journal(inode, datasync, &needs_barrier); | 		ret = ext4_fsync_journal(inode, datasync, &needs_barrier); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Jan Kara
						Jan Kara