Commit 74d68011 authored by Mike Shuey's avatar Mike Shuey Committed by Greg Kroah-Hartman

staging: lustre: lnet: selftest: code cleanup - variable spacing, indentation

Unify spacing in variable declarations, and align indentation in headers.
General whitespace cleanups.
Signed-off-by: default avatarMike Shuey <shuey@purdue.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 97d10d0a
......@@ -789,7 +789,8 @@ lstcon_bulkrpc_v0_prep(lst_test_bulk_param_t *param, srpc_test_reqst_t *req)
test_bulk_req_t *brq = &req->tsr_u.bulk_v0;
brq->blk_opc = param->blk_opc;
brq->blk_npg = (param->blk_size + PAGE_CACHE_SIZE - 1) / PAGE_CACHE_SIZE;
brq->blk_npg = (param->blk_size + PAGE_CACHE_SIZE - 1) /
PAGE_CACHE_SIZE;
brq->blk_flags = param->blk_flags;
return 0;
......@@ -835,8 +836,10 @@ lstcon_testrpc_prep(lstcon_node_t *nd, int transop, unsigned feats,
trq = &(*crpc)->crp_rpc->crpc_reqstmsg.msg_body.tes_reqst;
if (transop == LST_TRANS_TSBSRVADD) {
int ndist = (sgrp->grp_nnode + test->tes_dist - 1) / test->tes_dist;
int nspan = (dgrp->grp_nnode + test->tes_span - 1) / test->tes_span;
int ndist = (sgrp->grp_nnode + test->tes_dist - 1) /
test->tes_dist;
int nspan = (dgrp->grp_nnode + test->tes_span - 1) /
test->tes_span;
int nmax = (ndist + nspan - 1) / nspan;
trq->tsr_ndest = 0;
......@@ -851,7 +854,8 @@ lstcon_testrpc_prep(lstcon_node_t *nd, int transop, unsigned feats,
LASSERT(nob > 0);
len = (feats & LST_FEAT_BULK_LEN) == 0 ?
PAGE_CACHE_SIZE : min_t(int, nob, PAGE_CACHE_SIZE);
PAGE_CACHE_SIZE :
min_t(int, nob, PAGE_CACHE_SIZE);
nob -= len;
bulk->bk_iovs[i].kiov_offset = 0;
......
......@@ -82,10 +82,8 @@ typedef struct lstcon_rpc_trans {
struct list_head tas_olink; /* link chain on owner list */
struct list_head tas_link; /* link chain on global list */
int tas_opc; /* operation code of transaction */
/* features mask is uptodate */
unsigned tas_feats_updated;
/* test features mask */
unsigned tas_features;
unsigned tas_feats_updated; /* features mask is uptodate */
unsigned tas_features; /* test features mask */
wait_queue_head_t tas_waitq; /* wait queue head */
atomic_t tas_remaining; /* # of un-scheduled rpcs */
struct list_head tas_rpcs_list; /* queued requests */
......
......@@ -58,16 +58,17 @@ typedef struct lstcon_node {
int nd_timeout; /* session timeout */
unsigned long nd_stamp; /* timestamp of last replied RPC */
struct lstcon_rpc nd_ping; /* ping rpc */
} lstcon_node_t; /*** node descriptor */
} lstcon_node_t; /* node descriptor */
typedef struct {
struct list_head ndl_link; /* chain on list */
struct list_head ndl_hlink; /* chain on hash */
lstcon_node_t *ndl_node; /* pointer to node */
} lstcon_ndlink_t; /*** node link descriptor */
} lstcon_ndlink_t; /* node link descriptor */
typedef struct {
struct list_head grp_link; /* chain on global group list */
struct list_head grp_link; /* chain on global group list
*/
int grp_ref; /* reference count */
int grp_userland; /* has userland nodes */
int grp_nnode; /* # of nodes */
......@@ -75,8 +76,8 @@ typedef struct {
struct list_head grp_trans_list; /* transaction list */
struct list_head grp_ndl_list; /* nodes list */
struct list_head grp_ndl_hash[0];/* hash table for nodes */
} lstcon_group_t; /*** (alias of nodes) group descriptor */
struct list_head grp_ndl_hash[0]; /* hash table for nodes */
} lstcon_group_t; /* (alias of nodes) group descriptor */
#define LST_BATCH_IDLE 0xB0 /* idle batch */
#define LST_BATCH_RUNNING 0xB1 /* running batch */
......@@ -91,16 +92,19 @@ typedef struct {
struct list_head bat_link; /* chain on session's batches list */
int bat_ntest; /* # of test */
int bat_state; /* state of the batch */
int bat_arg; /* parameter for run|stop, timeout for run, force for stop */
char bat_name[LST_NAME_SIZE]; /* name of batch */
int bat_arg; /* parameter for run|stop, timeout
* for run, force for stop */
char bat_name[LST_NAME_SIZE];/* name of batch */
struct list_head bat_test_list; /* list head of tests (lstcon_test_t) */
struct list_head bat_test_list; /* list head of tests (lstcon_test_t)
*/
struct list_head bat_trans_list; /* list head of transaction */
struct list_head bat_cli_list; /* list head of client nodes (lstcon_node_t) */
struct list_head bat_cli_list; /* list head of client nodes
* (lstcon_node_t) */
struct list_head *bat_cli_hash; /* hash table of client nodes */
struct list_head bat_srv_list; /* list head of server nodes */
struct list_head *bat_srv_hash; /* hash table of server nodes */
} lstcon_batch_t; /*** (tests ) batch descriptor */
} lstcon_batch_t; /* (tests ) batch descriptor */
typedef struct lstcon_test {
lstcon_tsb_hdr_t tes_hdr; /* test batch header */
......@@ -122,7 +126,7 @@ typedef struct lstcon_test {
int tes_paramlen; /* test parameter length */
char tes_param[0]; /* test parameter */
} lstcon_test_t; /*** a single test descriptor */
} lstcon_test_t; /* a single test descriptor */
#define LST_GLOBAL_HASHSIZE 503 /* global nodes hash table size */
#define LST_NODE_HASHSIZE 239 /* node hash table (for batch or group) */
......@@ -138,19 +142,17 @@ typedef struct {
int ses_key; /* local session key */
int ses_state; /* state of session */
int ses_timeout; /* timeout in seconds */
time_t ses_laststamp; /* last operation stamp (seconds) */
/** tests features of the session */
unsigned ses_features;
/** features are synced with remote test nodes */
unsigned ses_feats_updated:1;
/** force creating */
unsigned ses_force:1;
/** session is shutting down */
unsigned ses_shutdown:1;
/** console is timedout */
unsigned ses_expired:1;
time_t ses_laststamp; /* last operation stamp (seconds)
*/
unsigned ses_features; /* tests features of the session
*/
unsigned ses_feats_updated:1; /* features are synced with
* remote test nodes */
unsigned ses_force:1; /* force creating */
unsigned ses_shutdown:1; /* session is shutting down */
unsigned ses_expired:1; /* console is timedout */
__u64 ses_id_cookie; /* batch id cookie */
char ses_name[LST_NAME_SIZE]; /* session name */
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 */
......@@ -162,9 +164,9 @@ typedef struct {
struct list_head *ses_ndl_hash; /* hash table of nodes */
spinlock_t ses_rpc_lock; /* serialize */
atomic_t ses_rpc_counter;/* # of initialized RPCs */
atomic_t ses_rpc_counter; /* # of initialized RPCs */
struct list_head ses_rpc_freelist; /* idle console rpc */
} lstcon_session_t; /*** session descriptor */
} lstcon_session_t; /* session descriptor */
extern lstcon_session_t console_session;
......
......@@ -117,7 +117,8 @@ typedef struct {
typedef struct {
__u32 join_status; /* returned status */
lst_sid_t join_sid; /* session id */
__u32 join_timeout; /* # seconds' inactivity to expire */
__u32 join_timeout; /* # seconds' inactivity to
* expire */
char join_session[LST_NAME_SIZE]; /* session name */
} WIRE_ATTR srpc_join_reply_t;
......@@ -176,14 +177,10 @@ typedef struct {
} WIRE_ATTR test_bulk_req_t;
typedef struct {
/** bulk operation code */
__u16 blk_opc;
/** data check flags */
__u16 blk_flags;
/** data length */
__u32 blk_len;
/** reserved: offset */
__u32 blk_offset;
__u16 blk_opc; /* bulk operation code */
__u16 blk_flags; /* data check flags */
__u32 blk_len; /* data length */
__u32 blk_offset; /* reserved: offset */
} WIRE_ATTR test_bulk_req_v1_t;
typedef struct {
......@@ -197,8 +194,8 @@ typedef struct {
lst_sid_t tsr_sid; /* session id */
lst_bid_t tsr_bid; /* batch id */
__u32 tsr_service; /* test type: bulk|ping|... */
/* test client loop count or # server buffers needed */
__u32 tsr_loop;
__u32 tsr_loop; /* test client loop count or
* # server buffers needed */
__u32 tsr_concur; /* concurrency of test */
__u8 tsr_is_client; /* is test client or not */
__u8 tsr_stop_onerr; /* stop on error */
......@@ -247,16 +244,12 @@ typedef struct {
#define SRPC_MSG_VERSION 1
typedef struct srpc_msg {
/** magic number */
__u32 msg_magic;
/** message version number */
__u32 msg_version;
/** type of message body: srpc_msg_type_t */
__u32 msg_type;
__u32 msg_magic; /* magic number */
__u32 msg_version; /* message version number */
__u32 msg_type; /* type of message body: srpc_msg_type_t */
__u32 msg_reserved0;
__u32 msg_reserved1;
/** test session features */
__u32 msg_ses_feats;
__u32 msg_ses_feats; /* test session features */
union {
srpc_generic_reqst_t reqst;
srpc_generic_reply_t reply;
......
......@@ -136,7 +136,8 @@ srpc_service2reply (int service)
}
typedef enum {
SRPC_BULK_REQ_RCVD = 1, /* passive bulk request(PUT sink/GET source) received */
SRPC_BULK_REQ_RCVD = 1, /* passive bulk request(PUT sink/GET source)
* received */
SRPC_BULK_PUT_SENT = 2, /* active bulk PUT sent (source) */
SRPC_BULK_GET_RPLD = 3, /* active bulk GET replied (sink) */
SRPC_REPLY_RCVD = 4, /* incoming reply received */
......@@ -350,8 +351,10 @@ typedef struct {
} sfw_batch_t;
typedef struct {
int (*tso_init)(struct sfw_test_instance *tsi); /* initialize test client */
void (*tso_fini)(struct sfw_test_instance *tsi); /* finalize test client */
int (*tso_init)(struct sfw_test_instance *tsi); /* initialize test
* client */
void (*tso_fini)(struct sfw_test_instance *tsi); /* finalize test
* client */
int (*tso_prep_rpc)(struct sfw_test_unit *tsu,
lnet_process_id_t dest,
srpc_client_rpc_t **rpc); /* prep a tests rpc */
......@@ -363,7 +366,8 @@ typedef struct sfw_test_instance {
struct list_head tsi_list; /* chain on batch */
int tsi_service; /* test type */
sfw_batch_t *tsi_batch; /* batch */
sfw_test_client_ops_t *tsi_ops; /* test client operations */
sfw_test_client_ops_t *tsi_ops; /* test client operation
*/
/* public parameter for all test units */
unsigned int tsi_is_client:1; /* is test client */
......@@ -374,7 +378,8 @@ typedef struct sfw_test_instance {
/* status of test instance */
spinlock_t tsi_lock; /* serialize */
unsigned int tsi_stopping:1; /* test is stopping */
atomic_t tsi_nactive; /* # of active test unit */
atomic_t tsi_nactive; /* # of active test
* unit */
struct list_head tsi_units; /* test units */
struct list_head tsi_free_rpcs; /* free rpcs */
struct list_head tsi_active_rpcs; /* active rpcs */
......@@ -501,9 +506,9 @@ void srpc_shutdown(void);
static inline void
srpc_destroy_client_rpc (srpc_client_rpc_t *rpc)
{
LASSERT (rpc != NULL);
LASSERT (!srpc_event_pending(rpc));
LASSERT (atomic_read(&rpc->crpc_refcount) == 0);
LASSERT(rpc != NULL);
LASSERT(!srpc_event_pending(rpc));
LASSERT(atomic_read(&rpc->crpc_refcount) == 0);
if (rpc->crpc_fini == NULL) {
LIBCFS_FREE(rpc, srpc_client_rpc_size(rpc));
......@@ -520,7 +525,7 @@ srpc_init_client_rpc (srpc_client_rpc_t *rpc, lnet_process_id_t peer,
void (*rpc_done)(srpc_client_rpc_t *),
void (*rpc_fini)(srpc_client_rpc_t *), void *priv)
{
LASSERT (nbulkiov <= LNET_MAX_IOV);
LASSERT(nbulkiov <= LNET_MAX_IOV);
memset(rpc, 0, offsetof(srpc_client_rpc_t,
crpc_bulk.bk_iovs[nbulkiov]));
......
......@@ -59,8 +59,8 @@
static struct st_timer_data {
spinlock_t stt_lock;
/* start time of the slot processed previously */
unsigned long stt_prev_slot;
unsigned long stt_prev_slot; /* start time of the slot processed
* previously */
struct list_head stt_hash[STTIMER_NSLOTS];
int stt_shuttingdown;
wait_queue_head_t stt_waitq;
......
......@@ -45,9 +45,9 @@ typedef struct {
void *stt_data;
} stt_timer_t;
void stt_add_timer (stt_timer_t *timer);
int stt_del_timer (stt_timer_t *timer);
int stt_startup (void);
void stt_shutdown (void);
void stt_add_timer(stt_timer_t *timer);
int stt_del_timer(stt_timer_t *timer);
int stt_startup(void);
void stt_shutdown(void);
#endif /* __SELFTEST_TIMER_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