mirror of
				https://github.com/torvalds/linux.git
				synced 2025-10-31 08:38:45 +02:00 
			
		
		
		
	ext4: cleanup clean_bdev_aliases() calls
Now, we have already handle all cases of forgetting buffer in jbd2_journal_forget(), the buffer should not be mapped to blockdevice when reallocating it. So this patch remove all clean_bdev_aliases() and clean_bdev_bh_alias() calls which were invoked by ext4 explicitly. Suggested-by: Jan Kara <jack@suse.cz> Signed-off-by: zhangyi (F) <yi.zhang@huawei.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Jan Kara <jack@suse.cz>
This commit is contained in:
		
							parent
							
								
									597599268e
								
							
						
					
					
						commit
						16e08b14a4
					
				
					 3 changed files with 2 additions and 21 deletions
				
			
		|  | @ -4048,18 +4048,8 @@ ext4_ext_handle_unwritten_extents(handle_t *handle, struct inode *inode, | ||||||
| 	} else | 	} else | ||||||
| 		allocated = ret; | 		allocated = ret; | ||||||
| 	map->m_flags |= EXT4_MAP_NEW; | 	map->m_flags |= EXT4_MAP_NEW; | ||||||
| 	/*
 | 	if (allocated > map->m_len) | ||||||
| 	 * if we allocated more blocks than requested |  | ||||||
| 	 * we need to make sure we unmap the extra block |  | ||||||
| 	 * allocated. The actual needed block will get |  | ||||||
| 	 * unmapped later when we find the buffer_head marked |  | ||||||
| 	 * new. |  | ||||||
| 	 */ |  | ||||||
| 	if (allocated > map->m_len) { |  | ||||||
| 		clean_bdev_aliases(inode->i_sb->s_bdev, newblock + map->m_len, |  | ||||||
| 				   allocated - map->m_len); |  | ||||||
| 		allocated = map->m_len; | 		allocated = map->m_len; | ||||||
| 	} |  | ||||||
| 	map->m_len = allocated; | 	map->m_len = allocated; | ||||||
| 
 | 
 | ||||||
| map_out: | map_out: | ||||||
|  |  | ||||||
|  | @ -678,8 +678,6 @@ int ext4_map_blocks(handle_t *handle, struct inode *inode, | ||||||
| 		if (flags & EXT4_GET_BLOCKS_ZERO && | 		if (flags & EXT4_GET_BLOCKS_ZERO && | ||||||
| 		    map->m_flags & EXT4_MAP_MAPPED && | 		    map->m_flags & EXT4_MAP_MAPPED && | ||||||
| 		    map->m_flags & EXT4_MAP_NEW) { | 		    map->m_flags & EXT4_MAP_NEW) { | ||||||
| 			clean_bdev_aliases(inode->i_sb->s_bdev, map->m_pblk, |  | ||||||
| 					   map->m_len); |  | ||||||
| 			ret = ext4_issue_zeroout(inode, map->m_lblk, | 			ret = ext4_issue_zeroout(inode, map->m_lblk, | ||||||
| 						 map->m_pblk, map->m_len); | 						 map->m_pblk, map->m_len); | ||||||
| 			if (ret) { | 			if (ret) { | ||||||
|  | @ -1194,7 +1192,6 @@ static int ext4_block_write_begin(struct page *page, loff_t pos, unsigned len, | ||||||
| 			if (err) | 			if (err) | ||||||
| 				break; | 				break; | ||||||
| 			if (buffer_new(bh)) { | 			if (buffer_new(bh)) { | ||||||
| 				clean_bdev_bh_alias(bh); |  | ||||||
| 				if (PageUptodate(page)) { | 				if (PageUptodate(page)) { | ||||||
| 					clear_buffer_new(bh); | 					clear_buffer_new(bh); | ||||||
| 					set_buffer_uptodate(bh); | 					set_buffer_uptodate(bh); | ||||||
|  | @ -2490,10 +2487,6 @@ static int mpage_map_one_extent(handle_t *handle, struct mpage_da_data *mpd) | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	BUG_ON(map->m_len == 0); | 	BUG_ON(map->m_len == 0); | ||||||
| 	if (map->m_flags & EXT4_MAP_NEW) { |  | ||||||
| 		clean_bdev_aliases(inode->i_sb->s_bdev, map->m_pblk, |  | ||||||
| 				   map->m_len); |  | ||||||
| 	} |  | ||||||
| 	return 0; | 	return 0; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -467,10 +467,8 @@ int ext4_bio_write_page(struct ext4_io_submit *io, | ||||||
| 				ext4_io_submit(io); | 				ext4_io_submit(io); | ||||||
| 			continue; | 			continue; | ||||||
| 		} | 		} | ||||||
| 		if (buffer_new(bh)) { | 		if (buffer_new(bh)) | ||||||
| 			clear_buffer_new(bh); | 			clear_buffer_new(bh); | ||||||
| 			clean_bdev_bh_alias(bh); |  | ||||||
| 		} |  | ||||||
| 		set_buffer_async_write(bh); | 		set_buffer_async_write(bh); | ||||||
| 		nr_to_submit++; | 		nr_to_submit++; | ||||||
| 	} while ((bh = bh->b_this_page) != head); | 	} while ((bh = bh->b_this_page) != head); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 zhangyi (F)
						zhangyi (F)