struct phys_disk *pd;
struct virtual_disk *vd;
- if (data_offset != INVALID_SECTORS) {
- pr_err("data-offset not supported by DDF\n");
- return 0;
- }
-
if (st->sb)
return init_super_ddf_bvd(st, info, size, name, homehost, uuid,
data_offset);
#ifndef MDASSEMBLE
static void add_to_super_ddf_bvd(struct supertype *st,
- mdu_disk_info_t *dk, int fd, char *devname)
+ mdu_disk_info_t *dk, int fd, char *devname,
+ unsigned long long data_offset)
{
/* fd and devname identify a device within the ddf container (st).
* dk identifies a location in the new BVD.
if (ddf->currentconf->block_sizes)
blocks = ddf->currentconf->block_sizes[dk->raid_disk];
- pos = find_space(ddf, dl, INVALID_SECTORS, &blocks);
+ pos = find_space(ddf, dl, data_offset, &blocks);
if (pos == INVALID_SECTORS)
return;
__u32 *tptr;
if (ddf->currentconf) {
- add_to_super_ddf_bvd(st, dk, fd, devname);
+ add_to_super_ddf_bvd(st, dk, fd, devname, data_offset);
return 0;
}
static int reserve_space(struct supertype *st, int raiddisks,
unsigned long long size, int chunk,
+ unsigned long long data_offset,
unsigned long long *freesize)
{
/* Find 'raiddisks' spare extents at least 'size' big (but
for (dl = ddf->dlist ; dl ; dl=dl->next) {
unsigned long long minsize = ULLONG_MAX;
- find_space(ddf, dl, INVALID_SECTORS, &minsize);
+ find_space(ddf, dl, data_offset, &minsize);
if (minsize >= size && minsize >= (unsigned)chunk) {
cnt++;
dl->esize = minsize;
* chosen so that add_to_super/getinfo_super
* can return them.
*/
- return reserve_space(st, raiddisks, size, *chunk, freesize);
+ return reserve_space(st, raiddisks, size, *chunk,
+ data_offset, freesize);
}
return 1;
}
if (minsize == 0)
minsize = 8;
for (dl = ddf->dlist; dl ; dl = dl->next) {
- if (find_space(ddf, dl, INVALID_SECTORS, &minsize)
+ if (find_space(ddf, dl, data_offset, &minsize)
!= INVALID_SECTORS)
dcnt++;
}
return 0;
}
maxsize = ULLONG_MAX;
- find_space(ddf, dl, INVALID_SECTORS, &maxsize);
+ find_space(ddf, dl, data_offset, &maxsize);
*freesize = maxsize;
// FIXME here I am