mirror of
				https://github.com/torvalds/linux.git
				synced 2025-10-31 16:48:26 +02:00 
			
		
		
		
	btrfs: scrub: remove more unused functions
These functions are defined in the scrub.c file, but last callers were
removed in e9255d6c40 ("btrfs: scrub: remove the old scrub recheck
code").
fs/btrfs/scrub.c:553:20: warning: unused function 'scrub_stripe_index_and_offset'.
fs/btrfs/scrub.c:543:19: warning: unused function 'scrub_nr_raid_mirrors'.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4937
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
			
			
This commit is contained in:
		
							parent
							
								
									b7f9945a14
								
							
						
					
					
						commit
						b9cb105e73
					
				
					 1 changed files with 0 additions and 42 deletions
				
			
		|  | @ -552,48 +552,6 @@ static void scrub_print_common_warning(const char *errstr, struct btrfs_device * | |||
| 	btrfs_free_path(path); | ||||
| } | ||||
| 
 | ||||
| static inline int scrub_nr_raid_mirrors(struct btrfs_io_context *bioc) | ||||
| { | ||||
| 	if (bioc->map_type & BTRFS_BLOCK_GROUP_RAID5) | ||||
| 		return 2; | ||||
| 	else if (bioc->map_type & BTRFS_BLOCK_GROUP_RAID6) | ||||
| 		return 3; | ||||
| 	else | ||||
| 		return (int)bioc->num_stripes; | ||||
| } | ||||
| 
 | ||||
| static inline void scrub_stripe_index_and_offset(u64 logical, u64 map_type, | ||||
| 						 u64 full_stripe_logical, | ||||
| 						 int nstripes, int mirror, | ||||
| 						 int *stripe_index, | ||||
| 						 u64 *stripe_offset) | ||||
| { | ||||
| 	int i; | ||||
| 
 | ||||
| 	if (map_type & BTRFS_BLOCK_GROUP_RAID56_MASK) { | ||||
| 		const int nr_data_stripes = (map_type & BTRFS_BLOCK_GROUP_RAID5) ? | ||||
| 					    nstripes - 1 : nstripes - 2; | ||||
| 
 | ||||
| 		/* RAID5/6 */ | ||||
| 		for (i = 0; i < nr_data_stripes; i++) { | ||||
| 			const u64 data_stripe_start = full_stripe_logical + | ||||
| 						(i * BTRFS_STRIPE_LEN); | ||||
| 
 | ||||
| 			if (logical >= data_stripe_start && | ||||
| 			    logical < data_stripe_start + BTRFS_STRIPE_LEN) | ||||
| 				break; | ||||
| 		} | ||||
| 
 | ||||
| 		*stripe_index = i; | ||||
| 		*stripe_offset = (logical - full_stripe_logical) & | ||||
| 				 BTRFS_STRIPE_LEN_MASK; | ||||
| 	} else { | ||||
| 		/* The other RAID type */ | ||||
| 		*stripe_index = mirror; | ||||
| 		*stripe_offset = 0; | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| static int fill_writer_pointer_gap(struct scrub_ctx *sctx, u64 physical) | ||||
| { | ||||
| 	int ret = 0; | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Jiapeng Chong
						Jiapeng Chong