summaryrefslogtreecommitdiff
path: root/sys/src/cmd/disk/prep/edit.h
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2016-01-05 03:57:50 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2016-01-05 03:57:50 +0100
commitdd8908cff003135095996d2b0b5ea250c615a0e2 (patch)
tree43116c12d2fed459913e988d44be898dd69bbdb5 /sys/src/cmd/disk/prep/edit.h
parent5aeddd6788347f121f1c6739a9954fe176fe539e (diff)
fdisk: properly convert byte units K,M,G and T to cylinders/sectors
the shared command language assumed 512 byte sectors, which is not the case for fdisk as it uses cylinders for the block unit. so we introduce an extra argument in the Edit structure and parseexpr() function so byte sizes are properly converted to the block unit when the K,M,G and T postfixes are used.
Diffstat (limited to 'sys/src/cmd/disk/prep/edit.h')
-rw-r--r--sys/src/cmd/disk/prep/edit.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/src/cmd/disk/prep/edit.h b/sys/src/cmd/disk/prep/edit.h
index 8751adc4f..29ef4e993 100644
--- a/sys/src/cmd/disk/prep/edit.h
+++ b/sys/src/cmd/disk/prep/edit.h
@@ -36,6 +36,7 @@ struct Edit {
void *aux;
vlong dot;
vlong end;
+ vlong unitsz;
/* do not use fields below this line */
int changed;
@@ -48,7 +49,7 @@ void runcmd(Edit*, char*);
Part *findpart(Edit*, char*);
char *addpart(Edit*, Part*);
char *delpart(Edit*, Part*);
-char *parseexpr(char *s, vlong xdot, vlong xdollar, vlong xsize, vlong *result);
+char *parseexpr(char *s, vlong xdot, vlong xdollar, vlong xsize, vlong xunit, vlong *result);
int ctldiff(Edit *edit, int ctlfd);
void *emalloc(ulong);
char *estrdup(char*);