forked from mirrors/linux
		
	btrfs: btrfs_decompress_bio() could accept compressed_bio instead
Instead of sending each argument of struct compressed_bio, send the compressed_bio itself. Also by having struct compressed_bio in btrfs_decompress_bio() it would help tracing. Signed-off-by: Anand Jain <anand.jain@oracle.com> Reviewed-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
		
							parent
							
								
									d2006e6d28
								
							
						
					
					
						commit
						8140dc30a4
					
				
					 1 changed files with 9 additions and 14 deletions
				
			
		| 
						 | 
					@ -81,9 +81,7 @@ struct compressed_bio {
 | 
				
			||||||
	u32 sums;
 | 
						u32 sums;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int btrfs_decompress_bio(int type, struct page **pages_in,
 | 
					static int btrfs_decompress_bio(struct compressed_bio *cb);
 | 
				
			||||||
				   u64 disk_start, struct bio *orig_bio,
 | 
					 | 
				
			||||||
				   size_t srclen);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
static inline int compressed_bio_size(struct btrfs_fs_info *fs_info,
 | 
					static inline int compressed_bio_size(struct btrfs_fs_info *fs_info,
 | 
				
			||||||
				      unsigned long disk_size)
 | 
									      unsigned long disk_size)
 | 
				
			||||||
| 
						 | 
					@ -173,11 +171,8 @@ static void end_compressed_bio_read(struct bio *bio)
 | 
				
			||||||
	/* ok, we're the last bio for this extent, lets start
 | 
						/* ok, we're the last bio for this extent, lets start
 | 
				
			||||||
	 * the decompression.
 | 
						 * the decompression.
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	ret = btrfs_decompress_bio(cb->compress_type,
 | 
						ret = btrfs_decompress_bio(cb);
 | 
				
			||||||
				      cb->compressed_pages,
 | 
					
 | 
				
			||||||
				      cb->start,
 | 
					 | 
				
			||||||
				      cb->orig_bio,
 | 
					 | 
				
			||||||
				      cb->compressed_len);
 | 
					 | 
				
			||||||
csum_failed:
 | 
					csum_failed:
 | 
				
			||||||
	if (ret)
 | 
						if (ret)
 | 
				
			||||||
		cb->errors = 1;
 | 
							cb->errors = 1;
 | 
				
			||||||
| 
						 | 
					@ -961,18 +956,18 @@ int btrfs_compress_pages(int type, struct address_space *mapping,
 | 
				
			||||||
 * be contiguous.  They all correspond to the range of bytes covered by
 | 
					 * be contiguous.  They all correspond to the range of bytes covered by
 | 
				
			||||||
 * the compressed extent.
 | 
					 * the compressed extent.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
static int btrfs_decompress_bio(int type, struct page **pages_in,
 | 
					static int btrfs_decompress_bio(struct compressed_bio *cb)
 | 
				
			||||||
				   u64 disk_start, struct bio *orig_bio,
 | 
					 | 
				
			||||||
				   size_t srclen)
 | 
					 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct list_head *workspace;
 | 
						struct list_head *workspace;
 | 
				
			||||||
	int ret;
 | 
						int ret;
 | 
				
			||||||
 | 
						int type = cb->compress_type;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	workspace = find_workspace(type);
 | 
						workspace = find_workspace(type);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ret = btrfs_compress_op[type-1]->decompress_bio(workspace, pages_in,
 | 
						ret = btrfs_compress_op[type - 1]->decompress_bio(workspace,
 | 
				
			||||||
							 disk_start, orig_bio,
 | 
								cb->compressed_pages, cb->start, cb->orig_bio,
 | 
				
			||||||
							 srclen);
 | 
								cb->compressed_len);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	free_workspace(type, workspace);
 | 
						free_workspace(type, workspace);
 | 
				
			||||||
	return ret;
 | 
						return ret;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue