return 0;
}
-int Grow_addbitmap(char *devname, int fd, char *file, int chunk, int delay, int write_behind, int force)
+int Grow_addbitmap(char *devname, int fd, struct context *c, struct shape *s)
{
/*
* First check that array doesn't have a bitmap
return 1;
}
if (bmf.pathname[0]) {
- if (strcmp(file,"none")==0) {
+ if (strcmp(s->bitmap_file,"none")==0) {
if (ioctl(fd, SET_BITMAP_FILE, -1)!= 0) {
pr_err("failed to remove bitmap %s\n",
bmf.pathname);
return 1;
}
if (array.state & (1<<MD_SB_BITMAP_PRESENT)) {
- if (strcmp(file, "none")==0) {
+ if (strcmp(s->bitmap_file, "none")==0) {
array.state &= ~(1<<MD_SB_BITMAP_PRESENT);
if (ioctl(fd, SET_ARRAY_INFO, &array)!= 0) {
pr_err("failed to remove internal bitmap.\n");
return 1;
}
- if (strcmp(file, "none") == 0) {
+ if (strcmp(s->bitmap_file, "none") == 0) {
pr_err("no bitmap found on %s\n", devname);
return 1;
}
free(st);
return 1;
}
- if (strcmp(file, "internal") == 0) {
+ if (strcmp(s->bitmap_file, "internal") == 0) {
int rv;
int d;
int offset_setable = 0;
if (st->ss->load_super(st, fd2, NULL)==0) {
if (st->ss->add_internal_bitmap(
st,
- &chunk, delay, write_behind,
+ &s->bitmap_chunk, c->delay, s->write_behind,
bitmapsize, offset_setable,
major)
)
pr_err("cannot find UUID for array!\n");
return 1;
}
- if (CreateBitmap(file, force, (char*)uuid, chunk,
- delay, write_behind, bitmapsize, major)) {
+ if (CreateBitmap(s->bitmap_file, c->force, (char*)uuid, s->bitmap_chunk,
+ c->delay, s->write_behind, bitmapsize, major)) {
return 1;
}
- bitmap_fd = open(file, O_RDWR);
+ bitmap_fd = open(s->bitmap_file, O_RDWR);
if (bitmap_fd < 0) {
pr_err("weird: %s cannot be opened\n",
- file);
+ s->bitmap_file);
return 1;
}
if (ioctl(fd, SET_BITMAP_FILE, bitmap_fd) < 0) {
}
if (c.delay == 0)
c.delay = DEFAULT_BITMAP_DELAY;
- rv = Grow_addbitmap(devlist->devname, mdfd, s.bitmap_file,
- s.bitmap_chunk, c.delay, s.write_behind, c.force);
+ rv = Grow_addbitmap(devlist->devname, mdfd, &c, &s);
} else if (grow_continue)
rv = Grow_continue_command(devlist->devname,
mdfd, c.backup_file,
char *update, int force);
extern int autodetect(void);
extern int Grow_Add_device(char *devname, int fd, char *newdev);
-extern int Grow_addbitmap(char *devname, int fd, char *file, int chunk, int delay, int write_behind, int force);
+extern int Grow_addbitmap(char *devname, int fd,
+ struct context *c, struct shape *s);
extern int Grow_reshape(char *devname, int fd,
struct mddev_dev *devlist,
struct context *c, struct shape *s);