mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	btrfs: remove unused parameter from readahead_tree_block
The parent_transid parameter has been unused since its introduction in
ca7a79ad8d ("Pass down the expected generation number when reading
tree blocks").  In reada_tree_block, it was even wrongly set to leafsize.
Transid check is done in the proper read and readahead ignores errors.
Signed-off-by: David Sterba <dsterba@suse.cz>
			
			
This commit is contained in:
		
							parent
							
								
									1d52c78afb
								
							
						
					
					
						commit
						58dc4ce432
					
				
					 5 changed files with 8 additions and 16 deletions
				
			
		| 
						 | 
					@ -2298,7 +2298,7 @@ static void reada_for_search(struct btrfs_root *root,
 | 
				
			||||||
		if ((search <= target && target - search <= 65536) ||
 | 
							if ((search <= target && target - search <= 65536) ||
 | 
				
			||||||
		    (search > target && search - target <= 65536)) {
 | 
							    (search > target && search - target <= 65536)) {
 | 
				
			||||||
			gen = btrfs_node_ptr_generation(node, nr);
 | 
								gen = btrfs_node_ptr_generation(node, nr);
 | 
				
			||||||
			readahead_tree_block(root, search, blocksize, gen);
 | 
								readahead_tree_block(root, search, blocksize);
 | 
				
			||||||
			nread += blocksize;
 | 
								nread += blocksize;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		nscan++;
 | 
							nscan++;
 | 
				
			||||||
| 
						 | 
					@ -2350,9 +2350,9 @@ static noinline void reada_for_balance(struct btrfs_root *root,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (block1)
 | 
						if (block1)
 | 
				
			||||||
		readahead_tree_block(root, block1, blocksize, 0);
 | 
							readahead_tree_block(root, block1, blocksize);
 | 
				
			||||||
	if (block2)
 | 
						if (block2)
 | 
				
			||||||
		readahead_tree_block(root, block2, blocksize, 0);
 | 
							readahead_tree_block(root, block2, blocksize);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1062,8 +1062,7 @@ static const struct address_space_operations btree_aops = {
 | 
				
			||||||
	.set_page_dirty = btree_set_page_dirty,
 | 
						.set_page_dirty = btree_set_page_dirty,
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int readahead_tree_block(struct btrfs_root *root, u64 bytenr, u32 blocksize,
 | 
					int readahead_tree_block(struct btrfs_root *root, u64 bytenr, u32 blocksize)
 | 
				
			||||||
			 u64 parent_transid)
 | 
					 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct extent_buffer *buf = NULL;
 | 
						struct extent_buffer *buf = NULL;
 | 
				
			||||||
	struct inode *btree_inode = root->fs_info->btree_inode;
 | 
						struct inode *btree_inode = root->fs_info->btree_inode;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -46,8 +46,7 @@ struct btrfs_fs_devices;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct extent_buffer *read_tree_block(struct btrfs_root *root, u64 bytenr,
 | 
					struct extent_buffer *read_tree_block(struct btrfs_root *root, u64 bytenr,
 | 
				
			||||||
				      u32 blocksize, u64 parent_transid);
 | 
									      u32 blocksize, u64 parent_transid);
 | 
				
			||||||
int readahead_tree_block(struct btrfs_root *root, u64 bytenr, u32 blocksize,
 | 
					int readahead_tree_block(struct btrfs_root *root, u64 bytenr, u32 blocksize);
 | 
				
			||||||
			 u64 parent_transid);
 | 
					 | 
				
			||||||
int reada_tree_block_flagged(struct btrfs_root *root, u64 bytenr, u32 blocksize,
 | 
					int reada_tree_block_flagged(struct btrfs_root *root, u64 bytenr, u32 blocksize,
 | 
				
			||||||
			 int mirror_num, struct extent_buffer **eb);
 | 
								 int mirror_num, struct extent_buffer **eb);
 | 
				
			||||||
struct extent_buffer *btrfs_find_create_tree_block(struct btrfs_root *root,
 | 
					struct extent_buffer *btrfs_find_create_tree_block(struct btrfs_root *root,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7486,8 +7486,7 @@ static noinline void reada_walk_down(struct btrfs_trans_handle *trans,
 | 
				
			||||||
				continue;
 | 
									continue;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
reada:
 | 
					reada:
 | 
				
			||||||
		ret = readahead_tree_block(root, bytenr, blocksize,
 | 
							ret = readahead_tree_block(root, bytenr, blocksize);
 | 
				
			||||||
					   generation);
 | 
					 | 
				
			||||||
		if (ret)
 | 
							if (ret)
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		nread++;
 | 
							nread++;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2861,13 +2861,8 @@ static int reada_tree_block(struct reloc_control *rc,
 | 
				
			||||||
			    struct tree_block *block)
 | 
								    struct tree_block *block)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	BUG_ON(block->key_ready);
 | 
						BUG_ON(block->key_ready);
 | 
				
			||||||
	if (block->key.type == BTRFS_METADATA_ITEM_KEY)
 | 
						readahead_tree_block(rc->extent_root, block->bytenr,
 | 
				
			||||||
		readahead_tree_block(rc->extent_root, block->bytenr,
 | 
								block->key.objectid);
 | 
				
			||||||
				     block->key.objectid,
 | 
					 | 
				
			||||||
				     rc->extent_root->nodesize);
 | 
					 | 
				
			||||||
	else
 | 
					 | 
				
			||||||
		readahead_tree_block(rc->extent_root, block->bytenr,
 | 
					 | 
				
			||||||
				     block->key.objectid, block->key.offset);
 | 
					 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue