Re: [PATCH v5 2/2] btrfs: get device pointer from btrfs_scan_one_device

2018-07-17 Thread David Sterba
On Tue, Jul 17, 2018 at 12:54:00PM +0800, Anand Jain wrote: > > :: > > >>> @@ -1561,12 +1564,15 @@ static struct dentry *btrfs_mount_root(struct > >>> file_system_type *fs_type, > >>> goto error_fs_info; > >>> } > >>> > >>> - error =

Re: [PATCH v5 2/2] btrfs: get device pointer from btrfs_scan_one_device

2018-07-17 Thread David Sterba
On Tue, Jul 17, 2018 at 01:08:34AM +, Gu, Jinxiang wrote: > > > - device = device_list_add(path, disk_super, _device_added); > > > - if (IS_ERR(device)) { > > > - ret = PTR_ERR(device); > > > - } else { > > > - *fs_devices_ret = device->fs_devices; > > > - if

Re: [PATCH v5 2/2] btrfs: get device pointer from btrfs_scan_one_device

2018-07-16 Thread Anand Jain
:: @@ -1561,12 +1564,15 @@ static struct dentry *btrfs_mount_root(struct file_system_type *fs_type, goto error_fs_info; } - error = btrfs_scan_one_device(device_name, mode, fs_type, _devices); - if (error) { + device =

RE: [PATCH v5 2/2] btrfs: get device pointer from btrfs_scan_one_device

2018-07-16 Thread Gu, Jinxiang
> -Original Message- > From: David Sterba [mailto:dste...@suse.cz] > Sent: Monday, July 16, 2018 8:34 PM > To: Gu, Jinxiang/顾 金香 > Cc: linux-btrfs@vger.kernel.org; anand.j...@oracle.com > Subject: Re: [PATCH v5 2/2] btrfs: get device pointer from > btrfs_scan_o

Re: [PATCH v5 2/2] btrfs: get device pointer from btrfs_scan_one_device

2018-07-16 Thread David Sterba
On Mon, Jul 16, 2018 at 05:11:17PM +0800, Gu Jinxiang wrote: > Instead of pointer to btrfs_fs_devices as an arg in > btrfs_scan_one_device, better to make it as a return value. > > And since btrfs_fs_devices can be get by btrfs_device, > better to return btrfs_device than fs_btrfs_devices. > >

[PATCH v5 2/2] btrfs: get device pointer from btrfs_scan_one_device

2018-07-16 Thread Gu Jinxiang
Instead of pointer to btrfs_fs_devices as an arg in btrfs_scan_one_device, better to make it as a return value. And since btrfs_fs_devices can be get by btrfs_device, better to return btrfs_device than fs_btrfs_devices. Signed-off-by: Gu Jinxiang --- Changelog: v5: rebase to misc-next. v4: as