#define LSTIO_BATCH_QUERY 0xC27 /* query batch status */
#define LSTIO_STAT_QUERY 0xC30 /* get stats */
-typedef struct {
- lnet_nid_t ses_nid; /* nid of console node */
- __u64 ses_stamp; /* time stamp */
-} lst_sid_t; /*** session id */
+struct lst_sid {
+ lnet_nid_t ses_nid; /* nid of console node */
+ __u64 ses_stamp; /* time stamp */
+}; /*** session id */
-extern lst_sid_t LST_INVALID_SID;
+extern struct lst_sid LST_INVALID_SID;
-typedef struct {
- __u64 bat_id; /* unique id in session */
-} lst_bid_t; /*** batch id (group of tests) */
+struct lst_bid {
+ __u64 bat_id; /* unique id in session */
+};
/* Status of test node */
-#define LST_NODE_ACTIVE 0x1 /* node in this session */
-#define LST_NODE_BUSY 0x2 /* node is taken by other session */
-#define LST_NODE_DOWN 0x4 /* node is down */
-#define LST_NODE_UNKNOWN 0x8 /* node not in session */
-
-typedef struct {
- lnet_process_id_t nde_id; /* id of node */
- int nde_state; /* state of node */
-} lstcon_node_ent_t; /*** node entry, for list_group command */
-
-typedef struct {
- int nle_nnode; /* # of nodes */
- int nle_nactive; /* # of active nodes */
- int nle_nbusy; /* # of busy nodes */
- int nle_ndown; /* # of down nodes */
- int nle_nunknown; /* # of unknown nodes */
-} lstcon_ndlist_ent_t; /*** node_list entry, for list_batch command */
-
-typedef struct {
- int tse_type; /* test type */
- int tse_loop; /* loop count */
- int tse_concur; /* concurrency of test */
-} lstcon_test_ent_t; /*** test summary entry, for list_batch command */
-
-typedef struct {
- int bae_state; /* batch status */
- int bae_timeout; /* batch timeout */
- int bae_ntest; /* # of tests in the batch */
-} lstcon_batch_ent_t; /*** batch summary entry, for list_batch command */
-
-typedef struct {
- lstcon_ndlist_ent_t tbe_cli_nle; /* client (group) node_list entry */
- lstcon_ndlist_ent_t tbe_srv_nle; /* server (group) node_list entry */
+#define LST_NODE_ACTIVE 0x1 /* node in this session */
+#define LST_NODE_BUSY 0x2 /* node is taken by other session */
+#define LST_NODE_DOWN 0x4 /* node is down */
+#define LST_NODE_UNKNOWN 0x8 /* node not in session */
+
+struct lstcon_node_ent {
+ lnet_process_id_t nde_id; /* id of node */
+ int nde_state; /* state of node */
+}; /*** node entry, for list_group command */
+
+struct lstcon_ndlist_ent {
+ int nle_nnode; /* # of nodes */
+ int nle_nactive; /* # of active nodes */
+ int nle_nbusy; /* # of busy nodes */
+ int nle_ndown; /* # of down nodes */
+ int nle_nunknown; /* # of unknown nodes */
+}; /*** node_list entry, for list_batch command */
+
+struct lstcon_test_ent {
+ int tse_type; /* test type */
+ int tse_loop; /* loop count */
+ int tse_concur; /* concurrency of test */
+}; /*** test summary entry, for list_batch command */
+
+struct lstcon_batch_ent {
+ int bae_state; /* batch status */
+ int bae_timeout; /* batch timeout */
+ int bae_ntest; /* # of tests in the batch */
+}; /*** batch summary entry, for list_batch command */
+
+struct lstcon_test_batch_ent {
+ struct lstcon_ndlist_ent tbe_cli_nle; /* client (group) node_list entry */
+ struct lstcon_ndlist_ent tbe_srv_nle; /* server (group) node_list entry */
union {
- lstcon_test_ent_t tbe_test; /* test entry */
- lstcon_batch_ent_t tbe_batch; /* batch entry */
+ struct lstcon_test_ent tbe_test; /* test entry */
+ struct lstcon_batch_ent tbe_batch; /* batch entry */
} u;
-} lstcon_test_batch_ent_t; /*** test/batch verbose information entry,
+}; /*** test/batch verbose information entry,
*** for list_batch command */
-typedef struct {
+struct lstcon_rpc_ent {
struct list_head rpe_link; /* link chain */
lnet_process_id_t rpe_peer; /* peer's id */
struct timeval rpe_stamp; /* time stamp of RPC */
int rpe_state; /* peer's state */
int rpe_rpc_errno; /* RPC errno */
- lst_sid_t rpe_sid; /* peer's session id */
+ struct lst_sid rpe_sid; /* peer's session id */
int rpe_fwk_errno; /* framework errno */
int rpe_priv[4]; /* private data */
char rpe_payload[0]; /* private reply payload */
-} lstcon_rpc_ent_t;
+};
-typedef struct {
- int trs_rpc_stat[4]; /* RPCs stat (0: total, 1: failed, 2: finished, 4: reserved */
- int trs_rpc_errno; /* RPC errno */
- int trs_fwk_stat[8]; /* framework stat */
- int trs_fwk_errno; /* errno of the first remote error */
- void *trs_fwk_private; /* private framework stat */
-} lstcon_trans_stat_t;
+struct lstcon_trans_stat {
+ int trs_rpc_stat[4]; /* RPCs stat (0: total, 1: failed, 2: finished, 4: reserved */
+ int trs_rpc_errno; /* RPC errno */
+ int trs_fwk_stat[8]; /* framework stat */
+ int trs_fwk_errno; /* errno of the first remote error */
+ void *trs_fwk_private; /* private framework stat */
+};
static inline int
-lstcon_rpc_stat_total(lstcon_trans_stat_t *stat, int inc)
+lstcon_rpc_stat_total(struct lstcon_trans_stat *stat, int inc)
{
return inc ? ++stat->trs_rpc_stat[0] : stat->trs_rpc_stat[0];
}
static inline int
-lstcon_rpc_stat_success(lstcon_trans_stat_t *stat, int inc)
+lstcon_rpc_stat_success(struct lstcon_trans_stat *stat, int inc)
{
return inc ? ++stat->trs_rpc_stat[1] : stat->trs_rpc_stat[1];
}
static inline int
-lstcon_rpc_stat_failure(lstcon_trans_stat_t *stat, int inc)
+lstcon_rpc_stat_failure(struct lstcon_trans_stat *stat, int inc)
{
return inc ? ++stat->trs_rpc_stat[2] : stat->trs_rpc_stat[2];
}
static inline int
-lstcon_sesop_stat_success(lstcon_trans_stat_t *stat, int inc)
+lstcon_sesop_stat_success(struct lstcon_trans_stat *stat, int inc)
{
return inc ? ++stat->trs_fwk_stat[0] : stat->trs_fwk_stat[0];
}
static inline int
-lstcon_sesop_stat_failure(lstcon_trans_stat_t *stat, int inc)
+lstcon_sesop_stat_failure(struct lstcon_trans_stat *stat, int inc)
{
return inc ? ++stat->trs_fwk_stat[1] : stat->trs_fwk_stat[1];
}
static inline int
-lstcon_sesqry_stat_active(lstcon_trans_stat_t *stat, int inc)
+lstcon_sesqry_stat_active(struct lstcon_trans_stat *stat, int inc)
{
return inc ? ++stat->trs_fwk_stat[0] : stat->trs_fwk_stat[0];
}
static inline int
-lstcon_sesqry_stat_busy(lstcon_trans_stat_t *stat, int inc)
+lstcon_sesqry_stat_busy(struct lstcon_trans_stat *stat, int inc)
{
return inc ? ++stat->trs_fwk_stat[1] : stat->trs_fwk_stat[1];
}
static inline int
-lstcon_sesqry_stat_unknown(lstcon_trans_stat_t *stat, int inc)
+lstcon_sesqry_stat_unknown(struct lstcon_trans_stat *stat, int inc)
{
return inc ? ++stat->trs_fwk_stat[2] : stat->trs_fwk_stat[2];
}
static inline int
-lstcon_tsbop_stat_success(lstcon_trans_stat_t *stat, int inc)
+lstcon_tsbop_stat_success(struct lstcon_trans_stat *stat, int inc)
{
return inc ? ++stat->trs_fwk_stat[0] : stat->trs_fwk_stat[0];
}
static inline int
-lstcon_tsbop_stat_failure(lstcon_trans_stat_t *stat, int inc)
+lstcon_tsbop_stat_failure(struct lstcon_trans_stat *stat, int inc)
{
return inc ? ++stat->trs_fwk_stat[1] : stat->trs_fwk_stat[1];
}
static inline int
-lstcon_tsbqry_stat_idle(lstcon_trans_stat_t *stat, int inc)
+lstcon_tsbqry_stat_idle(struct lstcon_trans_stat *stat, int inc)
{
return inc ? ++stat->trs_fwk_stat[0] : stat->trs_fwk_stat[0];
}
static inline int
-lstcon_tsbqry_stat_run(lstcon_trans_stat_t *stat, int inc)
+lstcon_tsbqry_stat_run(struct lstcon_trans_stat *stat, int inc)
{
return inc ? ++stat->trs_fwk_stat[1] : stat->trs_fwk_stat[1];
}
static inline int
-lstcon_tsbqry_stat_failure(lstcon_trans_stat_t *stat, int inc)
+lstcon_tsbqry_stat_failure(struct lstcon_trans_stat *stat, int inc)
{
return inc ? ++stat->trs_fwk_stat[2] : stat->trs_fwk_stat[2];
}
static inline int
-lstcon_statqry_stat_success(lstcon_trans_stat_t *stat, int inc)
+lstcon_statqry_stat_success(struct lstcon_trans_stat *stat, int inc)
{
return inc ? ++stat->trs_fwk_stat[0] : stat->trs_fwk_stat[0];
}
static inline int
-lstcon_statqry_stat_failure(lstcon_trans_stat_t *stat, int inc)
+lstcon_statqry_stat_failure(struct lstcon_trans_stat *stat, int inc)
{
return inc ? ++stat->trs_fwk_stat[1] : stat->trs_fwk_stat[1];
}
/* create a session */
-typedef struct {
+struct lstio_session_new_args {
int lstio_ses_key; /* IN: local key */
int lstio_ses_timeout; /* IN: session timeout */
int lstio_ses_force; /* IN: force create ? */
/** IN: session features */
unsigned lstio_ses_feats;
- lst_sid_t __user *lstio_ses_idp; /* OUT: session id */
+ struct lst_sid __user *lstio_ses_idp; /* OUT: session id */
int lstio_ses_nmlen; /* IN: name length */
char __user *lstio_ses_namep; /* IN: session name */
-} lstio_session_new_args_t;
+};
/* query current session */
-typedef struct {
- lst_sid_t __user *lstio_ses_idp; /* OUT: session id */
- int __user *lstio_ses_keyp; /* OUT: local key */
+struct lstio_session_info_args {
+ struct lst_sid __user *lstio_ses_idp; /* OUT: session id */
+ int __user *lstio_ses_keyp; /* OUT: local key */
/** OUT: session features */
- unsigned __user *lstio_ses_featp;
- lstcon_ndlist_ent_t __user *lstio_ses_ndinfo; /* OUT: */
- int lstio_ses_nmlen; /* IN: name length */
- char __user *lstio_ses_namep; /* OUT: session name */
-} lstio_session_info_args_t;
+ unsigned __user *lstio_ses_featp;
+ struct lstcon_ndlist_ent __user *lstio_ses_ndinfo; /* OUT: */
+ int lstio_ses_nmlen; /* IN: name length */
+ char __user *lstio_ses_namep; /* OUT: session name */
+};
/* delete a session */
-typedef struct {
+struct lstio_session_end_args {
int lstio_ses_key; /* IN: session key */
-} lstio_session_end_args_t;
+};
#define LST_OPC_SESSION 1
#define LST_OPC_GROUP 2
#define LST_OPC_BATCHCLI 4
#define LST_OPC_BATCHSRV 5
-typedef struct {
+struct lstio_debug_args {
int lstio_dbg_key; /* IN: session key */
int lstio_dbg_type; /* IN: debug sessin|batch|group|nodes list */
int lstio_dbg_flags; /* IN: reserved debug flags */
lnet_process_id_t __user *lstio_dbg_idsp; /* IN: id of test nodes */
/* OUT: list head of result buffer */
struct list_head __user *lstio_dbg_resultp;
-} lstio_debug_args_t;
+};
-typedef struct {
+struct lstio_group_add_args {
int lstio_grp_key; /* IN: session key */
int lstio_grp_nmlen; /* IN: name length */
char __user *lstio_grp_namep; /* IN: group name */
-} lstio_group_add_args_t;
+};
-typedef struct {
+struct lstio_group_del_args {
int lstio_grp_key; /* IN: session key */
int lstio_grp_nmlen; /* IN: name length */
char __user *lstio_grp_namep; /* IN: group name */
-} lstio_group_del_args_t;
+};
#define LST_GROUP_CLEAN 1 /* remove inactive nodes in the group */
#define LST_GROUP_REFRESH 2 /* refresh inactive nodes in the group */
#define LST_GROUP_RMND 3 /* delete nodes from the group */
-typedef struct {
+struct lstio_group_update_args {
int lstio_grp_key; /* IN: session key */
int lstio_grp_opc; /* IN: OPC */
int lstio_grp_args; /* IN: arguments */
lnet_process_id_t __user *lstio_grp_idsp; /* IN: array of nodes */
/* OUT: list head of result buffer */
struct list_head __user *lstio_grp_resultp;
-} lstio_group_update_args_t;
+};
-typedef struct {
+struct lstio_group_nodes_args {
int lstio_grp_key; /* IN: session key */
int lstio_grp_nmlen; /* IN: name length */
char __user *lstio_grp_namep; /* IN: group name */
lnet_process_id_t __user *lstio_grp_idsp; /* IN: nodes */
/* OUT: list head of result buffer */
struct list_head __user *lstio_grp_resultp;
-} lstio_group_nodes_args_t;
+};
-typedef struct {
+struct lstio_group_list_args {
int lstio_grp_key; /* IN: session key */
int lstio_grp_idx; /* IN: group idx */
int lstio_grp_nmlen; /* IN: name len */
char __user *lstio_grp_namep; /* OUT: name */
-} lstio_group_list_args_t;
+};
-typedef struct {
+struct lstio_group_info_args {
int lstio_grp_key; /* IN: session key */
int lstio_grp_nmlen; /* IN: name len */
char __user *lstio_grp_namep; /* IN: name */
- lstcon_ndlist_ent_t __user *lstio_grp_entp; /* OUT: description of group */
+ struct lstcon_ndlist_ent __user *lstio_grp_entp;/* OUT: description of group */
int __user *lstio_grp_idxp; /* IN/OUT: node index */
int __user *lstio_grp_ndentp; /* IN/OUT: # of nodent */
- lstcon_node_ent_t __user *lstio_grp_dentsp; /* OUT: nodent array */
-} lstio_group_info_args_t;
+ struct lstcon_node_ent __user *lstio_grp_dentsp;/* OUT: nodent array */
+};
#define LST_DEFAULT_BATCH "batch" /* default batch name */
-typedef struct {
+struct lstio_batch_add_args {
int lstio_bat_key; /* IN: session key */
int lstio_bat_nmlen; /* IN: name length */
char __user *lstio_bat_namep; /* IN: batch name */
-} lstio_batch_add_args_t;
+};
-typedef struct {
+struct lstio_batch_del_args {
int lstio_bat_key; /* IN: session key */
int lstio_bat_nmlen; /* IN: name length */
char __user *lstio_bat_namep; /* IN: batch name */
-} lstio_batch_del_args_t;
+};
-typedef struct {
+struct lstio_batch_run_args {
/* IN: session key */
int lstio_bat_key;
/* IN: timeout for the batch */
char __user *lstio_bat_namep;
/* OUT: list head of result buffer */
struct list_head __user *lstio_bat_resultp;
-} lstio_batch_run_args_t;
+};
-typedef struct {
+struct lstio_batch_stop_args {
/* IN: session key */
int lstio_bat_key;
/* IN: abort unfinished test RPC */
char __user *lstio_bat_namep;
/* OUT: list head of result buffer */
struct list_head __user *lstio_bat_resultp;
-} lstio_batch_stop_args_t;
+};
-typedef struct {
+struct lstio_batch_query_args {
/* IN: session key */
int lstio_bat_key;
/* IN: test index */
char __user *lstio_bat_namep;
/* OUT: list head of result buffer */
struct list_head __user *lstio_bat_resultp;
-} lstio_batch_query_args_t;
+};
-typedef struct {
+struct lstio_batch_list_args {
int lstio_bat_key; /* IN: session key */
int lstio_bat_idx; /* IN: index */
int lstio_bat_nmlen; /* IN: name length */
char __user *lstio_bat_namep; /* IN: batch name */
-} lstio_batch_list_args_t;
+};
-typedef struct {
+struct lstio_batch_info_args {
int lstio_bat_key; /* IN: session key */
int lstio_bat_nmlen; /* IN: name length */
char __user *lstio_bat_namep; /* IN: name */
int lstio_bat_server; /* IN: query server or not */
int lstio_bat_testidx; /* IN: test index */
- lstcon_test_batch_ent_t __user *lstio_bat_entp; /* OUT: batch ent */
+ struct lstcon_test_batch_ent __user *lstio_bat_entp;/* OUT: batch ent */
int __user *lstio_bat_idxp; /* IN/OUT: index of node */
int __user *lstio_bat_ndentp; /* IN/OUT: # of nodent */
- lstcon_node_ent_t __user *lstio_bat_dentsp; /* array of nodent */
-} lstio_batch_info_args_t;
+ struct lstcon_node_ent __user *lstio_bat_dentsp;/* array of nodent */
+};
/* add stat in session */
-typedef struct {
+struct lstio_stat_args {
/* IN: session key */
int lstio_sta_key;
/* IN: timeout for stat requst */
lnet_process_id_t __user *lstio_sta_idsp;
/* OUT: list head of result buffer */
struct list_head __user *lstio_sta_resultp;
-} lstio_stat_args_t;
+};
-typedef enum {
+enum lst_test_type {
LST_TEST_BULK = 1,
LST_TEST_PING = 2
-} lst_test_type_t;
+};
/* create a test in a batch */
#define LST_MAX_CONCUR 1024 /* Max concurrency of test */
-typedef struct {
+struct lstio_test_args {
int lstio_tes_key; /* IN: session key */
int lstio_tes_bat_nmlen; /* IN: batch name len */
char __user *lstio_tes_bat_name; /* IN: batch name */
int __user *lstio_tes_retp;
/* OUT: list head of result buffer */
struct list_head __user *lstio_tes_resultp;
-} lstio_test_args_t;
+};
-typedef enum {
+enum lst_brw_type {
LST_BRW_READ = 1,
LST_BRW_WRITE = 2
-} lst_brw_type_t;
+};
-typedef enum {
+enum lst_brw_flags {
LST_BRW_CHECK_NONE = 1,
LST_BRW_CHECK_SIMPLE = 2,
LST_BRW_CHECK_FULL = 3
-} lst_brw_flags_t;
-
-typedef struct {
- int blk_opc; /* bulk operation code */
- int blk_size; /* size (bytes) */
- int blk_time; /* time of running the test*/
- int blk_flags; /* reserved flags */
- int blk_cli_off; /* bulk offset on client */
- int blk_srv_off; /* reserved: bulk offset on server */
-} lst_test_bulk_param_t;
-
-typedef struct {
- int png_size; /* size of ping message */
- int png_time; /* time */
- int png_loop; /* loop */
- int png_flags; /* reserved flags */
-} lst_test_ping_param_t;
-
-typedef struct {
+};
+
+struct lst_test_bulk_param {
+ int blk_opc; /* bulk operation code */
+ int blk_size; /* size (bytes) */
+ int blk_time; /* time of running the test*/
+ int blk_flags; /* reserved flags */
+ int blk_cli_off; /* bulk offset on client */
+ int blk_srv_off; /* reserved: bulk offset on server */
+};
+
+struct lst_test_ping_param {
+ int png_size; /* size of ping message */
+ int png_time; /* time */
+ int png_loop; /* loop */
+ int png_flags; /* reserved flags */
+};
+
+struct srpc_counters {
__u32 errors;
__u32 rpcs_sent;
__u32 rpcs_rcvd;
__u32 rpcs_expired;
__u64 bulk_get;
__u64 bulk_put;
-} WIRE_ATTR srpc_counters_t;
+} WIRE_ATTR;
-typedef struct {
+struct sfw_counters {
/** milliseconds since current session started */
__u32 running_ms;
__u32 active_batches;
__u32 zombie_sessions;
__u32 brw_errors;
__u32 ping_errors;
-} WIRE_ATTR sfw_counters_t;
+} WIRE_ATTR;
#endif
#include "console.h"
static int
-lst_session_new_ioctl(lstio_session_new_args_t *args)
+lst_session_new_ioctl(struct lstio_session_new_args *args)
{
char *name;
int rc;
}
static int
-lst_session_end_ioctl(lstio_session_end_args_t *args)
+lst_session_end_ioctl(struct lstio_session_end_args *args)
{
if (args->lstio_ses_key != console_session.ses_key)
return -EACCES;
}
static int
-lst_session_info_ioctl(lstio_session_info_args_t *args)
+lst_session_info_ioctl(struct lstio_session_info_args *args)
{
/* no checking of key */
}
static int
-lst_debug_ioctl(lstio_debug_args_t *args)
+lst_debug_ioctl(struct lstio_debug_args *args)
{
char *name = NULL;
int client = 1;
}
static int
-lst_group_add_ioctl(lstio_group_add_args_t *args)
+lst_group_add_ioctl(struct lstio_group_add_args *args)
{
char *name;
int rc;
}
static int
-lst_group_del_ioctl(lstio_group_del_args_t *args)
+lst_group_del_ioctl(struct lstio_group_del_args *args)
{
int rc;
char *name;
}
static int
-lst_group_update_ioctl(lstio_group_update_args_t *args)
+lst_group_update_ioctl(struct lstio_group_update_args *args)
{
int rc;
char *name;
}
static int
-lst_nodes_add_ioctl(lstio_group_nodes_args_t *args)
+lst_nodes_add_ioctl(struct lstio_group_nodes_args *args)
{
unsigned feats;
int rc;
}
static int
-lst_group_list_ioctl(lstio_group_list_args_t *args)
+lst_group_list_ioctl(struct lstio_group_list_args *args)
{
if (args->lstio_grp_key != console_session.ses_key)
return -EACCES;
}
static int
-lst_group_info_ioctl(lstio_group_info_args_t *args)
+lst_group_info_ioctl(struct lstio_group_info_args *args)
{
char *name;
int ndent;
}
static int
-lst_batch_add_ioctl(lstio_batch_add_args_t *args)
+lst_batch_add_ioctl(struct lstio_batch_add_args *args)
{
int rc;
char *name;
}
static int
-lst_batch_run_ioctl(lstio_batch_run_args_t *args)
+lst_batch_run_ioctl(struct lstio_batch_run_args *args)
{
int rc;
char *name;
}
static int
-lst_batch_stop_ioctl(lstio_batch_stop_args_t *args)
+lst_batch_stop_ioctl(struct lstio_batch_stop_args *args)
{
int rc;
char *name;
}
static int
-lst_batch_query_ioctl(lstio_batch_query_args_t *args)
+lst_batch_query_ioctl(struct lstio_batch_query_args *args)
{
char *name;
int rc;
}
static int
-lst_batch_list_ioctl(lstio_batch_list_args_t *args)
+lst_batch_list_ioctl(struct lstio_batch_list_args *args)
{
if (args->lstio_bat_key != console_session.ses_key)
return -EACCES;
}
static int
-lst_batch_info_ioctl(lstio_batch_info_args_t *args)
+lst_batch_info_ioctl(struct lstio_batch_info_args *args)
{
char *name;
int rc;
}
static int
-lst_stat_query_ioctl(lstio_stat_args_t *args)
+lst_stat_query_ioctl(struct lstio_stat_args *args)
{
int rc;
char *name = NULL;
return rc;
}
-static int lst_test_add_ioctl(lstio_test_args_t *args)
+static int lst_test_add_ioctl(struct lstio_test_args *args)
{
char *batch_name;
char *src_name = NULL;
goto out;
}
- memset(&console_session.ses_trans_stat, 0, sizeof(lstcon_trans_stat_t));
+ memset(&console_session.ses_trans_stat, 0, sizeof(struct lstcon_trans_stat));
switch (opc) {
case LSTIO_SESSION_NEW:
- rc = lst_session_new_ioctl((lstio_session_new_args_t *)buf);
+ rc = lst_session_new_ioctl((struct lstio_session_new_args *)buf);
break;
case LSTIO_SESSION_END:
- rc = lst_session_end_ioctl((lstio_session_end_args_t *)buf);
+ rc = lst_session_end_ioctl((struct lstio_session_end_args *)buf);
break;
case LSTIO_SESSION_INFO:
- rc = lst_session_info_ioctl((lstio_session_info_args_t *)buf);
+ rc = lst_session_info_ioctl((struct lstio_session_info_args *)buf);
break;
case LSTIO_DEBUG:
- rc = lst_debug_ioctl((lstio_debug_args_t *)buf);
+ rc = lst_debug_ioctl((struct lstio_debug_args *)buf);
break;
case LSTIO_GROUP_ADD:
- rc = lst_group_add_ioctl((lstio_group_add_args_t *)buf);
+ rc = lst_group_add_ioctl((struct lstio_group_add_args *)buf);
break;
case LSTIO_GROUP_DEL:
- rc = lst_group_del_ioctl((lstio_group_del_args_t *)buf);
+ rc = lst_group_del_ioctl((struct lstio_group_del_args *)buf);
break;
case LSTIO_GROUP_UPDATE:
- rc = lst_group_update_ioctl((lstio_group_update_args_t *)buf);
+ rc = lst_group_update_ioctl((struct lstio_group_update_args *)buf);
break;
case LSTIO_NODES_ADD:
- rc = lst_nodes_add_ioctl((lstio_group_nodes_args_t *)buf);
+ rc = lst_nodes_add_ioctl((struct lstio_group_nodes_args *)buf);
break;
case LSTIO_GROUP_LIST:
- rc = lst_group_list_ioctl((lstio_group_list_args_t *)buf);
+ rc = lst_group_list_ioctl((struct lstio_group_list_args *)buf);
break;
case LSTIO_GROUP_INFO:
- rc = lst_group_info_ioctl((lstio_group_info_args_t *)buf);
+ rc = lst_group_info_ioctl((struct lstio_group_info_args *)buf);
break;
case LSTIO_BATCH_ADD:
- rc = lst_batch_add_ioctl((lstio_batch_add_args_t *)buf);
+ rc = lst_batch_add_ioctl((struct lstio_batch_add_args *)buf);
break;
case LSTIO_BATCH_START:
- rc = lst_batch_run_ioctl((lstio_batch_run_args_t *)buf);
+ rc = lst_batch_run_ioctl((struct lstio_batch_run_args *)buf);
break;
case LSTIO_BATCH_STOP:
- rc = lst_batch_stop_ioctl((lstio_batch_stop_args_t *)buf);
+ rc = lst_batch_stop_ioctl((struct lstio_batch_stop_args *)buf);
break;
case LSTIO_BATCH_QUERY:
- rc = lst_batch_query_ioctl((lstio_batch_query_args_t *)buf);
+ rc = lst_batch_query_ioctl((struct lstio_batch_query_args *)buf);
break;
case LSTIO_BATCH_LIST:
- rc = lst_batch_list_ioctl((lstio_batch_list_args_t *)buf);
+ rc = lst_batch_list_ioctl((struct lstio_batch_list_args *)buf);
break;
case LSTIO_BATCH_INFO:
- rc = lst_batch_info_ioctl((lstio_batch_info_args_t *)buf);
+ rc = lst_batch_info_ioctl((struct lstio_batch_info_args *)buf);
break;
case LSTIO_TEST_ADD:
- rc = lst_test_add_ioctl((lstio_test_args_t *)buf);
+ rc = lst_test_add_ioctl((struct lstio_test_args *)buf);
break;
case LSTIO_STAT_QUERY:
- rc = lst_stat_query_ioctl((lstio_stat_args_t *)buf);
+ rc = lst_stat_query_ioctl((struct lstio_stat_args *)buf);
break;
default:
rc = -EINVAL;
}
if (copy_to_user(data->ioc_pbuf2, &console_session.ses_trans_stat,
- sizeof(lstcon_trans_stat_t)))
+ sizeof(struct lstcon_trans_stat)))
rc = -EFAULT;
out:
mutex_unlock(&console_session.ses_mutex);
#include "console.h"
void lstcon_rpc_stat_reply(lstcon_rpc_trans_t *, srpc_msg_t *,
- lstcon_node_t *, lstcon_trans_stat_t *);
+ lstcon_node_t *, struct lstcon_trans_stat *);
static void
lstcon_rpc_done(srpc_client_rpc_t *rpc)
}
void
-lstcon_rpc_trans_stat(lstcon_rpc_trans_t *trans, lstcon_trans_stat_t *stat)
+lstcon_rpc_trans_stat(lstcon_rpc_trans_t *trans, struct lstcon_trans_stat *stat)
{
lstcon_rpc_t *crpc;
srpc_msg_t *rep;
{
struct list_head tmp;
struct list_head __user *next;
- lstcon_rpc_ent_t *ent;
+ struct lstcon_rpc_ent *ent;
srpc_generic_reply_t *rep;
lstcon_rpc_t *crpc;
srpc_msg_t *msg;
next = tmp.next;
- ent = list_entry(next, lstcon_rpc_ent_t, rpe_link);
+ ent = list_entry(next, struct lstcon_rpc_ent, rpe_link);
LASSERT(crpc->crp_stamp != 0);
rep = (srpc_generic_reply_t *)&msg->msg_body.reply;
if (copy_to_user(&ent->rpe_sid,
- &rep->sid, sizeof(lst_sid_t)) ||
+ &rep->sid, sizeof(rep->sid)) ||
copy_to_user(&ent->rpe_fwk_errno,
&rep->status, sizeof(rep->status)))
return -EFAULT;
}
static int
-lstcon_pingrpc_prep(lst_test_ping_param_t *param, srpc_test_reqst_t *req)
+lstcon_pingrpc_prep(struct lst_test_ping_param *param, srpc_test_reqst_t *req)
{
test_ping_req_t *prq = &req->tsr_u.ping;
}
static int
-lstcon_bulkrpc_v0_prep(lst_test_bulk_param_t *param, srpc_test_reqst_t *req)
+lstcon_bulkrpc_v0_prep(struct lst_test_bulk_param *param, srpc_test_reqst_t *req)
{
test_bulk_req_t *brq = &req->tsr_u.bulk_v0;
}
static int
-lstcon_bulkrpc_v1_prep(lst_test_bulk_param_t *param, bool is_client,
+lstcon_bulkrpc_v1_prep(struct lst_test_bulk_param *param, bool is_client,
srpc_test_reqst_t *req)
{
test_bulk_req_v1_t *brq = &req->tsr_u.bulk_v1;
switch (test->tes_type) {
case LST_TEST_PING:
trq->tsr_service = SRPC_SERVICE_PING;
- rc = lstcon_pingrpc_prep((lst_test_ping_param_t *)
+ rc = lstcon_pingrpc_prep((struct lst_test_ping_param *)
&test->tes_param[0], trq);
break;
case LST_TEST_BULK:
trq->tsr_service = SRPC_SERVICE_BRW;
if ((feats & LST_FEAT_BULK_LEN) == 0) {
- rc = lstcon_bulkrpc_v0_prep((lst_test_bulk_param_t *)
+ rc = lstcon_bulkrpc_v0_prep((struct lst_test_bulk_param *)
&test->tes_param[0], trq);
} else {
- rc = lstcon_bulkrpc_v1_prep((lst_test_bulk_param_t *)
+ rc = lstcon_bulkrpc_v1_prep((struct lst_test_bulk_param *)
&test->tes_param[0],
trq->tsr_is_client, trq);
}
void
lstcon_rpc_stat_reply(lstcon_rpc_trans_t *trans, srpc_msg_t *msg,
- lstcon_node_t *nd, lstcon_trans_stat_t *stat)
+ lstcon_node_t *nd, struct lstcon_trans_stat *stat)
{
srpc_rmsn_reply_t *rmsn_rep;
srpc_debug_reply_t *dbg_rep;
lstcon_rpc_trans_stat(console_session.ses_ping, lstcon_trans_stat());
lstcon_rpc_trans_destroy(console_session.ses_ping);
- memset(lstcon_trans_stat(), 0, sizeof(lstcon_trans_stat_t));
+ memset(lstcon_trans_stat(), 0, sizeof(struct lstcon_trans_stat));
console_session.ses_ping = NULL;
}
typedef int (* lstcon_rpc_cond_func_t)(int, struct lstcon_node *, void *);
typedef int (*lstcon_rpc_readent_func_t)(int, srpc_msg_t *,
- lstcon_rpc_ent_t __user *);
+ struct lstcon_rpc_ent __user *);
int lstcon_sesrpc_prep(struct lstcon_node *nd, int transop,
unsigned version, lstcon_rpc_t **crpc);
void *arg, lstcon_rpc_cond_func_t condition,
lstcon_rpc_trans_t **transpp);
void lstcon_rpc_trans_stat(lstcon_rpc_trans_t *trans,
- lstcon_trans_stat_t *stat);
+ struct lstcon_trans_stat *stat);
int lstcon_rpc_trans_interpreter(lstcon_rpc_trans_t *trans,
struct list_head __user *head_up,
lstcon_rpc_readent_func_t readent);
static int
lstcon_sesrpc_readent(int transop, srpc_msg_t *msg,
- lstcon_rpc_ent_t __user *ent_up)
+ struct lstcon_rpc_ent __user *ent_up)
{
srpc_debug_reply_t *rep;
static int
lstcon_nodes_getent(struct list_head *head, int *index_p,
- int *count_p, lstcon_node_ent_t __user *dents_up)
+ int *count_p, struct lstcon_node_ent __user *dents_up)
{
lstcon_ndlink_t *ndl;
lstcon_node_t *nd;
}
int
-lstcon_group_info(char *name, lstcon_ndlist_ent_t __user *gents_p,
+lstcon_group_info(char *name, struct lstcon_ndlist_ent __user *gents_p,
int *index_p, int *count_p,
- lstcon_node_ent_t __user *dents_up)
+ struct lstcon_node_ent __user *dents_up)
{
- lstcon_ndlist_ent_t *gentp;
+ struct lstcon_ndlist_ent *gentp;
lstcon_group_t *grp;
lstcon_ndlink_t *ndl;
int rc;
}
/* non-verbose query */
- LIBCFS_ALLOC(gentp, sizeof(lstcon_ndlist_ent_t));
+ LIBCFS_ALLOC(gentp, sizeof(struct lstcon_ndlist_ent));
if (gentp == NULL) {
CERROR("Can't allocate ndlist_ent\n");
lstcon_group_decref(grp);
LST_NODE_STATE_COUNTER(ndl->ndl_node, gentp);
rc = copy_to_user(gents_p, gentp,
- sizeof(lstcon_ndlist_ent_t)) ? -EFAULT : 0;
+ sizeof(struct lstcon_ndlist_ent)) ? -EFAULT : 0;
- LIBCFS_FREE(gentp, sizeof(lstcon_ndlist_ent_t));
+ LIBCFS_FREE(gentp, sizeof(struct lstcon_ndlist_ent));
lstcon_group_decref(grp);
}
int
-lstcon_batch_info(char *name, lstcon_test_batch_ent_t __user *ent_up,
+lstcon_batch_info(char *name, struct lstcon_test_batch_ent __user *ent_up,
int server, int testidx, int *index_p, int *ndent_p,
- lstcon_node_ent_t __user *dents_up)
+ struct lstcon_node_ent __user *dents_up)
{
- lstcon_test_batch_ent_t *entp;
+ struct lstcon_test_batch_ent *entp;
struct list_head *clilst;
struct list_head *srvlst;
lstcon_test_t *test = NULL;
}
/* non-verbose query */
- LIBCFS_ALLOC(entp, sizeof(lstcon_test_batch_ent_t));
+ LIBCFS_ALLOC(entp, sizeof(struct lstcon_test_batch_ent));
if (entp == NULL)
return -ENOMEM;
LST_NODE_STATE_COUNTER(ndl->ndl_node, &entp->tbe_srv_nle);
rc = copy_to_user(ent_up, entp,
- sizeof(lstcon_test_batch_ent_t)) ? -EFAULT : 0;
+ sizeof(struct lstcon_test_batch_ent)) ? -EFAULT : 0;
- LIBCFS_FREE(entp, sizeof(lstcon_test_batch_ent_t));
+ LIBCFS_FREE(entp, sizeof(struct lstcon_test_batch_ent));
return rc;
}
static int
lstcon_tsbrpc_readent(int transop, srpc_msg_t *msg,
- lstcon_rpc_ent_t __user *ent_up)
+ struct lstcon_rpc_ent __user *ent_up)
{
srpc_batch_reply_t *rep = &msg->msg_body.bat_reply;
static int
lstcon_statrpc_readent(int transop, srpc_msg_t *msg,
- lstcon_rpc_ent_t __user *ent_up)
+ struct lstcon_rpc_ent __user *ent_up)
{
srpc_stat_reply_t *rep = &msg->msg_body.stat_reply;
- sfw_counters_t __user *sfwk_stat;
- srpc_counters_t __user *srpc_stat;
+ struct sfw_counters __user *sfwk_stat;
+ struct srpc_counters __user *srpc_stat;
lnet_counters_t __user *lnet_stat;
if (rep->str_status != 0)
return 0;
- sfwk_stat = (sfw_counters_t __user *)&ent_up->rpe_payload[0];
- srpc_stat = (srpc_counters_t __user *)
+ sfwk_stat = (struct sfw_counters __user *)&ent_up->rpe_payload[0];
+ srpc_stat = (struct srpc_counters __user *)
((char __user *)sfwk_stat + sizeof(*sfwk_stat));
lnet_stat = (lnet_counters_t __user *)
((char __user *)srpc_stat + sizeof(*srpc_stat));
}
int
-lstcon_session_match(lst_sid_t sid)
+lstcon_session_match(struct lst_sid sid)
{
return (console_session.ses_id.ses_nid == sid.ses_nid &&
console_session.ses_id.ses_stamp == sid.ses_stamp) ? 1: 0;
}
static void
-lstcon_new_session_id(lst_sid_t *sid)
+lstcon_new_session_id(struct lst_sid *sid)
{
lnet_process_id_t id;
int
lstcon_session_new(char *name, int key, unsigned feats,
- int timeout, int force, lst_sid_t __user *sid_up)
+ int timeout, int force, struct lst_sid __user *sid_up)
{
int rc = 0;
int i;
}
if (copy_to_user(sid_up, &console_session.ses_id,
- sizeof(lst_sid_t)) == 0)
+ sizeof(struct lst_sid)) == 0)
return rc;
lstcon_session_end();
}
int
-lstcon_session_info(lst_sid_t __user *sid_up, int __user *key_up,
+lstcon_session_info(struct lst_sid __user *sid_up, int __user *key_up,
unsigned __user *featp,
- lstcon_ndlist_ent_t __user *ndinfo_up,
+ struct lstcon_ndlist_ent __user *ndinfo_up,
char __user *name_up, int len)
{
- lstcon_ndlist_ent_t *entp;
+ struct lstcon_ndlist_ent *entp;
lstcon_ndlink_t *ndl;
int rc = 0;
LST_NODE_STATE_COUNTER(ndl->ndl_node, entp);
if (copy_to_user(sid_up, &console_session.ses_id,
- sizeof(lst_sid_t)) ||
+ sizeof(struct lst_sid)) ||
copy_to_user(key_up, &console_session.ses_key,
sizeof(*key_up)) ||
copy_to_user(featp, &console_session.ses_features,
#define LST_BATCH_RUNNING 0xB1 /* running batch */
typedef struct lstcon_tsb_hdr {
- lst_bid_t tsb_id; /* batch ID */
+ struct lst_bid tsb_id; /* batch ID */
int tsb_index; /* test index */
} lstcon_tsb_hdr_t;
typedef struct {
struct mutex ses_mutex; /* only 1 thread in session */
- lst_sid_t ses_id; /* global session id */
+ struct lst_sid ses_id; /* global session id */
int ses_key; /* local session key */
int ses_state; /* state of session */
int ses_timeout; /* timeout in seconds */
char ses_name[LST_NAME_SIZE]; /* session name */
lstcon_rpc_trans_t *ses_ping; /* session pinger */
stt_timer_t ses_ping_timer; /* timer for pinger */
- lstcon_trans_stat_t ses_trans_stat; /* transaction stats */
+ struct lstcon_trans_stat ses_trans_stat; /* transaction stats */
struct list_head ses_trans_list; /* global list of transaction */
struct list_head ses_grp_list; /* global list of groups */
extern lstcon_session_t console_session;
-static inline lstcon_trans_stat_t *
+static inline struct lstcon_trans_stat *
lstcon_trans_stat(void)
{
return &console_session.ses_trans_stat;
return &hash[idx];
}
-extern int lstcon_session_match(lst_sid_t sid);
+extern int lstcon_session_match(struct lst_sid sid);
extern int lstcon_session_new(char *name, int key, unsigned version,
- int timeout, int flags, lst_sid_t __user *sid_up);
-extern int lstcon_session_info(lst_sid_t __user *sid_up, int __user *key,
+ int timeout, int flags, struct lst_sid __user *sid_up);
+extern int lstcon_session_info(struct lst_sid __user *sid_up, int __user *key,
unsigned __user *verp,
- lstcon_ndlist_ent_t __user *entp,
+ struct lstcon_ndlist_ent __user *entp,
char __user *name_up, int len);
extern int lstcon_session_end(void);
extern int lstcon_session_debug(int timeout,
extern int lstcon_nodes_remove(char *name, int nnd,
lnet_process_id_t __user *nds_up,
struct list_head __user *result_up);
-extern int lstcon_group_info(char *name, lstcon_ndlist_ent_t __user *gent_up,
+extern int lstcon_group_info(char *name, struct lstcon_ndlist_ent __user *gent_up,
int *index_p, int *ndent_p,
- lstcon_node_ent_t __user *ndents_up);
+ struct lstcon_node_ent __user *ndents_up);
extern int lstcon_group_list(int idx, int len, char __user *name_up);
extern int lstcon_batch_add(char *name);
extern int lstcon_batch_run(char *name, int timeout,
struct list_head __user *result_up);
extern int lstcon_batch_del(char *name);
extern int lstcon_batch_list(int idx, int namelen, char __user *name_up);
-extern int lstcon_batch_info(char *name, lstcon_test_batch_ent_t __user *ent_up,
+extern int lstcon_batch_info(char *name,
+ struct lstcon_test_batch_ent __user *ent_up,
int server, int testidx, int *index_p,
- int *ndent_p, lstcon_node_ent_t __user *dents_up);
+ int *ndent_p,
+ struct lstcon_node_ent __user *dents_up);
extern int lstcon_group_stat(char *grp_name, int timeout,
struct list_head __user *result_up);
extern int lstcon_nodes_stat(int count, lnet_process_id_t __user *ids_up,
#include "selftest.h"
-lst_sid_t LST_INVALID_SID = {LNET_NID_ANY, -1};
+struct lst_sid LST_INVALID_SID = {LNET_NID_ANY, -1};
static int session_timeout = 100;
module_param(session_timeout, int, 0444);
}
static inline void
-sfw_init_session(sfw_session_t *sn, lst_sid_t sid,
+sfw_init_session(sfw_session_t *sn, struct lst_sid sid,
unsigned features, const char *name)
{
stt_timer_t *timer = &sn->sn_timer;
}
static sfw_batch_t *
-sfw_find_batch (lst_bid_t bid)
+sfw_find_batch(struct lst_bid bid)
{
sfw_session_t *sn = sfw_data.fw_session;
sfw_batch_t *bat;
}
static sfw_batch_t *
-sfw_bid2batch (lst_bid_t bid)
+sfw_bid2batch(struct lst_bid bid)
{
sfw_session_t *sn = sfw_data.fw_session;
sfw_batch_t *bat;
sfw_get_stats (srpc_stat_reqst_t *request, srpc_stat_reply_t *reply)
{
sfw_session_t *sn = sfw_data.fw_session;
- sfw_counters_t *cnt = &reply->str_fw;
+ struct sfw_counters *cnt = &reply->str_fw;
sfw_batch_t *bat;
struct timeval tv;
srpc_service_t *rpc_services[SRPC_SERVICE_MAX_ID + 1];
lnet_handle_eq_t rpc_lnet_eq; /* _the_ LNet event queue */
srpc_state_t rpc_state;
- srpc_counters_t rpc_counters;
+ struct srpc_counters rpc_counters;
__u64 rpc_matchbits; /* matchbits counter */
} srpc_data;
}
/* forward ref's */
-int srpc_handle_rpc (swi_workitem_t *wi);
+int srpc_handle_rpc(swi_workitem_t *wi);
-void srpc_get_counters (srpc_counters_t *cnt)
+void srpc_get_counters(struct srpc_counters *cnt)
{
spin_lock(&srpc_data.rpc_glock);
*cnt = srpc_data.rpc_counters;
spin_unlock(&srpc_data.rpc_glock);
}
-void srpc_set_counters (const srpc_counters_t *cnt)
+void srpc_set_counters(const struct srpc_counters *cnt)
{
spin_lock(&srpc_data.rpc_glock);
srpc_data.rpc_counters = *cnt;
typedef struct {
__u32 status;
- lst_sid_t sid;
+ struct lst_sid sid;
} WIRE_ATTR srpc_generic_reply_t;
/* FRAMEWORK RPCs */
typedef struct {
__u64 mksn_rpyid; /* reply buffer matchbits */
- lst_sid_t mksn_sid; /* session id */
+ struct lst_sid mksn_sid; /* session id */
__u32 mksn_force; /* use brute force */
char mksn_name[LST_NAME_SIZE];
} WIRE_ATTR srpc_mksn_reqst_t; /* make session request */
typedef struct {
__u32 mksn_status; /* session status */
- lst_sid_t mksn_sid; /* session id */
+ struct lst_sid mksn_sid; /* session id */
__u32 mksn_timeout; /* session timeout */
char mksn_name[LST_NAME_SIZE];
} WIRE_ATTR srpc_mksn_reply_t; /* make session reply */
typedef struct {
__u64 rmsn_rpyid; /* reply buffer matchbits */
- lst_sid_t rmsn_sid; /* session id */
+ struct lst_sid rmsn_sid; /* session id */
} WIRE_ATTR srpc_rmsn_reqst_t; /* remove session request */
typedef struct {
__u32 rmsn_status;
- lst_sid_t rmsn_sid; /* session id */
+ struct lst_sid rmsn_sid; /* session id */
} WIRE_ATTR srpc_rmsn_reply_t; /* remove session reply */
typedef struct {
__u64 join_rpyid; /* reply buffer matchbits */
- lst_sid_t join_sid; /* session id to join */
+ struct lst_sid join_sid; /* session id to join */
char join_group[LST_NAME_SIZE]; /* group name */
} WIRE_ATTR srpc_join_reqst_t;
typedef struct {
__u32 join_status; /* returned status */
- lst_sid_t join_sid; /* session id */
+ struct lst_sid join_sid; /* session id */
__u32 join_timeout; /* # seconds' inactivity to expire */
char join_session[LST_NAME_SIZE]; /* session name */
} WIRE_ATTR srpc_join_reply_t;
typedef struct {
__u64 dbg_rpyid; /* reply buffer matchbits */
- lst_sid_t dbg_sid; /* session id */
+ struct lst_sid dbg_sid; /* session id */
__u32 dbg_flags; /* bitmap of debug */
} WIRE_ATTR srpc_debug_reqst_t;
typedef struct {
__u32 dbg_status; /* returned code */
- lst_sid_t dbg_sid; /* session id */
+ struct lst_sid dbg_sid; /* session id */
__u32 dbg_timeout; /* session timeout */
__u32 dbg_nbatch; /* # of batches in the node */
char dbg_name[LST_NAME_SIZE]; /* session name */
typedef struct {
__u64 bar_rpyid; /* reply buffer matchbits */
- lst_sid_t bar_sid; /* session id */
- lst_bid_t bar_bid; /* batch id */
+ struct lst_sid bar_sid; /* session id */
+ struct lst_bid bar_bid; /* batch id */
__u32 bar_opc; /* create/start/stop batch */
__u32 bar_testidx; /* index of test */
__u32 bar_arg; /* parameters */
typedef struct {
__u32 bar_status; /* status of request */
- lst_sid_t bar_sid; /* session id */
+ struct lst_sid bar_sid; /* session id */
__u32 bar_active; /* # of active tests in batch/test */
__u32 bar_time; /* remained time */
} WIRE_ATTR srpc_batch_reply_t;
typedef struct {
__u64 str_rpyid; /* reply buffer matchbits */
- lst_sid_t str_sid; /* session id */
+ struct lst_sid str_sid; /* session id */
__u32 str_type; /* type of stat */
} WIRE_ATTR srpc_stat_reqst_t;
typedef struct {
__u32 str_status;
- lst_sid_t str_sid;
- sfw_counters_t str_fw;
- srpc_counters_t str_rpc;
+ struct lst_sid str_sid;
+ struct sfw_counters str_fw;
+ struct srpc_counters str_rpc;
lnet_counters_t str_lnet;
} WIRE_ATTR srpc_stat_reply_t;
typedef struct {
__u64 tsr_rpyid; /* reply buffer matchbits */
__u64 tsr_bulkid; /* bulk buffer matchbits */
- lst_sid_t tsr_sid; /* session id */
- lst_bid_t tsr_bid; /* batch id */
+ struct lst_sid tsr_sid; /* session id */
+ struct lst_bid tsr_bid; /* batch id */
__u32 tsr_service; /* test type: bulk|ping|... */
/* test client loop count or # server buffers needed */
__u32 tsr_loop;
typedef struct {
__u32 tsr_status; /* returned code */
- lst_sid_t tsr_sid;
+ struct lst_sid tsr_sid;
} WIRE_ATTR srpc_test_reply_t;
/* TEST RPCs */
typedef struct {
/* chain on fw_zombie_sessions */
struct list_head sn_list;
- lst_sid_t sn_id; /* unique identifier */
+ struct lst_sid sn_id; /* unique identifier */
/* # seconds' inactivity to expire */
unsigned int sn_timeout;
int sn_timer_active;
typedef struct {
struct list_head bat_list; /* chain on sn_batches */
- lst_bid_t bat_id; /* batch id */
+ struct lst_bid bat_id; /* batch id */
int bat_error; /* error code of batch */
sfw_session_t *bat_session; /* batch's session */
atomic_t bat_nactive; /* # of active tests */
int srpc_finish_service(srpc_service_t *sv);
int srpc_service_add_buffers(srpc_service_t *sv, int nbuffer);
void srpc_service_remove_buffers(srpc_service_t *sv, int nbuffer);
-void srpc_get_counters(srpc_counters_t *cnt);
-void srpc_set_counters(const srpc_counters_t *cnt);
+void srpc_get_counters(struct srpc_counters *cnt);
+void srpc_set_counters(const struct srpc_counters *cnt);
extern struct cfs_wi_sched *lst_sched_serial;
extern struct cfs_wi_sched **lst_sched_test;
#include <lnet/lnet.h>
#include <utils/obdctl.h>
-lst_sid_t LST_INVALID_SID = {LNET_NID_ANY, -1};
-static lst_sid_t session_id;
+struct lst_sid LST_INVALID_SID = {LNET_NID_ANY, -1};
+static struct lst_sid session_id;
static int session_key;
/* All nodes running 2.6.50 or later understand feature LST_FEAT_BULK_LEN */
static unsigned session_features = LST_FEATS_MASK;
-static lstcon_trans_stat_t trans_stat;
+static struct lstcon_trans_stat trans_stat;
typedef struct list_string {
struct list_string *lstr_next;
void
lst_free_rpcent(struct list_head *head)
{
- lstcon_rpc_ent_t *ent;
+ struct lstcon_rpc_ent *ent;
while (!list_empty(head)) {
- ent = list_entry(head->next, lstcon_rpc_ent_t, rpe_link);
+ ent = list_entry(head->next, struct lstcon_rpc_ent, rpe_link);
list_del(&ent->rpe_link);
free(ent);
void
lst_reset_rpcent(struct list_head *head)
{
- lstcon_rpc_ent_t *ent;
+ struct lstcon_rpc_ent *ent;
list_for_each_entry(ent, head, rpe_link) {
ent->rpe_sid = LST_INVALID_SID;
int
lst_alloc_rpcent(struct list_head *head, int count, int offset)
{
- lstcon_rpc_ent_t *ent;
+ struct lstcon_rpc_ent *ent;
int i;
for (i = 0; i < count; i++) {
- ent = malloc(offsetof(lstcon_rpc_ent_t, rpe_payload[offset]));
+ ent = malloc(offsetof(struct lstcon_rpc_ent, rpe_payload[offset]));
if (ent == NULL) {
lst_free_rpcent(head);
return -1;
}
- memset(ent, 0, offsetof(lstcon_rpc_ent_t, rpe_payload[offset]));
+ memset(ent, 0, offsetof(struct lstcon_rpc_ent, rpe_payload[offset]));
ent->rpe_sid = LST_INVALID_SID;
ent->rpe_peer.nid = LNET_NID_ANY;
void
lst_print_transerr(struct list_head *head, char *optstr)
{
- lstcon_rpc_ent_t *ent;
+ struct lstcon_rpc_ent *ent;
list_for_each_entry(ent, head, rpe_link) {
if (ent->rpe_rpc_errno == 0 && ent->rpe_fwk_errno == 0)
}
int lst_info_batch_ioctl(char *batch, int test, int server,
- lstcon_test_batch_ent_t *entp, int *idxp,
- int *ndentp, lstcon_node_ent_t *dentsp);
+ struct lstcon_test_batch_ent *entp, int *idxp,
+ int *ndentp, struct lstcon_node_ent *dentsp);
-int lst_info_group_ioctl(char *name, lstcon_ndlist_ent_t *gent,
- int *idx, int *count, lstcon_node_ent_t *dents);
+int lst_info_group_ioctl(char *name, struct lstcon_ndlist_ent *gent,
+ int *idx, int *count, struct lstcon_node_ent *dents);
int lst_query_batch_ioctl(char *batch, int test, int server,
int timeout, struct list_head *head);
}
int
-lst_new_session_ioctl(char *name, int timeout, int force, lst_sid_t *sid)
+lst_new_session_ioctl(char *name, int timeout, int force, struct lst_sid *sid)
{
- lstio_session_new_args_t args = {0};
+ struct lstio_session_new_args args = { 0 };
args.lstio_ses_key = session_key;
args.lstio_ses_timeout = timeout;
int
lst_session_info_ioctl(char *name, int len, int *key, unsigned *featp,
- lst_sid_t *sid, lstcon_ndlist_ent_t *ndinfo)
+ struct lst_sid *sid, struct lstcon_ndlist_ent *ndinfo)
{
- lstio_session_info_args_t args = {0};
+ struct lstio_session_info_args args = { 0 };
args.lstio_ses_idp = sid;
args.lstio_ses_keyp = key;
int
jt_lst_show_session(int argc, char **argv)
{
- lstcon_ndlist_ent_t ndinfo;
- lst_sid_t sid;
+ struct lstcon_ndlist_ent ndinfo;
+ struct lst_sid sid;
char name[LST_NAME_SIZE];
unsigned feats;
int key;
int
lst_end_session_ioctl(void)
{
- lstio_session_end_args_t args = {0};
+ struct lstio_session_end_args args = { 0 };
- args.lstio_ses_key = session_key;
- return lst_ioctl (LSTIO_SESSION_END, &args, sizeof(args));
+ args.lstio_ses_key = session_key;
+ return lst_ioctl(LSTIO_SESSION_END, &args, sizeof(args));
}
int
lst_ping_ioctl(char *str, int type, int timeout,
int count, lnet_process_id_t *ids, struct list_head *head)
{
- lstio_debug_args_t args = {0};
+ struct lstio_debug_args args = { 0 };
args.lstio_dbg_key = session_key;
args.lstio_dbg_type = type;
lst_get_node_count(int type, char *str, int *countp, lnet_process_id_t **idspp)
{
char buf[LST_NAME_SIZE];
- lstcon_test_batch_ent_t ent;
- lstcon_ndlist_ent_t *entp = &ent.tbe_cli_nle;
- lst_sid_t sid;
+ struct lstcon_test_batch_ent ent;
+ struct lstcon_ndlist_ent *entp = &ent.tbe_cli_nle;
+ struct lst_sid sid;
unsigned feats;
int key;
int rc;
{
struct list_head head;
lnet_process_id_t *ids = NULL;
- lstcon_rpc_ent_t *ent = NULL;
+ struct lstcon_rpc_ent *ent = NULL;
char *str = NULL;
int optidx = 0;
int server = 0;
}
int
-lst_add_nodes_ioctl (char *name, int count, lnet_process_id_t *ids,
- unsigned *featp, struct list_head *resultp)
+lst_add_nodes_ioctl(char *name, int count, lnet_process_id_t *ids,
+ unsigned *featp, struct list_head *resultp)
{
- lstio_group_nodes_args_t args = {0};
+ struct lstio_group_nodes_args args = { 0 };
args.lstio_grp_key = session_key;
args.lstio_grp_nmlen = strlen(name);
int
lst_del_group_ioctl(char *name)
{
- lstio_group_del_args_t args = {0};
+ struct lstio_group_del_args args = { 0 };
args.lstio_grp_key = session_key;
args.lstio_grp_nmlen = strlen(name);
}
int
-lst_add_group_ioctl (char *name)
+lst_add_group_ioctl(char *name)
{
- lstio_group_add_args_t args = {0};
+ struct lstio_group_add_args args = { 0 };
args.lstio_grp_key = session_key;
args.lstio_grp_nmlen = strlen(name);
lst_update_group_ioctl(int opc, char *name, int clean, int count,
lnet_process_id_t *ids, struct list_head *resultp)
{
- lstio_group_update_args_t args = {0};
+ struct lstio_group_update_args args = { 0 };
args.lstio_grp_key = session_key;
args.lstio_grp_opc = opc;
int
lst_list_group_ioctl(int len, char *name, int idx)
{
- lstio_group_list_args_t args = {0};
+ struct lstio_group_list_args args = { 0 };
args.lstio_grp_key = session_key;
args.lstio_grp_idx = idx;
}
int
-lst_info_group_ioctl(char *name, lstcon_ndlist_ent_t *gent,
- int *idx, int *count, lstcon_node_ent_t *dents)
+lst_info_group_ioctl(char *name, struct lstcon_ndlist_ent *gent,
+ int *idx, int *count, struct lstcon_node_ent *dents)
{
- lstio_group_info_args_t args = {0};
+ struct lstio_group_info_args args = { 0 };
args.lstio_grp_key = session_key;
args.lstio_grp_nmlen = strlen(name);
int
jt_lst_list_group(int argc, char **argv)
{
- lstcon_ndlist_ent_t gent;
- lstcon_node_ent_t *dents;
+ struct lstcon_ndlist_ent gent;
+ struct lstcon_node_ent *dents;
int optidx = 0;
int verbose = 0;
int active = 0;
count = gent.nle_nnode;
- dents = malloc(count * sizeof(lstcon_node_ent_t));
+ dents = malloc(count * sizeof(struct lstcon_node_ent));
if (dents == NULL) {
fprintf(stderr, "Failed to malloc: %s\n",
strerror(errno));
lst_stat_ioctl (char *name, int count, lnet_process_id_t *idsp,
int timeout, struct list_head *resultp)
{
- lstio_stat_args_t args = {0};
+ struct lstio_stat_args args = { 0 };
args.lstio_sta_key = session_key;
args.lstio_sta_timeout = timeout;
for (i = 0; i < count; i++) {
rc = lst_alloc_rpcent(&srp->srp_result[i], srp->srp_count,
- sizeof(sfw_counters_t) +
- sizeof(srpc_counters_t) +
+ sizeof(struct sfw_counters) +
+ sizeof(struct srpc_counters) +
sizeof(lnet_counters_t));
if (rc != 0) {
fprintf(stderr, "Out of memory\n");
int mbs)
{
struct list_head tmp[2];
- lstcon_rpc_ent_t *new;
- lstcon_rpc_ent_t *old;
- sfw_counters_t *sfwk_new;
- sfw_counters_t *sfwk_old;
- srpc_counters_t *srpc_new;
- srpc_counters_t *srpc_old;
+ struct lstcon_rpc_ent *new;
+ struct lstcon_rpc_ent *old;
+ struct sfw_counters *sfwk_new;
+ struct sfw_counters *sfwk_old;
+ struct srpc_counters *srpc_new;
+ struct srpc_counters *srpc_old;
lnet_counters_t *lnet_new;
lnet_counters_t *lnet_old;
float delta;
break;
}
- new = list_entry(resultp[idx].next, lstcon_rpc_ent_t,
+ new = list_entry(resultp[idx].next, struct lstcon_rpc_ent,
rpe_link);
- old = list_entry(resultp[1 - idx].next, lstcon_rpc_ent_t,
+ old = list_entry(resultp[1 - idx].next, struct lstcon_rpc_ent,
rpe_link);
/* first time get stats result, can't calculate diff */
continue;
}
- sfwk_new = (sfw_counters_t *)&new->rpe_payload[0];
- sfwk_old = (sfw_counters_t *)&old->rpe_payload[0];
+ sfwk_new = (struct sfw_counters *)&new->rpe_payload[0];
+ sfwk_old = (struct sfw_counters *)&old->rpe_payload[0];
- srpc_new = (srpc_counters_t *)((char *)sfwk_new + sizeof(*sfwk_new));
- srpc_old = (srpc_counters_t *)((char *)sfwk_old + sizeof(*sfwk_old));
+ srpc_new = (struct srpc_counters *)((char *)sfwk_new + sizeof(*sfwk_new));
+ srpc_old = (struct srpc_counters *)((char *)sfwk_old + sizeof(*sfwk_old));
lnet_new = (lnet_counters_t *)((char *)srpc_new + sizeof(*srpc_new));
lnet_old = (lnet_counters_t *)((char *)srpc_old + sizeof(*srpc_old));
{
struct list_head head;
lst_stat_req_param_t *srp;
- lstcon_rpc_ent_t *ent;
- sfw_counters_t *sfwk;
- srpc_counters_t *srpc;
+ struct lstcon_rpc_ent *ent;
+ struct sfw_counters *sfwk;
+ struct srpc_counters *srpc;
int show_rpc = 1;
int optidx = 0;
int rc = 0;
continue;
}
- sfwk = (sfw_counters_t *)&ent->rpe_payload[0];
- srpc = (srpc_counters_t *)((char *)sfwk + sizeof(*sfwk));
+ sfwk = (struct sfw_counters *)&ent->rpe_payload[0];
+ srpc = (struct srpc_counters *)((char *)sfwk + sizeof(*sfwk));
if (srpc->errors == 0 &&
sfwk->brw_errors == 0 && sfwk->ping_errors == 0)
}
int
-lst_add_batch_ioctl (char *name)
+lst_add_batch_ioctl(char *name)
{
- lstio_batch_add_args_t args = {0};
+ struct lstio_batch_add_args args = { 0 };
args.lstio_bat_key = session_key;
args.lstio_bat_nmlen = strlen(name);
int
lst_start_batch_ioctl(char *name, int timeout, struct list_head *resultp)
{
- lstio_batch_run_args_t args = {0};
+ struct lstio_batch_run_args args = { 0 };
args.lstio_bat_key = session_key;
args.lstio_bat_timeout = timeout;
int
lst_stop_batch_ioctl(char *name, int force, struct list_head *resultp)
{
- lstio_batch_stop_args_t args = {0};
+ struct lstio_batch_stop_args args = { 0 };
args.lstio_bat_key = session_key;
args.lstio_bat_force = force;
int
lst_list_batch_ioctl(int len, char *name, int index)
{
- lstio_batch_list_args_t args = {0};
+ struct lstio_batch_list_args args = { 0 };
args.lstio_bat_key = session_key;
args.lstio_bat_idx = index;
int
lst_info_batch_ioctl(char *batch, int test, int server,
- lstcon_test_batch_ent_t *entp, int *idxp,
- int *ndentp, lstcon_node_ent_t *dentsp)
+ struct lstcon_test_batch_ent *entp, int *idxp,
+ int *ndentp, struct lstcon_node_ent *dentsp)
{
- lstio_batch_info_args_t args = {0};
+ struct lstio_batch_info_args args = { 0 };
args.lstio_bat_key = session_key;
args.lstio_bat_nmlen = strlen(batch);
lst_list_tsb_nodes(char *batch, int test, int server,
int count, int active, int invalid)
{
- lstcon_node_ent_t *dents;
+ struct lstcon_node_ent *dents;
int index = 0;
int rc;
int c;
return 0;
/* verbose list, show nodes in batch or test */
- dents = malloc(count * sizeof(lstcon_node_ent_t));
+ dents = malloc(count * sizeof(struct lstcon_node_ent));
if (dents == NULL) {
fprintf(stdout, "Can't allocate memory\n");
return -1;
int
jt_lst_list_batch(int argc, char **argv)
{
- lstcon_test_batch_ent_t ent;
+ struct lstcon_test_batch_ent ent;
char *batch = NULL;
int optidx = 0;
int verbose = 0; /* list nodes in batch or test */
lst_query_batch_ioctl(char *batch, int test, int server,
int timeout, struct list_head *head)
{
- lstio_batch_query_args_t args = {0};
+ struct lstio_batch_query_args args = { 0 };
args.lstio_bat_key = session_key;
args.lstio_bat_testidx = test;
lst_print_tsb_verbose(struct list_head *head,
int active, int idle, int error)
{
- lstcon_rpc_ent_t *ent;
+ struct lstcon_rpc_ent *ent;
list_for_each_entry(ent, head, rpe_link) {
if (ent->rpe_priv[0] == 0 && active)
int
jt_lst_query_batch(int argc, char **argv)
{
- lstcon_test_batch_ent_t ent;
+ struct lstcon_test_batch_ent ent;
struct list_head head;
char *batch = NULL;
time_t last = 0;
}
int
-lst_get_bulk_param(int argc, char **argv, lst_test_bulk_param_t *bulk)
+lst_get_bulk_param(int argc, char **argv, struct lst_test_bulk_param *bulk)
{
char *tok = NULL;
char *end = NULL;
int
lst_get_test_param(char *test, int argc, char **argv, void **param, int *plen)
{
- lst_test_bulk_param_t *bulk = NULL;
+ struct lst_test_bulk_param *bulk = NULL;
int type;
type = lst_test_name2type(test);
int dist, int span, char *sgrp, char *dgrp,
void *param, int plen, int *retp, struct list_head *resultp)
{
- lstio_test_args_t args = {0};
+ struct lstio_test_args args = { 0 };
args.lstio_tes_key = session_key;
args.lstio_tes_bat_nmlen = strlen(batch);