This commit is contained in:
rsc 2007-05-28 17:41:28 +00:00
parent 92a9bc24f9
commit dcb5580cf0

View file

@ -28,7 +28,9 @@ diskpartsync(Disk *dd)
{
DiskPart *d = (DiskPart*)dd;
return disksync(d->subdisk);
if(d->subdisk)
return disksync(d->subdisk);
return 0;
}
static void
@ -36,12 +38,13 @@ diskpartclose(Disk *dd)
{
DiskPart *d = (DiskPart*)dd;
diskclose(d->subdisk);
if(d->subdisk)
diskclose(d->subdisk);
free(d);
}
Disk*
diskpart(Disk *subdisk, u64int size, u64int offset)
diskpart(Disk *subdisk, u64int offset, u64int size)
{
DiskPart *d;
@ -58,3 +61,11 @@ diskpart(Disk *subdisk, u64int size, u64int offset)
return &d->disk;
}
void
diskpartabandon(Disk *d)
{
if(d->_read != diskpartread)
abort();
d->subdisk = nil;
}