Commit 682513b8 authored by James Simmons's avatar James Simmons Committed by Greg Kroah-Hartman

staging: lustre: selftest: convert srpc_service_t to proper struct

Turn typedef srpc_service_t to proper structure
Signed-off-by: default avatarJames Simmons <uja.ornl@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 20234da5
......@@ -497,7 +497,8 @@ void brw_init_test_client(void)
brw_test_client.tso_done_rpc = brw_client_done_rpc;
};
srpc_service_t brw_test_service;
struct srpc_service brw_test_service;
void brw_init_test_service(void)
{
brw_test_service.sv_id = SRPC_SERVICE_BRW;
......
......@@ -1986,7 +1986,8 @@ lstcon_acceptor_handle(struct srpc_server_rpc *rpc)
return rc;
}
static srpc_service_t lstcon_acceptor_service;
static struct srpc_service lstcon_acceptor_service;
static void lstcon_init_acceptor_service(void)
{
/* initialize selftest console acceptor service table */
......
......@@ -135,7 +135,7 @@ sfw_find_test_case(int id)
}
static int
sfw_register_test(srpc_service_t *service, sfw_test_client_ops_t *cliops)
sfw_register_test(struct srpc_service *service, sfw_test_client_ops_t *cliops)
{
sfw_test_case_t *tsc;
......@@ -1584,7 +1584,7 @@ sfw_post_rpc(struct srpc_client_rpc *rpc)
spin_unlock(&rpc->crpc_lock);
}
static srpc_service_t sfw_services[] = {
static struct srpc_service sfw_services[] = {
{
/* sv_id */ SRPC_SERVICE_DEBUG,
/* sv_name */ "debug",
......@@ -1628,7 +1628,7 @@ sfw_startup(void)
int i;
int rc;
int error;
srpc_service_t *sv;
struct srpc_service *sv;
sfw_test_case_t *tsc;
if (session_timeout < 0) {
......@@ -1721,7 +1721,7 @@ sfw_startup(void)
void
sfw_shutdown(void)
{
srpc_service_t *sv;
struct srpc_service *sv;
sfw_test_case_t *tsc;
int i;
......
......@@ -219,7 +219,8 @@ void ping_init_test_client(void)
ping_test_client.tso_done_rpc = ping_client_done_rpc;
}
srpc_service_t ping_test_service;
struct srpc_service ping_test_service;
void ping_init_test_service(void)
{
ping_test_service.sv_id = SRPC_SERVICE_PING;
......
......@@ -56,7 +56,7 @@ typedef enum {
static struct smoketest_rpc {
spinlock_t rpc_glock; /* global lock */
srpc_service_t *rpc_services[SRPC_SERVICE_MAX_ID + 1];
struct srpc_service *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;
......@@ -338,7 +338,7 @@ srpc_add_service(struct srpc_service *sv)
}
int
srpc_remove_service(srpc_service_t *sv)
srpc_remove_service(struct srpc_service *sv)
{
int id = sv->sv_id;
......@@ -755,7 +755,7 @@ srpc_abort_service(struct srpc_service *sv)
}
void
srpc_shutdown_service(srpc_service_t *sv)
srpc_shutdown_service(struct srpc_service *sv)
{
struct srpc_service_cd *scd;
struct srpc_server_rpc *rpc;
......@@ -1414,7 +1414,7 @@ srpc_lnet_ev_handler(lnet_event_t *ev)
struct srpc_client_rpc *crpc;
struct srpc_server_rpc *srpc;
struct srpc_buffer *buffer;
srpc_service_t *sv;
struct srpc_service *sv;
srpc_msg_t *msg;
srpc_msg_type_t type;
......@@ -1663,7 +1663,7 @@ srpc_shutdown(void)
spin_lock(&srpc_data.rpc_glock);
for (i = 0; i <= SRPC_SERVICE_MAX_ID; i++) {
srpc_service_t *sv = srpc_data.rpc_services[i];
struct srpc_service *sv = srpc_data.rpc_services[i];
LASSERTF(!sv, "service not empty: id %d, name %s\n",
i, sv->sv_name);
......
......@@ -307,7 +307,7 @@ struct srpc_service_cd {
#define SFW_FRWK_WI_MIN 16
#define SFW_FRWK_WI_MAX 256
typedef struct srpc_service {
struct srpc_service {
int sv_id; /* service id */
const char *sv_name; /* human readable name */
int sv_wi_total; /* total server workitems */
......@@ -321,7 +321,7 @@ typedef struct srpc_service {
*/
int (*sv_handler)(struct srpc_server_rpc *);
int (*sv_bulk_ready)(struct srpc_server_rpc *, int);
} srpc_service_t;
};
typedef struct {
struct list_head sn_list; /* chain on fw_zombie_sessions */
......@@ -409,7 +409,7 @@ typedef struct sfw_test_unit {
typedef struct sfw_test_case {
struct list_head tsc_list; /* chain on fw_tests */
srpc_service_t *tsc_srv_service; /* test service */
struct srpc_service *tsc_srv_service; /* test service */
sfw_test_client_ops_t *tsc_cli_ops; /* ops of test client */
} sfw_test_case_t;
......@@ -442,13 +442,13 @@ struct srpc_bulk *srpc_alloc_bulk(int cpt, unsigned bulk_npg,
unsigned bulk_len, int sink);
int srpc_send_rpc(struct swi_workitem *wi);
int srpc_send_reply(struct srpc_server_rpc *rpc);
int srpc_add_service(srpc_service_t *sv);
int srpc_remove_service(srpc_service_t *sv);
void srpc_shutdown_service(srpc_service_t *sv);
void srpc_abort_service(srpc_service_t *sv);
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);
int srpc_add_service(struct srpc_service *sv);
int srpc_remove_service(struct srpc_service *sv);
void srpc_shutdown_service(struct srpc_service *sv);
void srpc_abort_service(struct srpc_service *sv);
int srpc_finish_service(struct srpc_service *sv);
int srpc_service_add_buffers(struct srpc_service *sv, int nbuffer);
void srpc_service_remove_buffers(struct srpc_service *sv, int nbuffer);
void srpc_get_counters(srpc_counters_t *cnt);
void srpc_set_counters(const srpc_counters_t *cnt);
......@@ -595,7 +595,7 @@ do { \
} while (0)
static inline void
srpc_wait_service_shutdown(srpc_service_t *sv)
srpc_wait_service_shutdown(struct srpc_service *sv)
{
int i = 2;
......@@ -613,13 +613,13 @@ srpc_wait_service_shutdown(srpc_service_t *sv)
extern sfw_test_client_ops_t brw_test_client;
void brw_init_test_client(void);
extern srpc_service_t brw_test_service;
extern struct srpc_service brw_test_service;
void brw_init_test_service(void);
extern sfw_test_client_ops_t ping_test_client;
void ping_init_test_client(void);
extern srpc_service_t ping_test_service;
extern struct srpc_service ping_test_service;
void ping_init_test_service(void);
#endif /* __SELFTEST_SELFTEST_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment