staging: lustre: selftest: convert swi_workitem_t to proper struct
authorJames Simmons <jsimmons@infradead.org>
Wed, 6 Apr 2016 19:25:31 +0000 (15:25 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Apr 2016 04:00:56 +0000 (21:00 -0700)
Turn typedef swi_workitem_t to proper structure

Signed-off-by: James Simmons <uja.ornl@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lnet/selftest/framework.c
drivers/staging/lustre/lnet/selftest/rpc.c
drivers/staging/lustre/lnet/selftest/selftest.h

index 6472108f19b559ead824e0b483061711cba303d1..c8f8a8d26a2b4a28b59a295a0b9dfd7615a67583 100644 (file)
@@ -942,7 +942,7 @@ sfw_create_test_rpc(sfw_test_unit_t *tsu, lnet_process_id_t peer,
 }
 
 static int
-sfw_run_test(swi_workitem_t *wi)
+sfw_run_test(struct swi_workitem *wi)
 {
        sfw_test_unit_t *tsu = wi->swi_workitem.wi_data;
        sfw_test_instance_t *tsi = tsu->tsu_instance;
@@ -993,7 +993,7 @@ test_done:
 static int
 sfw_run_batch(sfw_batch_t *tsb)
 {
-       swi_workitem_t *wi;
+       struct swi_workitem *wi;
        sfw_test_unit_t *tsu;
        sfw_test_instance_t *tsi;
 
index 5dcb892de61d87d491ae2c3b9c49a387daebeeef..72a38e430b27dfd0e573eb45b25aa66f6ba85d0e 100644 (file)
@@ -71,7 +71,7 @@ srpc_serv_portal(int svc_id)
 }
 
 /* forward ref's */
-int srpc_handle_rpc(swi_workitem_t *wi);
+int srpc_handle_rpc(struct swi_workitem *wi);
 
 void srpc_get_counters(srpc_counters_t *cnt)
 {
@@ -963,7 +963,7 @@ srpc_server_rpc_done(struct srpc_server_rpc *rpc, int status)
 
 /* handles an incoming RPC */
 int
-srpc_handle_rpc(swi_workitem_t *wi)
+srpc_handle_rpc(struct swi_workitem *wi)
 {
        struct srpc_server_rpc *rpc = wi->swi_workitem.wi_data;
        struct srpc_service_cd *scd = rpc->srpc_scd;
@@ -1140,7 +1140,7 @@ srpc_del_client_rpc_timer(srpc_client_rpc_t *rpc)
 static void
 srpc_client_rpc_done(srpc_client_rpc_t *rpc, int status)
 {
-       swi_workitem_t *wi = &rpc->crpc_wi;
+       struct swi_workitem *wi = &rpc->crpc_wi;
 
        LASSERT(status || wi->swi_state == SWI_STATE_DONE);
 
@@ -1175,7 +1175,7 @@ srpc_client_rpc_done(srpc_client_rpc_t *rpc, int status)
 
 /* sends an outgoing RPC */
 int
-srpc_send_rpc(swi_workitem_t *wi)
+srpc_send_rpc(struct swi_workitem *wi)
 {
        int rc = 0;
        srpc_client_rpc_t *rpc;
index 098231508d2ce209868c94e5ab41a9bf705d66ce..fcbaf5eed601cc779d9679aaae4264fadc132b24 100644 (file)
@@ -175,19 +175,19 @@ struct srpc_buffer {
 struct swi_workitem;
 typedef int (*swi_action_t) (struct swi_workitem *);
 
-typedef struct swi_workitem {
+struct swi_workitem {
        struct cfs_wi_sched *swi_sched;
        struct cfs_workitem swi_workitem;
        swi_action_t        swi_action;
        int                 swi_state;
-} swi_workitem_t;
+};
 
 /* server-side state of a RPC */
 struct srpc_server_rpc {
        /* chain on srpc_service::*_rpcq */
        struct list_head       srpc_list;
        struct srpc_service_cd *srpc_scd;
-       swi_workitem_t         srpc_wi;
+       struct swi_workitem     srpc_wi;
        struct srpc_event       srpc_ev;        /* bulk/reply event */
        lnet_nid_t             srpc_self;
        lnet_process_id_t      srpc_peer;
@@ -209,7 +209,7 @@ typedef struct srpc_client_rpc {
        atomic_t          crpc_refcount;
        int               crpc_timeout;   /* # seconds to wait for reply */
        struct stt_timer       crpc_timer;
-       swi_workitem_t    crpc_wi;
+       struct swi_workitem     crpc_wi;
        lnet_process_id_t crpc_dest;
 
        void              (*crpc_done)(struct srpc_client_rpc *);
@@ -273,7 +273,7 @@ struct srpc_service_cd {
        /** in-flight RPCs */
        struct list_head        scd_rpc_active;
        /** workitem for posting buffer */
-       swi_workitem_t          scd_buf_wi;
+       struct swi_workitem     scd_buf_wi;
        /** CPT id */
        int                     scd_cpt;
        /** error code for scd_buf_wi */
@@ -404,7 +404,7 @@ typedef struct sfw_test_unit {
        int                 tsu_loop;      /* loop count of the test */
        sfw_test_instance_t *tsu_instance; /* pointer to test instance */
        void                *tsu_private;  /* private data */
-       swi_workitem_t      tsu_worker;    /* workitem of the test unit */
+       struct swi_workitem     tsu_worker;     /* workitem of the test unit */
 } sfw_test_unit_t;
 
 typedef struct sfw_test_case {
@@ -440,7 +440,7 @@ void srpc_abort_rpc(srpc_client_rpc_t *rpc, int why);
 void srpc_free_bulk(struct srpc_bulk *bk);
 struct srpc_bulk *srpc_alloc_bulk(int cpt, unsigned bulk_npg,
                                  unsigned bulk_len, int sink);
-int srpc_send_rpc(swi_workitem_t *wi);
+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);
@@ -464,13 +464,15 @@ srpc_serv_is_framework(struct srpc_service *svc)
 static inline int
 swi_wi_action(struct cfs_workitem *wi)
 {
-       swi_workitem_t *swi = container_of(wi, swi_workitem_t, swi_workitem);
+       struct swi_workitem *swi;
+
+       swi = container_of(wi, struct swi_workitem, swi_workitem);
 
        return swi->swi_action(swi);
 }
 
 static inline void
-swi_init_workitem(swi_workitem_t *swi, void *data,
+swi_init_workitem(struct swi_workitem *swi, void *data,
                  swi_action_t action, struct cfs_wi_sched *sched)
 {
        swi->swi_sched = sched;
@@ -480,19 +482,19 @@ swi_init_workitem(swi_workitem_t *swi, void *data,
 }
 
 static inline void
-swi_schedule_workitem(swi_workitem_t *wi)
+swi_schedule_workitem(struct swi_workitem *wi)
 {
        cfs_wi_schedule(wi->swi_sched, &wi->swi_workitem);
 }
 
 static inline void
-swi_exit_workitem(swi_workitem_t *swi)
+swi_exit_workitem(struct swi_workitem *swi)
 {
        cfs_wi_exit(swi->swi_sched, &swi->swi_workitem);
 }
 
 static inline int
-swi_deschedule_workitem(swi_workitem_t *swi)
+swi_deschedule_workitem(struct swi_workitem *swi)
 {
        return cfs_wi_deschedule(swi->swi_sched, &swi->swi_workitem);
 }
This page took 0.035323 seconds and 5 git commands to generate.