grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/1] btrfs: add support for new raid1c34 profiles


From: Daniel Kiper
Subject: Re: [PATCH 1/1] btrfs: add support for new raid1c34 profiles
Date: Tue, 5 Nov 2019 13:18:41 +0100
User-agent: NeoMutt/20170113 (1.7.2)

On Mon, Nov 04, 2019 at 05:23:22PM +0100, David Sterba wrote:
> There are new 3- and 4-copy variants of RAID1, estimated to be merged to
> kernel 5.5. Add the two new profiles to the list of recognized ones. As
> this builds on the same code as RAID1, only the redundancy level needs
> to be adjusted, the rest is done by the existing code.
>
> Signed-off-by: David Sterba <address@hidden>

Reviewed-by: Daniel Kiper <address@hidden> but I will apply it
if patches are in Linux kernel 5.5 (or later). So, please drop me a line
when it happens.

Daniel

> ---
>  grub-core/fs/btrfs.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c
> index 48bd3d04a5e6..66e301b3f13c 100644
> --- a/grub-core/fs/btrfs.c
> +++ b/grub-core/fs/btrfs.c
> @@ -136,6 +136,8 @@ struct grub_btrfs_chunk_item
>  #define GRUB_BTRFS_CHUNK_TYPE_RAID10        0x40
>  #define GRUB_BTRFS_CHUNK_TYPE_RAID5         0x80
>  #define GRUB_BTRFS_CHUNK_TYPE_RAID6         0x100
> +#define GRUB_BTRFS_CHUNK_TYPE_RAID1C3       0x200
> +#define GRUB_BTRFS_CHUNK_TYPE_RAID1C4       0x400
>    grub_uint8_t dummy2[0xc];
>    grub_uint16_t nstripes;
>    grub_uint16_t nsubstripes;
> @@ -964,14 +966,20 @@ grub_btrfs_read_logical (struct grub_btrfs_data *data, 
> grub_disk_addr_t addr,
>             csize = (stripen + 1) * stripe_length - off;
>             break;
>           }
> +       case GRUB_BTRFS_CHUNK_TYPE_RAID1C4:
> +         redundancy++;
> +         /* fall through */
> +       case GRUB_BTRFS_CHUNK_TYPE_RAID1C3:
> +         redundancy++;
> +         /* fall through */
>         case GRUB_BTRFS_CHUNK_TYPE_DUPLICATED:
>         case GRUB_BTRFS_CHUNK_TYPE_RAID1:
>           {
> -           grub_dprintf ("btrfs", "RAID1\n");
> +           redundancy++;
> +           grub_dprintf ("btrfs", "RAID1 (copies: %d)\n", redundancy);
>             stripen = 0;
>             stripe_offset = off;
>             csize = grub_le_to_cpu64 (chunk->size) - off;
> -           redundancy = 2;
>             break;
>           }
>         case GRUB_BTRFS_CHUNK_TYPE_RAID0:
> --
> 2.23.0



reply via email to

[Prev in Thread] Current Thread [Next in Thread]