From 0461008991aa12bd677bf448809fe214be13d8d9 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sun, 8 Jan 2017 15:28:17 -0800 Subject: [PATCH] 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. --- sim_disk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sim_disk.c b/sim_disk.c index ee3fc230..6f22c8c8 100644 --- a/sim_disk.c +++ b/sim_disk.c @@ -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))); }