On Thu, Apr 16, 2020 at 02:26:08PM +0300, Nikolay Borisov wrote:
> Instead of returning both the page and the super block structure, make
> btrfs_read_disk_super just return a pointer to struct btrfs_disk_super.
> As a result the function signature is simplified.
>
> Signed-off-by: Nikolay Borisov <nborisov@xxxxxxxx>
Added to misc-next, thanks.
> @@ -1337,8 +1336,9 @@ struct btrfs_device *btrfs_scan_one_device(const char *path, fmode_t flags,
> if (IS_ERR(bdev))
> return ERR_CAST(bdev);
>
> - if (btrfs_read_disk_super(bdev, bytenr, &page, &disk_super)) {
> - device = ERR_PTR(-EINVAL);
> + disk_super = btrfs_read_disk_super(bdev, bytenr);
> + if (IS_ERR(disk_super)) {
> + device = disk_super;
With the ERR_CAST fixup.
> goto error_bdev_put;
> }
>
> --
> 2.17.1