From 7ef02d01432952ee677beca7b0f90b653b3d336b Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Wed, 29 Mar 2006 02:57:48 +0000 Subject: Support 'bitmap=' in mdadm.conf for auto-assembling arrays with write-intent bitmaps in separate files. Signed-off-by: Neil Brown --- Assemble.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'Assemble.c') 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; -- cgit