summaryrefslogtreecommitdiff
path: root/Grow.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-07-09 17:22:12 +1000
committerNeilBrown <neilb@suse.de>2012-07-09 17:22:12 +1000
commit50f01ba5a1b5a006937d02864d03261eedaf5a9e (patch)
tree7137bb5aa81f084d65e9accbb21eba808c417693 /Grow.c
parent32754b7d8474b34fc5ab0e629e43f30e3a50d408 (diff)
Use new struct context and struct shape for Grow_addbitmap
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Grow.c')
-rw-r--r--Grow.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/Grow.c b/Grow.c
index 0edeb014..d13b7f3b 100644
--- a/Grow.c
+++ b/Grow.c
@@ -265,7 +265,7 @@ int Grow_Add_device(char *devname, int fd, char *newdev)
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
@@ -300,7 +300,7 @@ int Grow_addbitmap(char *devname, int fd, char *file, int chunk, int delay, int
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);
@@ -317,7 +317,7 @@ int Grow_addbitmap(char *devname, int fd, char *file, int chunk, int delay, int
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");
@@ -330,7 +330,7 @@ int Grow_addbitmap(char *devname, int fd, char *file, int chunk, int delay, int
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;
}
@@ -370,7 +370,7 @@ int Grow_addbitmap(char *devname, int fd, char *file, int chunk, int delay, int
free(st);
return 1;
}
- if (strcmp(file, "internal") == 0) {
+ if (strcmp(s->bitmap_file, "internal") == 0) {
int rv;
int d;
int offset_setable = 0;
@@ -402,7 +402,7 @@ int Grow_addbitmap(char *devname, int fd, char *file, int chunk, int delay, int
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)
)
@@ -466,14 +466,14 @@ int Grow_addbitmap(char *devname, int fd, char *file, int chunk, int delay, int
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) {