st->ss->name);
goto abort_locked;
}
- if (!st->ss->add_internal_bitmap(st, &s->bitmap_chunk,
- c->delay, s->write_behind,
- bitmapsize, 1, major_num)) {
+ if (st->ss->add_internal_bitmap(st, &s->bitmap_chunk,
+ c->delay, s->write_behind,
+ bitmapsize, 1, major_num)) {
pr_err("Given bitmap chunk size not supported.\n");
goto abort_locked;
}
continue;
rv = st->ss->load_super(st, fd2, NULL);
if (!rv) {
- if (st->ss->add_internal_bitmap(
+ if (!st->ss->add_internal_bitmap(
st, &s->bitmap_chunk, c->delay,
s->write_behind, bitmapsize,
offset_setable, major))
* created, in which case data_size may be updated, or it might
* already exist. Metadata handler can know if init_super
* has been called, but not write_init_super.
+ * 0: Success
+ * -Exxxx: On error
*/
int (*add_internal_bitmap)(struct supertype *st, int *chunkp,
int delay, int write_behind,
if (chunk < 64*1024*1024)
chunk = 64*1024*1024;
} else if ((unsigned long long)chunk < min_chunk)
- return 0; /* chunk size too small */
+ return -EINVAL; /* chunk size too small */
sb->state |= (1<<MD_SB_BITMAP_PRESENT);
bms->sync_size = __cpu_to_le64(size);
bms->write_behind = __cpu_to_le32(write_behind);
*chunkp = chunk;
- return 1;
+ return 0;
}
static int locate_bitmap0(struct supertype *st, int fd, int node_num)
}
break;
default:
- return 0;
+ return -ENOSPC;
}
room -= bbl_size;
if (room <= 1)
/* No room for a bitmap */
- return 0;
+ return -ENOSPC;
max_bits = (room * 512 - sizeof(bitmap_super_t)) * 8;
if (chunk < 64*1024*1024)
chunk = 64*1024*1024;
} else if (chunk < min_chunk)
- return 0; /* chunk size too small */
+ return -EINVAL; /* chunk size too small */
if (chunk == 0) /* rounding problem */
- return 0;
+ return -EINVAL;
if (offset == 0) {
/* start bitmap on a 4K boundary with enough space for
}
*chunkp = chunk;
- return 1;
+ return 0;
}
static int locate_bitmap1(struct supertype *st, int fd, int node_num)