diff options
author | Neil Brown <neilb@suse.de> | 2006-03-29 02:57:48 +0000 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2006-03-29 02:57:48 +0000 |
commit | 7ef02d01432952ee677beca7b0f90b653b3d336b (patch) | |
tree | a3288a38053ede6c2a24051f53cb115f3a1813cb /Assemble.c | |
parent | 2ae555c3d97336365063b5f6937646818667c482 (diff) | |
download | mdadm-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.c | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -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; |