linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Goffredo Baroncelli <kreijack@libero.it>
To: David Sterba <dsterba@suse.cz>
Cc: linux-btrfs@vger.kernel.org, Goffredo Baroncelli <kreijack@inwind.it>
Subject: [PATCH] btrfs: add support for RAID1C3 and RAID1C4
Date: Mon,  2 Dec 2019 19:19:28 +0100	[thread overview]
Message-ID: <20191202181928.3098-2-kreijack@libero.it> (raw)
In-Reply-To: <20191202181928.3098-1-kreijack@libero.it>

From: Goffredo Baroncelli <kreijack@inwind.it>

Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
---
 grub-core/fs/btrfs.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c
index 48bd3d04a..191c5cd63 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;
@@ -1088,6 +1090,24 @@ grub_btrfs_read_logical (struct grub_btrfs_data *data, grub_disk_addr_t addr,
 	      stripe_offset = chunk_stripe_length * high + low;
 	      csize = chunk_stripe_length - low;
 
+	      break;
+	    }
+	  case GRUB_BTRFS_CHUNK_TYPE_RAID1C3:
+	    {
+	      grub_dprintf ("btrfs", "RAID1C3\n");
+	      stripen = 0;
+	      stripe_offset = off;
+	      csize = grub_le_to_cpu64 (chunk->size) - off;
+	      redundancy = 3;
+	      break;
+	    }
+	  case GRUB_BTRFS_CHUNK_TYPE_RAID1C4:
+	    {
+	      grub_dprintf ("btrfs", "RAID1C4\n");
+	      stripen = 0;
+	      stripe_offset = off;
+	      csize = grub_le_to_cpu64 (chunk->size) - off;
+	      redundancy = 4;
 	      break;
 	    }
 	  default:
-- 
2.24.0


  reply	other threads:[~2019-12-02 18:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-02 18:19 [RFC] GRUB: add support for RAID1C3 and RAID1C4 Goffredo Baroncelli
2019-12-02 18:19 ` Goffredo Baroncelli [this message]
2019-12-03 13:23 ` David Sterba
2019-12-03 17:30   ` Goffredo Baroncelli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191202181928.3098-2-kreijack@libero.it \
    --to=kreijack@libero.it \
    --cc=dsterba@suse.cz \
    --cc=kreijack@inwind.it \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).