From: Jakub Radtke <jakub.radtke@linux.intel.com>
To: jes@trained-monkey.org
Cc: linux-raid@vger.kernel.org
Subject: [PATCH 2/8] Enable bitmap support for external metadata
Date: Fri, 15 Jan 2021 00:46:55 -0500 [thread overview]
Message-ID: <20210115054701.92064-3-jakub.radtke@linux.intel.com> (raw)
In-Reply-To: <20210115054701.92064-1-jakub.radtke@linux.intel.com>
From: Jakub Radtke <jakub.radtke@intel.com>
The patch enables the implementation of a write-intent bitmap for external
metadata.
Configuration of the internal bitmaps for non-native metadata requires the
extension in superswitch to perform an additional sysfs setup before the
array is activated.
Change-Id: I77be689b9f4f815dd00bb14ef52267686b273fb5
Signed-off-by: Jakub Radtke <jakub.radtke@intel.com>
---
Assemble.c | 6 ++++++
Create.c | 10 ++++++++++
mdadm.h | 3 +++
3 files changed, 19 insertions(+)
diff --git a/Assemble.c b/Assemble.c
index ed0ddfb1..479ff5ec 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -2094,6 +2094,12 @@ int assemble_container_content(struct supertype *st, int mdfd,
}
}
+ /* Before activating the array, perform extra steps required to configure the internal
+ * write-intent bitmap.
+ */
+ if (content->consistency_policy == CONSISTENCY_POLICY_BITMAP &&
+ st->ss->set_bitmap)
+ st->ss->set_bitmap(st, content);
if (start_reshape) {
int spare = content->array.raid_disks + expansion;
diff --git a/Create.c b/Create.c
index 51f8826b..751f18c1 100644
--- a/Create.c
+++ b/Create.c
@@ -989,6 +989,16 @@ int Create(struct supertype *st, char *mddev,
st->ss->free_super(st);
goto abort_locked;
}
+ /* Before activating the array, perform extra steps required
+ * to configure the internal write-intent bitmap.
+ */
+ if (info_new.consistency_policy ==
+ CONSISTENCY_POLICY_BITMAP &&
+ st->ss->set_bitmap &&
+ st->ss->set_bitmap(st, &info)) {
+ st->ss->free_super(st);
+ goto abort_locked;
+ }
/* update parent container uuid */
if (me) {
diff --git a/mdadm.h b/mdadm.h
index 1ee6c92e..0cf94239 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -1006,6 +1006,9 @@ extern struct superswitch {
int (*add_internal_bitmap)(struct supertype *st, int *chunkp,
int delay, int write_behind,
unsigned long long size, int may_change, int major);
+ /* Perform additional setup required to activate a bitmap.
+ */
+ int (*set_bitmap)(struct supertype *st, struct mdinfo *info);
/* Seek 'fd' to start of write-intent-bitmap. Must be an
* md-native format bitmap
*/
--
2.26.2
next prev parent reply other threads:[~2021-01-15 13:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-15 5:46 [PATCH 0/8] Write-intent bitmap support for IMSM metadata Jakub Radtke
2021-01-15 5:46 ` [PATCH 1/8] Modify mdstat parsing for volumes with the bitmap Jakub Radtke
2021-01-15 5:46 ` Jakub Radtke [this message]
2021-01-15 5:46 ` [PATCH 3/8] imsm: Write-intent bitmap support Jakub Radtke
2021-01-15 5:46 ` [PATCH 4/8] imsm: Adding a spare to an existing array with bitmap Jakub Radtke
2021-01-15 5:46 ` [PATCH 5/8] Add "bitmap" to allowed command-line values Jakub Radtke
2021-01-15 5:46 ` [PATCH 6/8] imsm: Update-subarray for write-intent bitmap Jakub Radtke
2021-01-15 5:47 ` [PATCH 7/8] Create: Block automatic enabling bitmap for external metadata Jakub Radtke
2021-01-15 5:47 ` [PATCH 8/8] Grow: Block reshape when external metadata and write-intent bitmap Jakub Radtke
2021-03-10 14:50 ` [PATCH 0/8] Write-intent bitmap support for IMSM metadata Jes Sorensen
-- strict thread matches above, loose matches on Subject: below --
2020-09-25 0:02 Jakub Radtke
2020-09-25 0:02 ` [PATCH 2/8] Enable bitmap support for external metadata Jakub Radtke
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=20210115054701.92064-3-jakub.radtke@linux.intel.com \
--to=jakub.radtke@linux.intel.com \
--cc=jes@trained-monkey.org \
--cc=linux-raid@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).