⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lnetst.h

📁 非常经典的一个分布式系统
💻 H
📖 第 1 页 / 共 2 页
字号:
/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- * vim:expandtab:shiftwidth=8:tabstop=8: * * Author: Liang Zhen <liangzhen@clusterfs.com> *  * This file is part of Lustre, http://www.lustre.org */#ifndef __LNET_ST_H__#define __LNET_ST_H__#include <libcfs/kp30.h>#include <lnet/lnet.h>#include <lnet/lib-types.h>#define LST_NAME_SIZE           32              /* max name buffer length */#define LSTIO_DEBUG             0xC00           /* debug */#define LSTIO_SESSION_NEW       0xC01           /* create session */#define LSTIO_SESSION_END       0xC02           /* end session */#define LSTIO_SESSION_INFO      0xC03           /* query session */#define LSTIO_GROUP_ADD         0xC10           /* add group */#define LSTIO_GROUP_LIST        0xC11           /* list all groups in session */#define LSTIO_GROUP_INFO        0xC12           /* query defailt infomation of specified group */#define LSTIO_GROUP_DEL         0xC13           /* delete group */#define LSTIO_NODES_ADD         0xC14           /* add nodes to specified group */#define LSTIO_GROUP_UPDATE      0xC15           /* update group */#define LSTIO_BATCH_ADD         0xC20           /* add batch */#define LSTIO_BATCH_START       0xC21           /* start batch */#define LSTIO_BATCH_STOP        0xC22           /* stop batch */#define LSTIO_BATCH_DEL         0xC23           /* delete batch */#define LSTIO_BATCH_LIST        0xC24           /* show all batches in the session */#define LSTIO_BATCH_INFO        0xC25           /* show defail of specified batch */#define LSTIO_TEST_ADD          0xC26           /* add test (to batch) */#define LSTIO_BATCH_QUERY       0xC27           /* query batch status */#define LSTIO_STAT_QUERY        0xC30           /* get stats */typedef struct {        lnet_nid_t              ses_nid;                /* nid of console node */        __u64                   ses_stamp;              /* time stamp */} lst_sid_t;                                            /*** session id */#define LST_INVALID_SID         ((const lst_sid_t){.ses_nid   = LNET_NID_ANY,\                                                   .ses_stamp = -1})typedef struct {        __u64                   bat_id;                 /* unique id in session */} lst_bid_t;                                            /*** batch id (group of tests) *//* Status of test node */#define LST_NODE_ACTIVE         0x1                     /* node in this session */#define LST_NODE_BUSY           0x2                     /* node is taken by other session */#define LST_NODE_DOWN           0x4                     /* node is down */#define LST_NODE_UNKNOWN        0x8                     /* node not in session */typedef struct {        lnet_process_id_t       nde_id;                 /* id of node */        int                     nde_state;              /* state of node */} lstcon_node_ent_t;                                    /*** node entry, for list_group command */typedef struct {        int                     nle_nnode;              /* # of nodes */        int                     nle_nactive;            /* # of active nodes */        int                     nle_nbusy;              /* # of busy nodes */        int                     nle_ndown;              /* # of down nodes */        int                     nle_nunknown;           /* # of unknown nodes */} lstcon_ndlist_ent_t;                                  /*** node_list entry, for list_batch command */typedef struct {        int                     tse_type;               /* test type */        int                     tse_loop;               /* loop count */        int                     tse_concur;             /* concurrency of test */} lstcon_test_ent_t;                                    /*** test summary entry, for list_batch command */typedef struct {        int                     bae_state;              /* batch status */        int                     bae_timeout;            /* batch timeout */        int                     bae_ntest;              /* # of tests in the batch */} lstcon_batch_ent_t;                                   /*** batch summary entry, for list_batch command */typedef struct {        lstcon_ndlist_ent_t     tbe_cli_nle;            /* client (group) node_list entry */        lstcon_ndlist_ent_t     tbe_srv_nle;            /* server (group) node_list entry */        union {                lstcon_test_ent_t  tbe_test;            /* test entry */                lstcon_batch_ent_t tbe_batch;           /* batch entry */        } u;} lstcon_test_batch_ent_t;                              /*** test/batch verbose information entry,                                                         *** for list_batch command */typedef struct {        struct list_head        rpe_link;               /* link chain */        lnet_process_id_t       rpe_peer;               /* peer's id */        struct timeval          rpe_stamp;              /* time stamp of RPC */        int                     rpe_state;              /* peer's state */        int                     rpe_rpc_errno;          /* RPC errno */        lst_sid_t               rpe_sid;                /* peer's session id */        int                     rpe_fwk_errno;          /* framework errno */        int                     rpe_priv[4];            /* private data */        char                    rpe_payload[0];         /* private reply payload */} lstcon_rpc_ent_t;typedef struct {        int                     trs_rpc_stat[4];        /* RPCs stat (0: total, 1: failed, 2: finished, 4: reserved */        int                     trs_rpc_errno;          /* RPC errno */        int                     trs_fwk_stat[8];        /* framework stat */        int                     trs_fwk_errno;          /* errno of the first remote error */        void                   *trs_fwk_private;        /* private framework stat */} lstcon_trans_stat_t;static inline intlstcon_rpc_stat_total(lstcon_trans_stat_t *stat, int inc){        return inc ? ++stat->trs_rpc_stat[0] : stat->trs_rpc_stat[0];}static inline intlstcon_rpc_stat_success(lstcon_trans_stat_t *stat, int inc){        return inc ? ++stat->trs_rpc_stat[1] : stat->trs_rpc_stat[1];}static inline intlstcon_rpc_stat_failure(lstcon_trans_stat_t *stat, int inc){        return inc ? ++stat->trs_rpc_stat[2] : stat->trs_rpc_stat[2];}static inline intlstcon_sesop_stat_success(lstcon_trans_stat_t *stat, int inc){        return inc ? ++stat->trs_fwk_stat[0] : stat->trs_fwk_stat[0];}static inline intlstcon_sesop_stat_failure(lstcon_trans_stat_t *stat, int inc){        return inc ? ++stat->trs_fwk_stat[1] : stat->trs_fwk_stat[1];}static inline intlstcon_sesqry_stat_active(lstcon_trans_stat_t *stat, int inc){        return inc ? ++stat->trs_fwk_stat[0] : stat->trs_fwk_stat[0];}static inline intlstcon_sesqry_stat_busy(lstcon_trans_stat_t *stat, int inc){        return inc ? ++stat->trs_fwk_stat[1] : stat->trs_fwk_stat[1];}static inline intlstcon_sesqry_stat_unknown(lstcon_trans_stat_t *stat, int inc){        return inc ? ++stat->trs_fwk_stat[2] : stat->trs_fwk_stat[2];}static inline intlstcon_tsbop_stat_success(lstcon_trans_stat_t *stat, int inc){        return inc ? ++stat->trs_fwk_stat[0] : stat->trs_fwk_stat[0];}static inline intlstcon_tsbop_stat_failure(lstcon_trans_stat_t *stat, int inc){        return inc ? ++stat->trs_fwk_stat[1] : stat->trs_fwk_stat[1];}static inline intlstcon_tsbqry_stat_idle(lstcon_trans_stat_t *stat, int inc){        return inc ? ++stat->trs_fwk_stat[0] : stat->trs_fwk_stat[0];}static inline intlstcon_tsbqry_stat_run(lstcon_trans_stat_t *stat, int inc){        return inc ? ++stat->trs_fwk_stat[1] : stat->trs_fwk_stat[1];}static inline intlstcon_tsbqry_stat_failure(lstcon_trans_stat_t *stat, int inc){        return inc ? ++stat->trs_fwk_stat[2] : stat->trs_fwk_stat[2];}static inline intlstcon_statqry_stat_success(lstcon_trans_stat_t *stat, int inc){        return inc ? ++stat->trs_fwk_stat[0] : stat->trs_fwk_stat[0];}static inline intlstcon_statqry_stat_failure(lstcon_trans_stat_t *stat, int inc){        return inc ? ++stat->trs_fwk_stat[1] : stat->trs_fwk_stat[1];}/* create a session */typedef struct {        int                     lstio_ses_key;          /* IN: local key */        int                     lstio_ses_timeout;      /* IN: session timeout */        int                     lstio_ses_force;        /* IN: force create ? */        lst_sid_t              *lstio_ses_idp;          /* OUT: session id */        int                     lstio_ses_nmlen;        /* IN: name length */        char                   *lstio_ses_namep;        /* IN: session name */} lstio_session_new_args_t;/* query current session */typedef struct {        lst_sid_t              *lstio_ses_idp;          /* OUT: session id */        int                    *lstio_ses_keyp;         /* OUT: local key */        lstcon_ndlist_ent_t    *lstio_ses_ndinfo;       /* OUT: */        int                     lstio_ses_nmlen;        /* IN: name length */        char                   *lstio_ses_namep;        /* OUT: session name */} lstio_session_info_args_t;/* delete a session */typedef struct {        int                     lstio_ses_key;          /* IN: session key */} lstio_session_end_args_t;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -