Rename "struct partition" to "struct part_geom"

Change-Id: Ifaf9795ba70f5b933599b2a6ec9415e6bd13200c
This commit is contained in:
David van Moolenbroek 2013-03-08 13:52:24 +00:00
parent 32bef00fec
commit 3be9c7c33b
20 changed files with 29 additions and 38 deletions

View file

@ -501,7 +501,7 @@ void geometry(void)
{ {
struct stat dst; struct stat dst;
int err= 0; int err= 0;
struct partition geometry; struct part_geom geometry;
if (submerged) { if (submerged) {
/* Geometry already known. */ /* Geometry already known. */
@ -2123,7 +2123,7 @@ scribble_region(region_t *reg, struct part_entry **pe, int *made_new)
int int
sanitycheck_failed(char *dev, struct part_entry *pe) sanitycheck_failed(char *dev, struct part_entry *pe)
{ {
struct partition part; struct part_geom part;
int fd; int fd;
unsigned long it_lowsec, it_secsize; unsigned long it_lowsec, it_secsize;

View file

@ -35,7 +35,7 @@ unsigned long sizeup(device)
char *device; char *device;
{ {
int fd; int fd;
struct partition entry; struct part_geom entry;
unsigned long d; unsigned long d;
if ((fd = open(device, O_RDONLY)) == -1) { if ((fd = open(device, O_RDONLY)) == -1) {

View file

@ -227,7 +227,7 @@ int main(int argc, char *argv[])
void getgeom(void) void getgeom(void)
{ {
struct partition geom; struct part_geom geom;
int fd, r; int fd, r;
if (override) return; if (override) return;

View file

@ -453,7 +453,7 @@ void geometry(void)
{ {
struct stat dst; struct stat dst;
int err= 0; int err= 0;
struct partition geometry; struct part_geom geometry;
if (submerged) { if (submerged) {
/* Geometry already known. */ /* Geometry already known. */

View file

@ -285,7 +285,7 @@ void geometry(void)
*/ */
{ {
int fd; int fd;
struct partition geometry; struct part_geom geometry;
struct stat sb; struct stat sb;
if ((fd= open(device, O_RDONLY)) < 0) fatal(device); if ((fd= open(device, O_RDONLY)) < 0) fatal(device);

View file

@ -100,7 +100,7 @@ char *finddev(dev_t device)
#define DSETP 0 #define DSETP 0
#define DGETP 1 #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. */ /* Get or set the geometry of a device. */
{ {
char *name; char *name;
@ -115,7 +115,7 @@ int diocntl(dev_t device, int request, struct partition *entry)
return r; return r;
} }
struct partition geometry; /* Geometry of the device. */ struct part_geom geometry; /* Geometry of the device. */
void print_chs(unsigned long sector) 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) int main(int argc, char **argv)
{ {
struct stat hdst; struct stat hdst;
struct partition whole, entry; struct part_geom whole, entry;
struct part_entry table[4], *pe; struct part_entry table[4], *pe;
int drive, par = 0, device, incr; int drive, par = 0, device, incr;
int partf; int partf;

View file

@ -66,7 +66,7 @@ char *argv[];
int volume = 1, fd, tty, i, init, autovolsize; int volume = 1, fd, tty, i, init, autovolsize;
char *p, *name; char *p, *name;
struct stat stb; struct stat stb;
struct partition part; struct part_geom part;
char key; char key;
/* Fetch and verify the arguments. */ /* Fetch and verify the arguments. */

View file

@ -166,7 +166,7 @@ static void w_intr_wait(void);
static int at_intr_wait(void); static int at_intr_wait(void);
static int w_waitfor(int mask, int value); static int w_waitfor(int mask, int value);
static int w_waitfor_dma(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 #if ENABLE_ATAPI
static int atapi_sendpacket(u8_t *packet, unsigned cnt, int do_dma); static int atapi_sendpacket(u8_t *packet, unsigned cnt, int do_dma);
static int atapi_intr_wait(int dma, size_t max); static int atapi_intr_wait(int dma, size_t max);
@ -1869,7 +1869,7 @@ int value; /* required status */
/*===========================================================================* /*===========================================================================*
* w_geometry * * 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; struct wini *wn;

View file

@ -24,7 +24,7 @@ static int driver_open(int which)
*/ */
message msg; message msg;
cp_grant_id_t gid; cp_grant_id_t gid;
struct partition part; struct part_geom part;
sector_t sectors; sector_t sectors;
int r; int r;

View file

@ -241,7 +241,7 @@ static int do_vrdwt(int flag_rw)
*===========================================================================*/ *===========================================================================*/
static int do_ioctl(message *m) static int do_ioctl(message *m)
{ {
struct partition sizepart; struct part_geom sizepart;
switch(m->BDEV_REQUEST) { switch(m->BDEV_REQUEST) {
case DIOCSETP: case DIOCSETP:
@ -260,7 +260,7 @@ static int do_ioctl(message *m)
if(sys_safecopyto(who_e, (vir_bytes) grant_id, 0, if(sys_safecopyto(who_e, (vir_bytes) grant_id, 0,
(vir_bytes) &sizepart, (vir_bytes) &sizepart,
sizeof(struct partition)) != OK) { sizeof(struct part_geom)) != OK) {
printf("Filter: DIOCGETP safecopyto failed\n"); printf("Filter: DIOCGETP safecopyto failed\n");
return EIO; return EIO;
} }

View file

@ -261,7 +261,7 @@ static int read_id(void);
static int f_do_open(dev_t minor, int access); static int f_do_open(dev_t minor, int access);
static int f_do_close(dev_t minor); static int f_do_close(dev_t minor);
static int test_read(int density); 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. */ /* Entry points to this driver. */
static struct blockdriver f_dtab = { static struct blockdriver f_dtab = {
@ -1350,7 +1350,7 @@ static int test_read(int density)
/*===========================================================================* /*===========================================================================*
* f_geometry * * 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; if (f_prepare(minor) == NULL) return;

View file

@ -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, static int virtio_blk_ioctl(dev_t minor, unsigned int req, endpoint_t endpt,
cp_grant_id_t grant); cp_grant_id_t grant);
static struct device * virtio_blk_part(dev_t minor); 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_device_intr(void);
static void virtio_blk_spurious_intr(void); static void virtio_blk_spurious_intr(void);
static void virtio_blk_intr(unsigned int irqs); static void virtio_blk_intr(unsigned int irqs);
@ -422,7 +422,7 @@ virtio_blk_part(dev_t minor)
} }
static void 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 */ /* Only for the drive */
if (minor != 0) if (minor != 0)

View file

@ -23,7 +23,7 @@ struct blockdriver {
cp_grant_id_t grant); cp_grant_id_t grant);
void(*bdr_cleanup) (void); void(*bdr_cleanup) (void);
struct device *(*bdr_part)(dev_t minor); 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_intr) (unsigned int irqs);
void(*bdr_alarm) (clock_t stamp); void(*bdr_alarm) (clock_t stamp);
int(*bdr_other) (message *m_ptr); int(*bdr_other) (message *m_ptr);

View file

@ -12,7 +12,7 @@
int minix_sizeup(char *name, u64_t *bytes); int minix_sizeup(char *name, u64_t *bytes);
struct partition { struct part_geom {
u64_t base; /* byte offset to the partition start */ u64_t base; /* byte offset to the partition start */
u64_t size; /* number of bytes in the partition */ u64_t size; /* number of bytes in the partition */
unsigned cylinders; /* disk geometry */ unsigned cylinders; /* disk geometry */

View file

@ -8,8 +8,8 @@
#include <minix/ioctl.h> #include <minix/ioctl.h>
#define DIOCSETP _IOW('d', 3, struct partition) #define DIOCSETP _IOW('d', 3, struct part_geom)
#define DIOCGETP _IOR('d', 4, struct partition) #define DIOCGETP _IOR('d', 4, struct part_geom)
#define DIOCEJECT _IO ('d', 5) #define DIOCEJECT _IO ('d', 5)
#define DIOCTIMEOUT _IORW('d', 6, int) #define DIOCTIMEOUT _IORW('d', 6, int)
#define DIOCOPENCT _IOR('d', 7, int) #define DIOCOPENCT _IOR('d', 7, int)

View file

@ -262,7 +262,7 @@ static int do_dioctl(struct blockdriver *bdp, dev_t minor,
{ {
/* Carry out a disk-specific I/O control request. */ /* Carry out a disk-specific I/O control request. */
struct device *dv; struct device *dv;
struct partition entry; struct part_geom entry;
int r = EINVAL; int r = EINVAL;
switch (request) { switch (request) {

View file

@ -29,7 +29,7 @@ char *device;
u64_t *bytes; u64_t *bytes;
{ {
int fd; int fd;
struct partition entry; struct part_geom entry;
struct stat st; struct stat st;
if ((fd = open(device, O_RDONLY)) == -1) { if ((fd = open(device, O_RDONLY)) == -1) {

View file

@ -154,7 +154,7 @@ a partition. This is what <minix/partition.h> looks like:
.sp .sp
.nf .nf
.ta +2n +25n .ta +2n +25n
struct partition { struct part_geom {
u64_t base; /* byte offset to the partition start */ u64_t base; /* byte offset to the partition start */
u64_t size; /* number of bytes in the partition */ u64_t size; /* number of bytes in the partition */
unsigned cylinders; /* disk geometry for partitioning */ unsigned cylinders; /* disk geometry for partitioning */

View file

@ -41,10 +41,6 @@
#include <sys/types.h> #include <sys/types.h>
#endif #endif
#if defined(__minix) && !defined(_STANDALONE)
#include <minix/partition.h>
#endif
/* /*
* Each disk has a label which includes information about the hardware * Each disk has a label which includes information about the hardware
* disk geometry, filesystem partitions, and drive specific information. * disk geometry, filesystem partitions, and drive specific information.
@ -184,10 +180,6 @@ struct disklabel {
uint16_t d_npartitions; /* number of partitions in following */ uint16_t d_npartitions; /* number of partitions in following */
uint32_t d_bbsize; /* size of boot area at sn0, bytes */ uint32_t d_bbsize; /* size of boot area at sn0, bytes */
uint32_t d_sbsize; /* max size of fs superblock, 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 */ struct partition { /* the partition table */
uint32_t p_size; /* number of sectors in partition */ uint32_t p_size; /* number of sectors in partition */
uint32_t p_offset; /* starting sector */ uint32_t p_offset; /* starting sector */
@ -207,7 +199,6 @@ struct disklabel {
#define p_cpg __partition_u1.cpg #define p_cpg __partition_u1.cpg
#define p_sgs __partition_u1.sgs #define p_sgs __partition_u1.sgs
} d_partitions[MAXPARTITIONS]; /* actually may be more */ } d_partitions[MAXPARTITIONS]; /* actually may be more */
#endif /* defined(__minix) */
}; };
#if defined(__HAVE_OLD_DISKLABEL) && !HAVE_NBTOOL_CONFIG_H #if defined(__HAVE_OLD_DISKLABEL) && !HAVE_NBTOOL_CONFIG_H

View file

@ -39,7 +39,7 @@ static int max_size = 131072; /* maximum total size of any req */
* it to a value lower than the driver supports. * 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 */ #define NR_OPENED 10 /* maximum number of opened devices */
static dev_t opened[NR_OPENED]; /* list of currently 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, /* Create virtual, temporary subpartitions through the DIOCSETP ioctl,
* and perform tests on the resulting subpartitions. * and perform tests on the resulting subpartitions.
*/ */
struct partition subpart, subpart2; struct part_geom subpart, subpart2;
size_t sub_size; size_t sub_size;
result_t res; 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; u8_t *buf_ptr;
size_t buf_size, sub_size; size_t buf_size, sub_size;
struct partition subpart; struct part_geom subpart;
struct part_entry *entry; struct part_entry *entry;
result_t res; result_t res;