mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-01 00:58:39 +02:00 
			
		
		
		
	btrfs: Make btrfs_pin_extent_for_log_replay take transaction handle
Preparation for refactoring pinned extents tracking. Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
		
							parent
							
								
									7bfc100705
								
							
						
					
					
						commit
						9fce570454
					
				
					 3 changed files with 5 additions and 5 deletions
				
			
		|  | @ -2465,7 +2465,7 @@ int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans, | ||||||
| 			     u64 offset, int metadata, u64 *refs, u64 *flags); | 			     u64 offset, int metadata, u64 *refs, u64 *flags); | ||||||
| int btrfs_pin_extent(struct btrfs_trans_handle *trans, u64 bytenr, u64 num, | int btrfs_pin_extent(struct btrfs_trans_handle *trans, u64 bytenr, u64 num, | ||||||
| 		     int reserved); | 		     int reserved); | ||||||
| int btrfs_pin_extent_for_log_replay(struct btrfs_fs_info *fs_info, | int btrfs_pin_extent_for_log_replay(struct btrfs_trans_handle *trans, | ||||||
| 				    u64 bytenr, u64 num_bytes); | 				    u64 bytenr, u64 num_bytes); | ||||||
| int btrfs_exclude_logged_extents(struct extent_buffer *eb); | int btrfs_exclude_logged_extents(struct extent_buffer *eb); | ||||||
| int btrfs_cross_ref_exist(struct btrfs_root *root, | int btrfs_cross_ref_exist(struct btrfs_root *root, | ||||||
|  |  | ||||||
|  | @ -2626,13 +2626,13 @@ int btrfs_pin_extent(struct btrfs_trans_handle *trans, | ||||||
| /*
 | /*
 | ||||||
|  * this function must be called within transaction |  * this function must be called within transaction | ||||||
|  */ |  */ | ||||||
| int btrfs_pin_extent_for_log_replay(struct btrfs_fs_info *fs_info, | int btrfs_pin_extent_for_log_replay(struct btrfs_trans_handle *trans, | ||||||
| 				    u64 bytenr, u64 num_bytes) | 				    u64 bytenr, u64 num_bytes) | ||||||
| { | { | ||||||
| 	struct btrfs_block_group *cache; | 	struct btrfs_block_group *cache; | ||||||
| 	int ret; | 	int ret; | ||||||
| 
 | 
 | ||||||
| 	cache = btrfs_lookup_block_group(fs_info, bytenr); | 	cache = btrfs_lookup_block_group(trans->fs_info, bytenr); | ||||||
| 	if (!cache) | 	if (!cache) | ||||||
| 		return -EINVAL; | 		return -EINVAL; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -313,7 +313,7 @@ static int process_one_buffer(struct btrfs_root *log, | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	if (wc->pin) | 	if (wc->pin) | ||||||
| 		ret = btrfs_pin_extent_for_log_replay(fs_info, eb->start, | 		ret = btrfs_pin_extent_for_log_replay(wc->trans, eb->start, | ||||||
| 						      eb->len); | 						      eb->len); | ||||||
| 
 | 
 | ||||||
| 	if (!ret && btrfs_buffer_uptodate(eb, gen, 0)) { | 	if (!ret && btrfs_buffer_uptodate(eb, gen, 0)) { | ||||||
|  | @ -6189,7 +6189,7 @@ int btrfs_recover_log_trees(struct btrfs_root *log_root_tree) | ||||||
| 			 * each subsequent pass. | 			 * each subsequent pass. | ||||||
| 			 */ | 			 */ | ||||||
| 			if (ret == -ENOENT) | 			if (ret == -ENOENT) | ||||||
| 				ret = btrfs_pin_extent_for_log_replay(fs_info, | 				ret = btrfs_pin_extent_for_log_replay(trans, | ||||||
| 							log->node->start, | 							log->node->start, | ||||||
| 							log->node->len); | 							log->node->len); | ||||||
| 			free_extent_buffer(log->node); | 			free_extent_buffer(log->node); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Nikolay Borisov
						Nikolay Borisov