Browse files

fcoe_utils: Rename fcoe_err to fcoe_status

Rename 'enum fcoe_err' to 'enum fcoe_status' and
change NOFAIL to SUCCESS in enum fcoe_err for
successful operations.

Signed-off-by: Robert Love <robert.w.love@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
  • Loading branch information...
1 parent f8d8486 commit 2952101a16c8b2b63fc411bb1488a69f8e520df9 Robert Love committed Feb 17, 2011
Showing with 54 additions and 54 deletions.
  1. +13 −13 fcoeadm.c
  2. +9 −9 fcoeadm_display.c
  3. +5 −5 fcoeadm_display.h
  4. +16 −16 fcoemon.c
  5. +5 −5 include/fcoe_utils.h
  6. +6 −6 lib/fcoe_utils.c
View
26 fcoeadm.c
@@ -65,10 +65,10 @@ static void fcoeadm_help(void)
"\t [-h|--help]\n\n", progname);
}
-static enum fcoe_err fcoeadm_clif_request(struct clif_sock_info *clif_info,
- const struct clif_data *cmd,
- size_t cmd_len, char *reply,
- size_t *reply_len)
+static enum fcoe_status fcoeadm_clif_request(struct clif_sock_info *clif_info,
+ const struct clif_data *cmd,
+ size_t cmd_len, char *reply,
+ size_t *reply_len)
{
struct timeval tv;
int ret;
@@ -95,15 +95,15 @@ static enum fcoe_err fcoeadm_clif_request(struct clif_sock_info *clif_info,
}
}
- return NOERR;
+ return SUCCESS;
}
-static enum fcoe_err fcoeadm_request(struct clif_sock_info *clif_info,
- struct clif_data *data)
+static enum fcoe_status fcoeadm_request(struct clif_sock_info *clif_info,
+ struct clif_data *data)
{
char rbuf[MAX_MSGBUF];
size_t len;
- int rc = NOERR;
+ int rc = SUCCESS;
/*
* TODO: This is odd that we read the response code back as a
@@ -131,9 +131,9 @@ static inline void fcoeadm_close_cli(struct clif_sock_info *clif_info)
/*
* Create fcoeadm client interface
*/
-static enum fcoe_err fcoeadm_open_cli(struct clif_sock_info *clif_info)
+static enum fcoe_status fcoeadm_open_cli(struct clif_sock_info *clif_info)
{
- enum fcoe_err rc = NOERR;
+ enum fcoe_status rc = SUCCESS;
clif_info->socket_fd = socket(PF_UNIX, SOCK_DGRAM, 0);
if (clif_info->socket_fd < 0)
@@ -166,11 +166,11 @@ static enum fcoe_err fcoeadm_open_cli(struct clif_sock_info *clif_info)
/*
* Send request to fcoemon
*/
-static enum fcoe_err fcoeadm_action(enum clif_action cmd, char *ifname)
+static enum fcoe_status fcoeadm_action(enum clif_action cmd, char *ifname)
{
struct clif_data data;
struct clif_sock_info clif_info;
- enum fcoe_err rc;
+ enum fcoe_status rc;
strncpy(data.ifname, ifname, sizeof(data.ifname));
data.cmd = cmd;
@@ -200,7 +200,7 @@ static enum fcoe_err fcoeadm_action(enum clif_action cmd, char *ifname)
int main(int argc, char *argv[])
{
enum clif_action cmd = CLIF_NONE;
- enum fcoe_err rc = NOERR;
+ enum fcoe_status rc = SUCCESS;
int opt, stat_interval;
char *ifname = NULL;
View
18 fcoeadm_display.c
@@ -1052,12 +1052,12 @@ static void hba_table_destroy(struct hba_name_table *hba_table)
HBA_CloseAdapter(hba_table[i].hba_handle);
}
-static enum fcoe_err fcoeadm_loadhba()
+static enum fcoe_status fcoeadm_loadhba()
{
if (HBA_STATUS_OK != HBA_LoadLibrary())
return EHBAAPIERR;
- return NOERR;
+ return SUCCESS;
}
/*
@@ -1148,7 +1148,7 @@ static int get_index_for_ifname(struct hba_name_table *hba_table,
return -EINVAL;
}
-enum fcoe_err display_port_stats(const char *ifname, int interval)
+enum fcoe_status display_port_stats(const char *ifname, int interval)
{
HBA_STATUS retval;
HBA_HANDLE hba_handle;
@@ -1157,7 +1157,7 @@ enum fcoe_err display_port_stats(const char *ifname, int interval)
HBA_FC4STATISTICS port_fc4stats;
HBA_INT64 start_time = 0;
struct hba_name_table hba_table[MAX_HBA_COUNT];
- enum fcoe_err rc = NOERR;
+ enum fcoe_status rc = SUCCESS;
int i, num_hbas;
if (fcoeadm_loadhba())
@@ -1235,10 +1235,10 @@ enum fcoe_err display_port_stats(const char *ifname, int interval)
return rc;
}
-enum fcoe_err display_adapter_info(const char *ifname)
+enum fcoe_status display_adapter_info(const char *ifname)
{
struct hba_name_table hba_table[MAX_HBA_COUNT];
- enum fcoe_err rc = NOERR;
+ enum fcoe_status rc = SUCCESS;
int i, j, num_hbas = 0;
if (fcoeadm_loadhba())
@@ -1303,14 +1303,14 @@ enum fcoe_err display_adapter_info(const char *ifname)
return rc;
}
-enum fcoe_err display_target_info(const char *ifname,
- enum disp_style style)
+enum fcoe_status display_target_info(const char *ifname,
+ enum disp_style style)
{
HBA_STATUS retval;
HBA_PORTATTRIBUTES rport_attrs;
struct hba_name_table hba_table[MAX_HBA_COUNT];
int i, target_index, num_hbas = 0;
- enum fcoe_err rc = NOERR;
+ enum fcoe_status rc = SUCCESS;
if (fcoeadm_loadhba())
return EHBAAPIERR;
View
10 fcoeadm_display.h
@@ -27,10 +27,10 @@ enum disp_style {
DISP_TARG,
};
-enum fcoe_err display_adapter_info(const char *ifname);
-enum fcoe_err display_target_info(const char *ifname,
- enum disp_style style);
-enum fcoe_err display_port_stats(const char *ifname,
- int stat_interval);
+enum fcoe_status display_adapter_info(const char *ifname);
+enum fcoe_status display_target_info(const char *ifname,
+ enum disp_style style);
+enum fcoe_status display_port_stats(const char *ifname,
+ int stat_interval);
#endif /* _FCOEADM_DISPLAY_H_ */
View
32 fcoemon.c
@@ -136,7 +136,7 @@ static void fcm_dcbd_event(char *, size_t);
static void fcm_dcbd_cmd_resp(char *, cmd_status);
static void fcm_netif_advance(struct fcm_netif *);
static void fcm_fcoe_action(struct fcm_netif *, struct fcoe_port *);
-static enum fcoe_err fcm_fcoe_if_action(char *, char *);
+static enum fcoe_status fcm_fcoe_if_action(char *, char *);
struct fcm_clif {
int cl_fd;
@@ -1952,10 +1952,10 @@ static void fcm_cli_reply(struct sock_info *r, int status)
r->fromlen);
}
-static enum fcoe_err fcm_fcoe_if_action(char *path, char *ifname)
+static enum fcoe_status fcm_fcoe_if_action(char *path, char *ifname)
{
FILE *fp = NULL;
- enum fcoe_err ret = EFAIL;
+ enum fcoe_status ret = EFAIL;
fp = fopen(path, "w");
if (!fp) {
@@ -1970,7 +1970,7 @@ static enum fcoe_err fcm_fcoe_if_action(char *path, char *ifname)
goto out;
}
- ret = NOERR;
+ ret = SUCCESS;
out:
fclose(fp);
err_out:
@@ -2022,9 +2022,9 @@ static void fcm_fcoe_action(struct fcm_netif *ff, struct fcoe_port *p)
char *ifname = p->ifname;
char fchost[FCHOSTBUFLEN];
char path[256];
- enum fcoe_err rc;
+ enum fcoe_status rc;
- rc = NOERR;
+ rc = SUCCESS;
switch (p->action) {
case FCP_CREATE_IF:
FCM_LOG_DBG("OP: CREATE %s\n", p->ifname);
@@ -2040,7 +2040,7 @@ static void fcm_fcoe_action(struct fcm_netif *ff, struct fcoe_port *p)
fcp_set_next_action(vp, FCP_DESTROY_IF);
vp = fcm_find_next_fcoe_port(vp, p->ifname);
}
- rc = NOERR;
+ rc = SUCCESS;
break;
}
rc = fcm_fcoe_if_action(FCOE_DESTROY, ifname);
@@ -2367,8 +2367,8 @@ static struct fcoe_port *fcm_port_create(char *ifname, int cmd)
return p;
}
-static enum fcoe_err fcm_cli_create(char *ifname, int cmd,
- struct sock_info **r)
+static enum fcoe_status fcm_cli_create(char *ifname, int cmd,
+ struct sock_info **r)
{
struct fcoe_port *p, *vp;
@@ -2390,11 +2390,11 @@ static enum fcoe_err fcm_cli_create(char *ifname, int cmd,
if (!p)
return EFAIL;
p->sock_reply = *r;
- return NOERR;
+ return SUCCESS;
}
-static enum fcoe_err fcm_cli_destroy(char *ifname, int cmd,
- struct sock_info **r)
+static enum fcoe_status fcm_cli_destroy(char *ifname, int cmd,
+ struct sock_info **r)
{
struct fcoe_port *p;
@@ -2404,7 +2404,7 @@ static enum fcoe_err fcm_cli_destroy(char *ifname, int cmd,
p->fcoe_enable = 0;
fcp_set_next_action(p, cmd);
p->sock_reply = *r;
- return NOERR;
+ return SUCCESS;
} else {
/* no action needed */
return ENOACTION;
@@ -2415,16 +2415,16 @@ static enum fcoe_err fcm_cli_destroy(char *ifname, int cmd,
return EFAIL;
}
-static enum fcoe_err fcm_cli_action(char *ifname, int cmd,
- struct sock_info **r)
+static enum fcoe_status fcm_cli_action(char *ifname, int cmd,
+ struct sock_info **r)
{
struct fcoe_port *p;
p = fcm_find_fcoe_port(ifname, FCP_CFG_IFNAME);
if (p) {
fcp_set_next_action(p, cmd);
p->sock_reply = *r;
- return NOERR;
+ return SUCCESS;
}
FCM_LOG_ERR(errno, "%s is not in port list.\n", ifname);
View
10 include/fcoe_utils.h
@@ -59,8 +59,8 @@
} while (0)
-enum fcoe_err {
- NOERR = 0, /* No error */
+enum fcoe_status {
+ SUCCESS = 0, /* Success */
EFAIL, /* Command Failed */
ENOACTION, /* No action was taken */
EFCOECONN, /* FCoE connection already exists */
@@ -77,9 +77,9 @@ enum fcoe_err {
EHBAAPIERR, /* Error using HBAAPI/libhbalinux */
};
-enum fcoe_err fcoe_validate_interface(char *ifname);
-enum fcoe_err fcoe_validate_fcoe_conn(char *ifname);
-enum fcoe_err fcoe_find_fchost(char *ifname, char *fchost, int len);
+enum fcoe_status fcoe_validate_interface(char *ifname);
+enum fcoe_status fcoe_validate_fcoe_conn(char *ifname);
+enum fcoe_status fcoe_find_fchost(char *ifname, char *fchost, int len);
int fcoe_checkdir(char *dir);
int check_symbolic_name_for_interface(const char *symbolic_name,
const char *ifname);
View
12 lib/fcoe_utils.c
@@ -65,7 +65,7 @@ static int fcoe_check_fchost(const char *ifname, const char *dname)
return rc;
}
-enum fcoe_err fcoe_find_fchost(char *ifname, char *fchost, int len)
+enum fcoe_status fcoe_find_fchost(char *ifname, char *fchost, int len)
{
int n, dname_len;
struct dirent **namelist;
@@ -83,7 +83,7 @@ enum fcoe_err fcoe_find_fchost(char *ifname, char *fchost, int len)
strncpy(fchost, namelist[n]->d_name,
dname_len + 1);
/* rc = 0 indicates found */
- rc = NOERR;
+ rc = SUCCESS;
} else {
/*
* The fc_host is too large
@@ -101,9 +101,9 @@ enum fcoe_err fcoe_find_fchost(char *ifname, char *fchost, int len)
return rc;
}
-enum fcoe_err fcoe_validate_interface(char *ifname)
+enum fcoe_status fcoe_validate_interface(char *ifname)
{
- enum fcoe_err rc = NOERR;
+ enum fcoe_status rc = SUCCESS;
char path[MAX_PATH_LEN];
@@ -124,10 +124,10 @@ enum fcoe_err fcoe_validate_interface(char *ifname)
/*
* Validate an existing instance for an FC interface
*/
-enum fcoe_err fcoe_validate_fcoe_conn(char *ifname)
+enum fcoe_status fcoe_validate_fcoe_conn(char *ifname)
{
char fchost[FCHOSTBUFLEN];
- enum fcoe_err rc = NOERR;
+ enum fcoe_status rc = SUCCESS;
rc = fcoe_validate_interface(ifname);

0 comments on commit 2952101

Please sign in to comment.