GB vs. MB

Harald Koenig (koenig@tat.physik.uni-tuebingen.de)
Mon, 25 Nov 1996 11:17:04 +0100 (MET)


I like the disk size message in sd.c but since 1MB == 1024*1024 == 2^20,
why is 1GB == 1000MB == 1000* 2^20 and not 1GB == 1024MB == 2^30 ?

I'd really like to see "real" GBs as 2^30 (which would be more consistent
but just the opposite from what all the disk vendors think a GB is
(or should be ;-))

Harald
-------------------------------------------------------------------------------
--- /soft/linux/drivers/scsi/sd.c Wed Apr 17 10:51:59 1996
+++ linux/drivers/scsi/sd.c Thu Apr 18 10:16:45 1996
@@ -1170,7 +1170,7 @@
}
mb = rscsi_disks[i].capacity / 1024 * hard_sector / 1024;
/* sz = div(m/100, 10); this seems to not be in the libr */
- m = (mb + 50) / 100;
+ m = (mb*1000 + 51200) / 1024 / 100 ;
sz_quot = m / 10;
sz_rem = m - (10 * sz_quot);
printk ("SCSI device sd%c: hdwr sector= %d bytes."

--
All SCSI disks will from now on                     ___       _____
be required to send an email notice                0--,|    /OOOOOOO\
24 hours prior to complete hardware failure!      <_/  /  /OOOOOOOOOOO\
                                                    \  \/OOOOOOOOOOOOOOO\
                                                      \ OOOOOOOOOOOOOOOOO|//
Harald Koenig,                                         \/\/\/\/\/\/\/\/\/
Inst.f.Theoret.Astrophysik                              //  /     \\  \
koenig@tat.physik.uni-tuebingen.de                     ^^^^^       ^^^^^