From 3be9c7c33b3a20e4549f83c45a49e83f1a1668ba Mon Sep 17 00:00:00 2001 From: David van Moolenbroek Date: Fri, 8 Mar 2013 13:52:24 +0000 Subject: [PATCH] Rename "struct partition" to "struct part_geom" Change-Id: Ifaf9795ba70f5b933599b2a6ec9415e6bd13200c --- commands/autopart/autopart.c | 4 ++-- commands/devsize/devsize.c | 2 +- commands/fdisk/fdisk.c | 2 +- commands/part/part.c | 2 +- commands/partition/partition.c | 2 +- commands/repartition/repartition.c | 6 +++--- commands/vol/vol.c | 2 +- drivers/at_wini/at_wini.c | 4 ++-- drivers/filter/driver.c | 2 +- drivers/filter/main.c | 4 ++-- drivers/floppy/floppy.c | 4 ++-- drivers/virtio_blk/virtio_blk.c | 4 ++-- include/minix/blockdriver.h | 2 +- include/minix/partition.h | 2 +- include/sys/ioc_disk.h | 4 ++-- lib/libblockdriver/driver.c | 2 +- lib/libc/sys-minix/sizeup.c | 2 +- man/man4/controller.4 | 2 +- sys/sys/disklabel.h | 9 --------- test/blocktest/blocktest.c | 6 +++--- 20 files changed, 29 insertions(+), 38 deletions(-) diff --git a/commands/autopart/autopart.c b/commands/autopart/autopart.c index c6fd7112c..4d6a85cb0 100644 --- a/commands/autopart/autopart.c +++ b/commands/autopart/autopart.c @@ -501,7 +501,7 @@ void geometry(void) { struct stat dst; int err= 0; - struct partition geometry; + struct part_geom geometry; if (submerged) { /* Geometry already known. */ @@ -2123,7 +2123,7 @@ scribble_region(region_t *reg, struct part_entry **pe, int *made_new) int sanitycheck_failed(char *dev, struct part_entry *pe) { - struct partition part; + struct part_geom part; int fd; unsigned long it_lowsec, it_secsize; diff --git a/commands/devsize/devsize.c b/commands/devsize/devsize.c index a85d20821..9d8cbdfad 100644 --- a/commands/devsize/devsize.c +++ b/commands/devsize/devsize.c @@ -35,7 +35,7 @@ unsigned long sizeup(device) char *device; { int fd; - struct partition entry; + struct part_geom entry; unsigned long d; if ((fd = open(device, O_RDONLY)) == -1) { diff --git a/commands/fdisk/fdisk.c b/commands/fdisk/fdisk.c index c8fcaaeaa..4c237f27a 100644 --- a/commands/fdisk/fdisk.c +++ b/commands/fdisk/fdisk.c @@ -227,7 +227,7 @@ int main(int argc, char *argv[]) void getgeom(void) { - struct partition geom; + struct part_geom geom; int fd, r; if (override) return; diff --git a/commands/part/part.c b/commands/part/part.c index eba6496db..d141d8553 100644 --- a/commands/part/part.c +++ b/commands/part/part.c @@ -453,7 +453,7 @@ void geometry(void) { struct stat dst; int err= 0; - struct partition geometry; + struct part_geom geometry; if (submerged) { /* Geometry already known. */ diff --git a/commands/partition/partition.c b/commands/partition/partition.c index dac69cd71..a2d555b7e 100644 --- a/commands/partition/partition.c +++ b/commands/partition/partition.c @@ -285,7 +285,7 @@ void geometry(void) */ { int fd; - struct partition geometry; + struct part_geom geometry; struct stat sb; if ((fd= open(device, O_RDONLY)) < 0) fatal(device); diff --git a/commands/repartition/repartition.c b/commands/repartition/repartition.c index ba929f281..ace391b60 100644 --- a/commands/repartition/repartition.c +++ b/commands/repartition/repartition.c @@ -100,7 +100,7 @@ char *finddev(dev_t device) #define DSETP 0 #define DGETP 1 -int diocntl(dev_t device, int request, struct partition *entry) +int diocntl(dev_t device, int request, struct part_geom *entry) /* Get or set the geometry of a device. */ { char *name; @@ -115,7 +115,7 @@ int diocntl(dev_t device, int request, struct partition *entry) return r; } -struct partition geometry; /* Geometry of the device. */ +struct part_geom geometry; /* Geometry of the device. */ void print_chs(unsigned long sector) { @@ -154,7 +154,7 @@ void show_part(char *name, unsigned long base, unsigned long size) int main(int argc, char **argv) { struct stat hdst; - struct partition whole, entry; + struct part_geom whole, entry; struct part_entry table[4], *pe; int drive, par = 0, device, incr; int partf; diff --git a/commands/vol/vol.c b/commands/vol/vol.c index ebede7900..43264912b 100644 --- a/commands/vol/vol.c +++ b/commands/vol/vol.c @@ -66,7 +66,7 @@ char *argv[]; int volume = 1, fd, tty, i, init, autovolsize; char *p, *name; struct stat stb; - struct partition part; + struct part_geom part; char key; /* Fetch and verify the arguments. */ diff --git a/drivers/at_wini/at_wini.c b/drivers/at_wini/at_wini.c index 6e1f1fb86..e59dbbd10 100644 --- a/drivers/at_wini/at_wini.c +++ b/drivers/at_wini/at_wini.c @@ -166,7 +166,7 @@ static void w_intr_wait(void); static int at_intr_wait(void); static int w_waitfor(int mask, int value); static int w_waitfor_dma(int mask, int value); -static void w_geometry(dev_t minor, struct partition *entry); +static void w_geometry(dev_t minor, struct part_geom *entry); #if ENABLE_ATAPI static int atapi_sendpacket(u8_t *packet, unsigned cnt, int do_dma); static int atapi_intr_wait(int dma, size_t max); @@ -1869,7 +1869,7 @@ int value; /* required status */ /*===========================================================================* * w_geometry * *===========================================================================*/ -static void w_geometry(dev_t minor, struct partition *entry) +static void w_geometry(dev_t minor, struct part_geom *entry) { struct wini *wn; diff --git a/drivers/filter/driver.c b/drivers/filter/driver.c index e5c16dcbe..35464b10e 100644 --- a/drivers/filter/driver.c +++ b/drivers/filter/driver.c @@ -24,7 +24,7 @@ static int driver_open(int which) */ message msg; cp_grant_id_t gid; - struct partition part; + struct part_geom part; sector_t sectors; int r; diff --git a/drivers/filter/main.c b/drivers/filter/main.c index d2c966cd8..b825ed31c 100644 --- a/drivers/filter/main.c +++ b/drivers/filter/main.c @@ -241,7 +241,7 @@ static int do_vrdwt(int flag_rw) *===========================================================================*/ static int do_ioctl(message *m) { - struct partition sizepart; + struct part_geom sizepart; switch(m->BDEV_REQUEST) { case DIOCSETP: @@ -260,7 +260,7 @@ static int do_ioctl(message *m) if(sys_safecopyto(who_e, (vir_bytes) grant_id, 0, (vir_bytes) &sizepart, - sizeof(struct partition)) != OK) { + sizeof(struct part_geom)) != OK) { printf("Filter: DIOCGETP safecopyto failed\n"); return EIO; } diff --git a/drivers/floppy/floppy.c b/drivers/floppy/floppy.c index 2fb576c5f..1150837d2 100644 --- a/drivers/floppy/floppy.c +++ b/drivers/floppy/floppy.c @@ -261,7 +261,7 @@ static int read_id(void); static int f_do_open(dev_t minor, int access); static int f_do_close(dev_t minor); static int test_read(int density); -static void f_geometry(dev_t minor, struct partition *entry); +static void f_geometry(dev_t minor, struct part_geom *entry); /* Entry points to this driver. */ static struct blockdriver f_dtab = { @@ -1350,7 +1350,7 @@ static int test_read(int density) /*===========================================================================* * f_geometry * *===========================================================================*/ -static void f_geometry(dev_t minor, struct partition *entry) +static void f_geometry(dev_t minor, struct part_geom *entry) { if (f_prepare(minor) == NULL) return; diff --git a/drivers/virtio_blk/virtio_blk.c b/drivers/virtio_blk/virtio_blk.c index f62fd3253..cc1b7d069 100644 --- a/drivers/virtio_blk/virtio_blk.c +++ b/drivers/virtio_blk/virtio_blk.c @@ -86,7 +86,7 @@ static ssize_t virtio_blk_transfer(dev_t minor, int write, u64_t position, static int virtio_blk_ioctl(dev_t minor, unsigned int req, endpoint_t endpt, cp_grant_id_t grant); static struct device * virtio_blk_part(dev_t minor); -static void virtio_blk_geometry(dev_t minor, struct partition *entry); +static void virtio_blk_geometry(dev_t minor, struct part_geom *entry); static void virtio_blk_device_intr(void); static void virtio_blk_spurious_intr(void); static void virtio_blk_intr(unsigned int irqs); @@ -422,7 +422,7 @@ virtio_blk_part(dev_t minor) } static void -virtio_blk_geometry(dev_t minor, struct partition *entry) +virtio_blk_geometry(dev_t minor, struct part_geom *entry) { /* Only for the drive */ if (minor != 0) diff --git a/include/minix/blockdriver.h b/include/minix/blockdriver.h index 10da49b18..6d28265ee 100644 --- a/include/minix/blockdriver.h +++ b/include/minix/blockdriver.h @@ -23,7 +23,7 @@ struct blockdriver { cp_grant_id_t grant); void(*bdr_cleanup) (void); struct device *(*bdr_part)(dev_t minor); - void(*bdr_geometry) (dev_t minor, struct partition *part); + void(*bdr_geometry) (dev_t minor, struct part_geom *part); void(*bdr_intr) (unsigned int irqs); void(*bdr_alarm) (clock_t stamp); int(*bdr_other) (message *m_ptr); diff --git a/include/minix/partition.h b/include/minix/partition.h index 21f743d70..2e9b431d0 100644 --- a/include/minix/partition.h +++ b/include/minix/partition.h @@ -12,7 +12,7 @@ int minix_sizeup(char *name, u64_t *bytes); -struct partition { +struct part_geom { u64_t base; /* byte offset to the partition start */ u64_t size; /* number of bytes in the partition */ unsigned cylinders; /* disk geometry */ diff --git a/include/sys/ioc_disk.h b/include/sys/ioc_disk.h index aa2085d57..f899c4ddf 100644 --- a/include/sys/ioc_disk.h +++ b/include/sys/ioc_disk.h @@ -8,8 +8,8 @@ #include -#define DIOCSETP _IOW('d', 3, struct partition) -#define DIOCGETP _IOR('d', 4, struct partition) +#define DIOCSETP _IOW('d', 3, struct part_geom) +#define DIOCGETP _IOR('d', 4, struct part_geom) #define DIOCEJECT _IO ('d', 5) #define DIOCTIMEOUT _IORW('d', 6, int) #define DIOCOPENCT _IOR('d', 7, int) diff --git a/lib/libblockdriver/driver.c b/lib/libblockdriver/driver.c index 479c20dbf..f45b11552 100644 --- a/lib/libblockdriver/driver.c +++ b/lib/libblockdriver/driver.c @@ -262,7 +262,7 @@ static int do_dioctl(struct blockdriver *bdp, dev_t minor, { /* Carry out a disk-specific I/O control request. */ struct device *dv; - struct partition entry; + struct part_geom entry; int r = EINVAL; switch (request) { diff --git a/lib/libc/sys-minix/sizeup.c b/lib/libc/sys-minix/sizeup.c index ea843075a..abf5323d2 100644 --- a/lib/libc/sys-minix/sizeup.c +++ b/lib/libc/sys-minix/sizeup.c @@ -29,7 +29,7 @@ char *device; u64_t *bytes; { int fd; - struct partition entry; + struct part_geom entry; struct stat st; if ((fd = open(device, O_RDONLY)) == -1) { diff --git a/man/man4/controller.4 b/man/man4/controller.4 index a556377a4..66fa6251c 100644 --- a/man/man4/controller.4 +++ b/man/man4/controller.4 @@ -154,7 +154,7 @@ a partition. This is what looks like: .sp .nf .ta +2n +25n -struct partition { +struct part_geom { u64_t base; /* byte offset to the partition start */ u64_t size; /* number of bytes in the partition */ unsigned cylinders; /* disk geometry for partitioning */ diff --git a/sys/sys/disklabel.h b/sys/sys/disklabel.h index 1e6db347d..42e38f73d 100644 --- a/sys/sys/disklabel.h +++ b/sys/sys/disklabel.h @@ -41,10 +41,6 @@ #include #endif -#if defined(__minix) && !defined(_STANDALONE) -#include -#endif - /* * Each disk has a label which includes information about the hardware * disk geometry, filesystem partitions, and drive specific information. @@ -184,10 +180,6 @@ struct disklabel { uint16_t d_npartitions; /* number of partitions in following */ uint32_t d_bbsize; /* size of boot area at sn0, bytes */ uint32_t d_sbsize; /* max size of fs superblock, bytes */ -#if defined(__minix) && !defined(_STANDALONE) - struct partition /* the partition table */ - d_partitions[MAXPARTITIONS]; /* actually may be more */ -#else struct partition { /* the partition table */ uint32_t p_size; /* number of sectors in partition */ uint32_t p_offset; /* starting sector */ @@ -207,7 +199,6 @@ struct disklabel { #define p_cpg __partition_u1.cpg #define p_sgs __partition_u1.sgs } d_partitions[MAXPARTITIONS]; /* actually may be more */ -#endif /* defined(__minix) */ }; #if defined(__HAVE_OLD_DISKLABEL) && !HAVE_NBTOOL_CONFIG_H diff --git a/test/blocktest/blocktest.c b/test/blocktest/blocktest.c index 8f2299ef5..dc87f0f7e 100644 --- a/test/blocktest/blocktest.c +++ b/test/blocktest/blocktest.c @@ -39,7 +39,7 @@ static int max_size = 131072; /* maximum total size of any req */ * it to a value lower than the driver supports. */ -static struct partition part; /* base and size of target partition */ +static struct part_geom part; /* base and size of target partition */ #define NR_OPENED 10 /* maximum number of opened devices */ static dev_t opened[NR_OPENED]; /* list of currently opened devices */ @@ -1426,7 +1426,7 @@ static void vir_limits(dev_t sub0_minor, dev_t sub1_minor, int part_secs) /* Create virtual, temporary subpartitions through the DIOCSETP ioctl, * and perform tests on the resulting subpartitions. */ - struct partition subpart, subpart2; + struct part_geom subpart, subpart2; size_t sub_size; result_t res; @@ -1495,7 +1495,7 @@ static void real_limits(dev_t sub0_minor, dev_t sub1_minor, int part_secs) */ u8_t *buf_ptr; size_t buf_size, sub_size; - struct partition subpart; + struct part_geom subpart; struct part_entry *entry; result_t res;