mirror of
				https://github.com/torvalds/linux.git
				synced 2025-10-31 08:38:45 +02:00 
			
		
		
		
	btrfs: use bools for local variables at btrfs_clear_extent_bit_changeset()
Several variables are defined as integers but used as booleans, and the 'delete' variable can be made const since it's not changed after being declared. So change them to proper booleans and simplify setting their value. Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
		
							parent
							
								
									5af1eae78d
								
							
						
					
					
						commit
						c832378622
					
				
					 1 changed files with 5 additions and 6 deletions
				
			
		|  | @ -605,9 +605,9 @@ int btrfs_clear_extent_bit_changeset(struct extent_io_tree *tree, u64 start, u64 | |||
| 	struct extent_state *prealloc = NULL; | ||||
| 	u64 last_end; | ||||
| 	int ret = 0; | ||||
| 	int clear = 0; | ||||
| 	int wake; | ||||
| 	int delete = (bits & EXTENT_CLEAR_ALL_BITS); | ||||
| 	bool clear; | ||||
| 	bool wake; | ||||
| 	const bool delete = (bits & EXTENT_CLEAR_ALL_BITS); | ||||
| 	gfp_t mask; | ||||
| 
 | ||||
| 	set_gfp_mask_from_bits(&bits, &mask); | ||||
|  | @ -620,9 +620,8 @@ int btrfs_clear_extent_bit_changeset(struct extent_io_tree *tree, u64 start, u64 | |||
| 	if (bits & EXTENT_DELALLOC) | ||||
| 		bits |= EXTENT_NORESERVE; | ||||
| 
 | ||||
| 	wake = ((bits & EXTENT_LOCK_BITS) ? 1 : 0); | ||||
| 	if (bits & (EXTENT_LOCK_BITS | EXTENT_BOUNDARY)) | ||||
| 		clear = 1; | ||||
| 	wake = (bits & EXTENT_LOCK_BITS); | ||||
| 	clear = (bits & (EXTENT_LOCK_BITS | EXTENT_BOUNDARY)); | ||||
| again: | ||||
| 	if (!prealloc) { | ||||
| 		/*
 | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Filipe Manana
						Filipe Manana