#define MAX_CHECKER_MSG_SIZE 256
enum checkers {
- CHECKER_RESERVED,
+ CHECKER_UNDEF,
TUR,
READSECTOR0,
EMC_CLARIION,
buff = set_value(strvec);
if (!strncmp(buff, "manual", 6))
- conf->pgfailback = FAILBACK_MANUAL;
+ conf->pgfailback = -FAILBACK_MANUAL;
else if (!strncmp(buff, "immediate", 9))
- conf->pgfailback = FAILBACK_IMMEDIATE;
+ conf->pgfailback = -FAILBACK_IMMEDIATE;
else
conf->pgfailback = atoi(buff);
buff = set_value(strvec);
if (!strncmp(buff, "manual", 6))
- hwe->pgfailback = FAILBACK_MANUAL;
+ hwe->pgfailback = -FAILBACK_MANUAL;
else if (!strncmp(buff, "immediate", 9))
- hwe->pgfailback = FAILBACK_IMMEDIATE;
+ hwe->pgfailback = -FAILBACK_IMMEDIATE;
else
hwe->pgfailback = atoi(buff);
buff = set_value(strvec);
if (!strncmp(buff, "manual", 6))
- mpe->pgfailback = FAILBACK_MANUAL;
+ mpe->pgfailback = -FAILBACK_MANUAL;
else if (!strncmp(buff, "immediate", 9))
- mpe->pgfailback = FAILBACK_IMMEDIATE;
+ mpe->pgfailback = -FAILBACK_IMMEDIATE;
else
mpe->pgfailback = atoi(buff);
char attr_path[FILE_NAME_SIZE];
char attr_buff[FILE_NAME_SIZE];
- curpath->bus = SYSFS_BUS_NONE;
+ curpath->bus = SYSFS_BUS_UNDEF;
/*
* This is ugly : we should be able to do a simple
if (common_sysfs_pathinfo(curpath))
return 1;
- if (curpath->bus == SYSFS_BUS_NONE)
+ if (curpath->bus == SYSFS_BUS_UNDEF)
return 0;
else if (curpath->bus == SYSFS_BUS_SCSI)
if (scsi_sysfs_pathinfo(curpath))
pgp->status = PGSTATE_ENABLED;
break;
default:
- pgp->status = PGSTATE_RESERVED;
+ pgp->status = PGSTATE_UNDEF;
break;
}
FREE(word);
/* Storage controlers capabilities */
enum iopolicies {
- IOPOLICY_RESERVED,
+ IOPOLICY_UNDEF,
FAILOVER,
MULTIBUS,
GROUP_BY_SERIAL,
mp->pgfailback);
return 0;
}
- mp->pgfailback = FAILBACK_MANUAL;
+ mp->pgfailback = -FAILBACK_MANUAL;
condlog(3, "pgfailover = %i (internal default)", mp->pgfailback);
return 0;
}
#define SCSI_PRODUCT_SIZE 17
#define SCSI_REV_SIZE 5
-#define KEEP_PATHS 0
-#define FREE_PATHS 1
+enum free_path_switch {
+ KEEP_PATHS,
+ FREE_PATHS
+};
-#define FAILBACK_UNDEF 0
-#define FAILBACK_MANUAL -1
-#define FAILBACK_IMMEDIATE -2
+enum failback_mode {
+ FAILBACK_UNDEF,
+ FAILBACK_MANUAL,
+ FAILBACK_IMMEDIATE
+};
-#define SYSFS_BUS_NONE 0
-#define SYSFS_BUS_SCSI 1
-#define SYSFS_BUS_IDE 2
+enum sysfs_buses {
+ SYSFS_BUS_UNDEF,
+ SYSFS_BUS_SCSI,
+ SYSFS_BUS_IDE
+};
enum pathstates {
- PSTATE_RESERVED,
+ PSTATE_UNDEF,
PSTATE_FAILED,
PSTATE_ACTIVE
};
enum pgstates {
- PGSTATE_RESERVED,
+ PGSTATE_UNDEF,
PGSTATE_ENABLED,
PGSTATE_DISABLED,
PGSTATE_ACTIVE
/*
* don't bother if a constituant path is claimed
- * FIXME : claimed detection broken, always unclaimed for now
*/
vector_foreach_slot (mpp->paths, pp, i) {
if (pp->claimed) {
struct path * pp;
int i, j;
- if (!mpp || mpp->pgfailback == FAILBACK_MANUAL)
+ if (!mpp || mpp->pgfailback == -FAILBACK_MANUAL)
return;
/*
* Refresh path priority values
pp->mpp->failback_tick =
pp->mpp->pgfailback;
- if (pp->mpp->pgfailback == FAILBACK_IMMEDIATE)
+ if (pp->mpp->pgfailback == -FAILBACK_IMMEDIATE)
switch_pathgroup(pp->mpp);
/*