X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lnet%2Fselftest%2Fconrpc.h;h=52cbf1107d20c7882328aefbea11ba940d8bd6d5;hp=ba2a72c226ed773434252c814e72b7441b171466;hb=128b84135aafa1a2d49b8c05feeb2ac3ccdd3294;hpb=6869932b552ac705f411de3362f01bd50c1f6f7d diff --git a/lnet/selftest/conrpc.h b/lnet/selftest/conrpc.h index ba2a72c..52cbf11 100644 --- a/lnet/selftest/conrpc.h +++ b/lnet/selftest/conrpc.h @@ -1,6 +1,4 @@ -/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- - * vim:expandtab:shiftwidth=8:tabstop=8: - * +/* * GPL HEADER START * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -26,7 +24,7 @@ * GPL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. */ /* @@ -54,6 +52,9 @@ /* Console rpc and rpc transaction */ #define LST_TRANS_TIMEOUT 30 #define LST_TRANS_MIN_TIMEOUT 3 + +#define LST_VALIDATE_TIMEOUT(t) MIN(MAX(t, LST_TRANS_MIN_TIMEOUT), LST_TRANS_TIMEOUT) + #define LST_PING_INTERVAL 8 struct lstcon_rpc_trans; @@ -62,26 +63,26 @@ struct lstcon_test; struct lstcon_node; typedef struct lstcon_rpc { - struct list_head crp_link; /* chain on rpc transaction */ - srpc_client_rpc_t *crp_rpc; /* client rpc */ - struct lstcon_node *crp_node; /* destination node */ + cfs_list_t crp_link; /* chain on rpc transaction */ + srpc_client_rpc_t *crp_rpc; /* client rpc */ + struct lstcon_node *crp_node; /* destination node */ struct lstcon_rpc_trans *crp_trans; /* conrpc transaction */ - int crp_posted:1; /* rpc is posted */ - int crp_finished:1; /* rpc is finished */ - int crp_unpacked:1; /* reply is unpacked */ - int crp_static:1; /* not from RPC buffer */ - int crp_status; /* console rpc errors */ - cfs_time_t crp_stamp; /* replied time stamp */ + int crp_posted:1; /* rpc is posted */ + int crp_finished:1; /* rpc is finished */ + int crp_unpacked:1; /* reply is unpacked */ + int crp_static:1; /* not from RPC buffer */ + int crp_status; /* console rpc errors */ + cfs_time_t crp_stamp; /* replied time stamp */ } lstcon_rpc_t; 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 */ - cfs_waitq_t tas_waitq; /* wait queue head */ - atomic_t tas_remaining; /* # of un-scheduled rpcs */ - struct list_head tas_rpcs_list; /* queued requests */ + cfs_list_t tas_olink; /* link chain on owner list */ + cfs_list_t tas_link; /* link chain on global list */ + int tas_opc; /* operation code of transaction */ + cfs_waitq_t tas_waitq; /* wait queue head */ + cfs_atomic_t tas_remaining; /* # of un-scheduled rpcs */ + cfs_list_t tas_rpcs_list; /* queued requests */ } lstcon_rpc_trans_t; #define LST_TRANS_PRIVATE 0x1000 @@ -112,16 +113,16 @@ int lstcon_testrpc_prep(struct lstcon_node *nd, int transop, struct lstcon_test *test, lstcon_rpc_t **crpc); int lstcon_statrpc_prep(struct lstcon_node *nd, lstcon_rpc_t **crpc); void lstcon_rpc_put(lstcon_rpc_t *crpc); -int lstcon_rpc_trans_prep(struct list_head *translist, +int lstcon_rpc_trans_prep(cfs_list_t *translist, int transop, lstcon_rpc_trans_t **transpp); -int lstcon_rpc_trans_ndlist(struct list_head *ndlist, - struct list_head *translist, int transop, +int lstcon_rpc_trans_ndlist(cfs_list_t *ndlist, + cfs_list_t *translist, int transop, 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); int lstcon_rpc_trans_interpreter(lstcon_rpc_trans_t *trans, - struct list_head *head_up, + cfs_list_t *head_up, lstcon_rpc_readent_func_t readent); void lstcon_rpc_trans_abort(lstcon_rpc_trans_t *trans, int error); void lstcon_rpc_trans_destroy(lstcon_rpc_trans_t *trans);