DISK: Always autosize disk to exactly the size of known file system data

Previously, disk capacity was increased if the drive was smaller than the
contained file system(s).  Now the drive capacity will be increased or
decreased to reflect the contained file system(s) size.
This commit is contained in:
Mark Pizzolato 2017-01-08 15:28:17 -08:00
parent c70a1ba3df
commit 0461008991

View file

@ -1509,7 +1509,7 @@ if (capac && (capac != (t_offset)-1)) {
if ((filesystem_capac != (t_offset)-1) &&
(filesystem_capac > capac))
capac = filesystem_capac;
if ((capac > (((t_offset)uptr->capac)*ctx->capac_factor*((dptr->flags & DEV_SECTORS) ? 512 : 1))) ||
if ((capac != (((t_offset)uptr->capac)*ctx->capac_factor*((dptr->flags & DEV_SECTORS) ? 512 : 1))) ||
(DKUF_F_STD != DK_GET_FMT (uptr)))
uptr->capac = (t_addr)(capac/(ctx->capac_factor*((dptr->flags & DEV_SECTORS) ? 512 : 1)));
}