summaryrefslogtreecommitdiffstats
path: root/Assemble.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2006-03-29 02:57:48 +0000
committerNeil Brown <neilb@suse.de>2006-03-29 02:57:48 +0000
commit7ef02d01432952ee677beca7b0f90b653b3d336b (patch)
treea3288a38053ede6c2a24051f53cb115f3a1813cb /Assemble.c
parent2ae555c3d97336365063b5f6937646818667c482 (diff)
downloadmdadm-7ef02d01432952ee677beca7b0f90b653b3d336b.tar.gz
mdadm-7ef02d01432952ee677beca7b0f90b653b3d336b.tar.xz
mdadm-7ef02d01432952ee677beca7b0f90b653b3d336b.zip
Support 'bitmap=' in mdadm.conf for auto-assembling arrays with write-intent bitmaps in separate files.
Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'Assemble.c')
-rw-r--r--Assemble.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/Assemble.c b/Assemble.c
index f38b1a1..a856456 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -623,8 +623,22 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
fprintf(stderr, Name ": SET_BITMAP_FILE failed.\n");
return 1;
}
+ } else if (ident->bitmap_file) {
+ /* From config file */
+ int bmfd = open(ident->bitmap_file, O_RDWR);
+ if (bmfd < 0) {
+ fprintf(stderr, Name ": Could not open bitmap file %s\n",
+ ident->bitmap_file);
+ return 1;
+ }
+ if (ioctl(mdfd, SET_BITMAP_FILE, bmfd) != 0) {
+ fprintf(stderr, Name ": Failed to set bitmapfile for %s\n", mddev);
+ close(bmfd);
+ return 1;
+ }
+ close(bmfd);
}
-
+
/* First, add the raid disks, but add the chosen one last */
for (i=0; i<= bestcnt; i++) {
int j;