mirror of https://gitee.com/openkylin/linux.git
staging: lustre: lnet: change lstcon_trans_stat_t to proper structure
Change lstcon_trans_stat_t from typedef to proper structure. Signed-off-by: James Simmons <uja.ornl@yahoo.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142 Reviewed-on: https://review.whamcloud.com/24188 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
ef9114c2fe
commit
4f6c6934e3
|
@ -137,7 +137,7 @@ struct lstcon_rpc_ent {
|
||||||
char rpe_payload[0]; /* private reply payload */
|
char rpe_payload[0]; /* private reply payload */
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct {
|
struct lstcon_trans_stat {
|
||||||
int trs_rpc_stat[4]; /* RPCs stat (0: total
|
int trs_rpc_stat[4]; /* RPCs stat (0: total
|
||||||
1: failed
|
1: failed
|
||||||
2: finished
|
2: finished
|
||||||
|
@ -146,94 +146,94 @@ typedef struct {
|
||||||
int trs_fwk_stat[8]; /* framework stat */
|
int trs_fwk_stat[8]; /* framework stat */
|
||||||
int trs_fwk_errno; /* errno of the first remote error */
|
int trs_fwk_errno; /* errno of the first remote error */
|
||||||
void *trs_fwk_private; /* private framework stat */
|
void *trs_fwk_private; /* private framework stat */
|
||||||
} lstcon_trans_stat_t;
|
};
|
||||||
|
|
||||||
static inline int
|
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];
|
return inc ? ++stat->trs_rpc_stat[0] : stat->trs_rpc_stat[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
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];
|
return inc ? ++stat->trs_rpc_stat[1] : stat->trs_rpc_stat[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
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];
|
return inc ? ++stat->trs_rpc_stat[2] : stat->trs_rpc_stat[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
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];
|
return inc ? ++stat->trs_fwk_stat[0] : stat->trs_fwk_stat[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
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];
|
return inc ? ++stat->trs_fwk_stat[1] : stat->trs_fwk_stat[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
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];
|
return inc ? ++stat->trs_fwk_stat[0] : stat->trs_fwk_stat[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
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];
|
return inc ? ++stat->trs_fwk_stat[1] : stat->trs_fwk_stat[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
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];
|
return inc ? ++stat->trs_fwk_stat[2] : stat->trs_fwk_stat[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
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];
|
return inc ? ++stat->trs_fwk_stat[0] : stat->trs_fwk_stat[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
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];
|
return inc ? ++stat->trs_fwk_stat[1] : stat->trs_fwk_stat[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
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];
|
return inc ? ++stat->trs_fwk_stat[0] : stat->trs_fwk_stat[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
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];
|
return inc ? ++stat->trs_fwk_stat[1] : stat->trs_fwk_stat[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
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];
|
return inc ? ++stat->trs_fwk_stat[2] : stat->trs_fwk_stat[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
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];
|
return inc ? ++stat->trs_fwk_stat[0] : stat->trs_fwk_stat[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
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];
|
return inc ? ++stat->trs_fwk_stat[1] : stat->trs_fwk_stat[1];
|
||||||
}
|
}
|
||||||
|
|
|
@ -851,7 +851,7 @@ lstcon_ioctl_entry(unsigned int cmd, struct libcfs_ioctl_hdr *hdr)
|
||||||
goto out;
|
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) {
|
switch (opc) {
|
||||||
case LSTIO_SESSION_NEW:
|
case LSTIO_SESSION_NEW:
|
||||||
|
@ -913,7 +913,7 @@ lstcon_ioctl_entry(unsigned int cmd, struct libcfs_ioctl_hdr *hdr)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (copy_to_user(data->ioc_pbuf2, &console_session.ses_trans_stat,
|
if (copy_to_user(data->ioc_pbuf2, &console_session.ses_trans_stat,
|
||||||
sizeof(lstcon_trans_stat_t)))
|
sizeof(struct lstcon_trans_stat)))
|
||||||
rc = -EFAULT;
|
rc = -EFAULT;
|
||||||
out:
|
out:
|
||||||
mutex_unlock(&console_session.ses_mutex);
|
mutex_unlock(&console_session.ses_mutex);
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
#include "console.h"
|
#include "console.h"
|
||||||
|
|
||||||
void lstcon_rpc_stat_reply(struct lstcon_rpc_trans *, struct srpc_msg *,
|
void lstcon_rpc_stat_reply(struct lstcon_rpc_trans *, struct srpc_msg *,
|
||||||
struct lstcon_node *, lstcon_trans_stat_t *);
|
struct lstcon_node *, struct lstcon_trans_stat *);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
lstcon_rpc_done(struct srpc_client_rpc *rpc)
|
lstcon_rpc_done(struct srpc_client_rpc *rpc)
|
||||||
|
@ -420,7 +420,7 @@ lstcon_rpc_get_reply(struct lstcon_rpc *crpc, struct srpc_msg **msgpp)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
lstcon_rpc_trans_stat(struct lstcon_rpc_trans *trans, lstcon_trans_stat_t *stat)
|
lstcon_rpc_trans_stat(struct lstcon_rpc_trans *trans, struct lstcon_trans_stat *stat)
|
||||||
{
|
{
|
||||||
struct lstcon_rpc *crpc;
|
struct lstcon_rpc *crpc;
|
||||||
struct srpc_msg *rep;
|
struct srpc_msg *rep;
|
||||||
|
@ -964,7 +964,7 @@ lstcon_sesnew_stat_reply(struct lstcon_rpc_trans *trans,
|
||||||
|
|
||||||
void
|
void
|
||||||
lstcon_rpc_stat_reply(struct lstcon_rpc_trans *trans, struct srpc_msg *msg,
|
lstcon_rpc_stat_reply(struct lstcon_rpc_trans *trans, struct srpc_msg *msg,
|
||||||
struct lstcon_node *nd, lstcon_trans_stat_t *stat)
|
struct lstcon_node *nd, struct lstcon_trans_stat *stat)
|
||||||
{
|
{
|
||||||
struct srpc_rmsn_reply *rmsn_rep;
|
struct srpc_rmsn_reply *rmsn_rep;
|
||||||
struct srpc_debug_reply *dbg_rep;
|
struct srpc_debug_reply *dbg_rep;
|
||||||
|
@ -1320,7 +1320,7 @@ lstcon_rpc_pinger_stop(void)
|
||||||
lstcon_rpc_trans_stat(console_session.ses_ping, lstcon_trans_stat());
|
lstcon_rpc_trans_stat(console_session.ses_ping, lstcon_trans_stat());
|
||||||
lstcon_rpc_trans_destroy(console_session.ses_ping);
|
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;
|
console_session.ses_ping = NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,7 +125,7 @@ int lstcon_rpc_trans_ndlist(struct list_head *ndlist,
|
||||||
void *arg, lstcon_rpc_cond_func_t condition,
|
void *arg, lstcon_rpc_cond_func_t condition,
|
||||||
struct lstcon_rpc_trans **transpp);
|
struct lstcon_rpc_trans **transpp);
|
||||||
void lstcon_rpc_trans_stat(struct lstcon_rpc_trans *trans,
|
void lstcon_rpc_trans_stat(struct lstcon_rpc_trans *trans,
|
||||||
lstcon_trans_stat_t *stat);
|
struct lstcon_trans_stat *stat);
|
||||||
int lstcon_rpc_trans_interpreter(struct lstcon_rpc_trans *trans,
|
int lstcon_rpc_trans_interpreter(struct lstcon_rpc_trans *trans,
|
||||||
struct list_head __user *head_up,
|
struct list_head __user *head_up,
|
||||||
lstcon_rpc_readent_func_t readent);
|
lstcon_rpc_readent_func_t readent);
|
||||||
|
|
|
@ -158,7 +158,7 @@ struct lstcon_session {
|
||||||
char ses_name[LST_NAME_SIZE];/* session name */
|
char ses_name[LST_NAME_SIZE];/* session name */
|
||||||
struct lstcon_rpc_trans *ses_ping; /* session pinger */
|
struct lstcon_rpc_trans *ses_ping; /* session pinger */
|
||||||
struct stt_timer ses_ping_timer; /* timer for pinger */
|
struct stt_timer 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_trans_list; /* global list of transaction */
|
||||||
struct list_head ses_grp_list; /* global list of groups */
|
struct list_head ses_grp_list; /* global list of groups */
|
||||||
|
@ -173,7 +173,7 @@ struct lstcon_session {
|
||||||
|
|
||||||
extern struct lstcon_session console_session;
|
extern struct lstcon_session console_session;
|
||||||
|
|
||||||
static inline lstcon_trans_stat_t *
|
static inline struct lstcon_trans_stat *
|
||||||
lstcon_trans_stat(void)
|
lstcon_trans_stat(void)
|
||||||
{
|
{
|
||||||
return &console_session.ses_trans_stat;
|
return &console_session.ses_trans_stat;
|
||||||
|
|
Loading…
Reference in New Issue