diff mbox

[6/7] btrfs: remove redundant parameter from reada_start_machine_dev

Message ID f8008e872818951e0f38474c6871e9e7e8a671ac.1489593696.git.dsterba@suse.com (mailing list archive)
State New, archived
Headers show

Commit Message

David Sterba March 15, 2017, 4:02 p.m. UTC
We can read fs_info from dev.

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/reada.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Liu Bo March 20, 2017, 9:04 p.m. UTC | #1
On Wed, Mar 15, 2017 at 05:02:39PM +0100, David Sterba wrote:
> We can read fs_info from dev.
> 
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>

Thanks,

-liubo
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/reada.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/btrfs/reada.c b/fs/btrfs/reada.c
> index c1fc79cd4b2a..91df381a60ce 100644
> --- a/fs/btrfs/reada.c
> +++ b/fs/btrfs/reada.c
> @@ -649,9 +649,9 @@ static int reada_pick_zone(struct btrfs_device *dev)
>  	return 1;
>  }
>  
> -static int reada_start_machine_dev(struct btrfs_fs_info *fs_info,
> -				   struct btrfs_device *dev)
> +static int reada_start_machine_dev(struct btrfs_device *dev)
>  {
> +	struct btrfs_fs_info *fs_info = dev->fs_info;
>  	struct reada_extent *re = NULL;
>  	int mirror_num = 0;
>  	struct extent_buffer *eb = NULL;
> @@ -763,8 +763,7 @@ static void __reada_start_machine(struct btrfs_fs_info *fs_info)
>  		list_for_each_entry(device, &fs_devices->devices, dev_list) {
>  			if (atomic_read(&device->reada_in_flight) <
>  			    MAX_IN_FLIGHT)
> -				enqueued += reada_start_machine_dev(fs_info,
> -								    device);
> +				enqueued += reada_start_machine_dev(device);
>  		}
>  		mutex_unlock(&fs_devices->device_list_mutex);
>  		total += enqueued;
> -- 
> 2.12.0
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/btrfs/reada.c b/fs/btrfs/reada.c
index c1fc79cd4b2a..91df381a60ce 100644
--- a/fs/btrfs/reada.c
+++ b/fs/btrfs/reada.c
@@ -649,9 +649,9 @@  static int reada_pick_zone(struct btrfs_device *dev)
 	return 1;
 }
 
-static int reada_start_machine_dev(struct btrfs_fs_info *fs_info,
-				   struct btrfs_device *dev)
+static int reada_start_machine_dev(struct btrfs_device *dev)
 {
+	struct btrfs_fs_info *fs_info = dev->fs_info;
 	struct reada_extent *re = NULL;
 	int mirror_num = 0;
 	struct extent_buffer *eb = NULL;
@@ -763,8 +763,7 @@  static void __reada_start_machine(struct btrfs_fs_info *fs_info)
 		list_for_each_entry(device, &fs_devices->devices, dev_list) {
 			if (atomic_read(&device->reada_in_flight) <
 			    MAX_IN_FLIGHT)
-				enqueued += reada_start_machine_dev(fs_info,
-								    device);
+				enqueued += reada_start_machine_dev(device);
 		}
 		mutex_unlock(&fs_devices->device_list_mutex);
 		total += enqueued;