Change some numeric #defines to enums

This commit is contained in:
Greg Lehey 1998-11-02 04:11:16 +00:00
parent 8b71433847
commit c51cd25e95
2 changed files with 22 additions and 24 deletions

View File

@ -33,7 +33,7 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
* $Id: vinumvar.h,v 1.15 1998/08/14 06:36:41 grog Exp grog $
* $Id: vinumvar.h,v 1.16 1998/10/26 05:50:43 grog Exp grog $
*/
/* XXX gdb can't find our global pointers, so use this kludge to
@ -45,8 +45,7 @@
/* Some configuration maxima. They're an enum because
* we can't define global constants. Sorry about that.
*
* These aren't as bad as they look: most of them
* are soft limits. Only the MAXCONFIG parameter is set in stone
* These aren't as bad as they look: most of them are soft limits.
*/
enum constants {
@ -77,6 +76,14 @@ enum constants {
VINUM_SD_WIDTH = 8,
MAJORDEV_SHIFT = 8,
MAXPLEX = 8, /* maximum number of plexes in a volume */
MAXSD = 256, /* maximum number of subdisks in a plex */
MAXDRIVENAME = 32, /* maximum length of a device name */
MAXSDNAME = 64, /* maximum length of a subdisk name */
MAXPLEXNAME = 64, /* maximum length of a plex name */
MAXVOLNAME = 64, /* maximum length of a volume name */
MAXNAME = 64, /* maximum length of any name */
/* Create a block device number */
#define VINUMBDEV(v,p,s,t) ((BDEV_MAJOR << MAJORDEV_SHIFT) \
@ -126,6 +133,7 @@ enum constants {
PLEX_REGION_TABLE_SIZE = 8, /* number of entries in plex region tables */
INITIAL_LOCKS = 8, /* number of locks to allocate to a volume */
DEFAULT_REVIVE_BLOCKSIZE = 32768, /* size of block to transfer in one op */
VINUMHOSTNAMELEN = 32, /* host name field in label */
};
/* device numbers */
@ -159,12 +167,6 @@ struct devcode {
#define VINUM_DIR "/dev/vinum"
#define VINUM_RDIR "/dev/rvinum"
#define VINUM_SUPERDEV_NAME VINUM_DIR"/control"
#define MAXDRIVENAME 32 /* maximum length of a device name */
#define MAXSDNAME 64 /* maximum length of a subdisk name */
#define MAXPLEXNAME 64 /* maximum length of a plex name */
#define MAXVOLNAME 64 /* maximum length of a volume name */
#define MAXNAME 64 /* maximum length of any name */
#define MAXVOLPLEX 8 /* maximum number of plexes in a volume */
/* Flags for all objects. Most of them only apply to
* specific objects, but we have space for all in any
@ -260,7 +262,6 @@ enum {
* multiple copies in vinum. We use the host name just
* to identify this system, and 32 bytes should be ample
* for that purpose */
#define VINUMHOSTNAMELEN 32
struct vinum_label {
char sysname[VINUMHOSTNAMELEN]; /* system name at time of creation */
@ -401,8 +402,6 @@ struct plex {
/*** Volume definitions ***/
#define MAXPLEX 8 /* maximum number of plexes */
struct volume {
enum volumestate state; /* current state */

View File

@ -33,7 +33,7 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
* $Id: vinumvar.h,v 1.15 1998/08/14 06:36:41 grog Exp grog $
* $Id: vinumvar.h,v 1.16 1998/10/26 05:50:43 grog Exp grog $
*/
/* XXX gdb can't find our global pointers, so use this kludge to
@ -45,8 +45,7 @@
/* Some configuration maxima. They're an enum because
* we can't define global constants. Sorry about that.
*
* These aren't as bad as they look: most of them
* are soft limits. Only the MAXCONFIG parameter is set in stone
* These aren't as bad as they look: most of them are soft limits.
*/
enum constants {
@ -77,6 +76,14 @@ enum constants {
VINUM_SD_WIDTH = 8,
MAJORDEV_SHIFT = 8,
MAXPLEX = 8, /* maximum number of plexes in a volume */
MAXSD = 256, /* maximum number of subdisks in a plex */
MAXDRIVENAME = 32, /* maximum length of a device name */
MAXSDNAME = 64, /* maximum length of a subdisk name */
MAXPLEXNAME = 64, /* maximum length of a plex name */
MAXVOLNAME = 64, /* maximum length of a volume name */
MAXNAME = 64, /* maximum length of any name */
/* Create a block device number */
#define VINUMBDEV(v,p,s,t) ((BDEV_MAJOR << MAJORDEV_SHIFT) \
@ -126,6 +133,7 @@ enum constants {
PLEX_REGION_TABLE_SIZE = 8, /* number of entries in plex region tables */
INITIAL_LOCKS = 8, /* number of locks to allocate to a volume */
DEFAULT_REVIVE_BLOCKSIZE = 32768, /* size of block to transfer in one op */
VINUMHOSTNAMELEN = 32, /* host name field in label */
};
/* device numbers */
@ -159,12 +167,6 @@ struct devcode {
#define VINUM_DIR "/dev/vinum"
#define VINUM_RDIR "/dev/rvinum"
#define VINUM_SUPERDEV_NAME VINUM_DIR"/control"
#define MAXDRIVENAME 32 /* maximum length of a device name */
#define MAXSDNAME 64 /* maximum length of a subdisk name */
#define MAXPLEXNAME 64 /* maximum length of a plex name */
#define MAXVOLNAME 64 /* maximum length of a volume name */
#define MAXNAME 64 /* maximum length of any name */
#define MAXVOLPLEX 8 /* maximum number of plexes in a volume */
/* Flags for all objects. Most of them only apply to
* specific objects, but we have space for all in any
@ -260,7 +262,6 @@ enum {
* multiple copies in vinum. We use the host name just
* to identify this system, and 32 bytes should be ample
* for that purpose */
#define VINUMHOSTNAMELEN 32
struct vinum_label {
char sysname[VINUMHOSTNAMELEN]; /* system name at time of creation */
@ -401,8 +402,6 @@ struct plex {
/*** Volume definitions ***/
#define MAXPLEX 8 /* maximum number of plexes */
struct volume {
enum volumestate state; /* current state */