Re: [PATCH 2/4] btrfs: let variable required be declared inside the loop

2017-11-15 Thread David Sterba
On Thu, Nov 09, 2017 at 05:53:58PM +0200, Nikolay Borisov wrote:
> On  9.11.2017 17:45, Anand Jain wrote:
> > A preparation patch to create the actual device open in a new function.
> Just say you are reducing the visibility of some variables to the loop.

This patch is IMHO too fine-grained and can be folded with the last one.
A preparatory change like this would make sense if there are some
non-obvious consequences, but here it's just moving the declaration
block to a new function, that was easy to review.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/4] btrfs: let variable required be declared inside the loop

2017-11-09 Thread Nikolay Borisov


On  9.11.2017 17:45, Anand Jain wrote:
> A preparation patch to create the actual device open in a new function.
> 

Just say you are reducing the visibility of some variables to the loop.

> Signed-off-by: Anand Jain 
> ---
>  fs/btrfs/volumes.c | 11 ++-
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
> index ab2f349ee293..ea6e542cb09d 100644
> --- a/fs/btrfs/volumes.c
> +++ b/fs/btrfs/volumes.c
> @@ -970,19 +970,20 @@ int btrfs_close_devices(struct btrfs_fs_devices 
> *fs_devices)
>  static int __btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
>   fmode_t flags, void *holder)
>  {
> - struct request_queue *q;
> - struct block_device *bdev;
>   struct list_head *head = _devices->devices;
>   struct btrfs_device *device;
>   struct btrfs_device *latest_dev = NULL;
> - struct buffer_head *bh;
> - struct btrfs_super_block *disk_super;
> - u64 devid;
>   int ret = 0;
>  
>   flags |= FMODE_EXCL;
>  
>   list_for_each_entry(device, head, dev_list) {
> + struct request_queue *q;
> + struct block_device *bdev;
> + struct buffer_head *bh;
> + struct btrfs_super_block *disk_super;
> + u64 devid;
> +
>   if (device->bdev)
>   continue;
>   if (!device->name)
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/4] btrfs: let variable required be declared inside the loop

2017-11-09 Thread Anand Jain
A preparation patch to create the actual device open in a new function.

Signed-off-by: Anand Jain 
---
 fs/btrfs/volumes.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index ab2f349ee293..ea6e542cb09d 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -970,19 +970,20 @@ int btrfs_close_devices(struct btrfs_fs_devices 
*fs_devices)
 static int __btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
fmode_t flags, void *holder)
 {
-   struct request_queue *q;
-   struct block_device *bdev;
struct list_head *head = _devices->devices;
struct btrfs_device *device;
struct btrfs_device *latest_dev = NULL;
-   struct buffer_head *bh;
-   struct btrfs_super_block *disk_super;
-   u64 devid;
int ret = 0;
 
flags |= FMODE_EXCL;
 
list_for_each_entry(device, head, dev_list) {
+   struct request_queue *q;
+   struct block_device *bdev;
+   struct buffer_head *bh;
+   struct btrfs_super_block *disk_super;
+   u64 devid;
+
if (device->bdev)
continue;
if (!device->name)
-- 
2.13.1

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html