Whamcloud - gitweb
LU-6142 lnet: remove most of typedefs from LNet headers
[fs/lustre-release.git] / lnet / include / lnet / lib-types.h
index 13ca7d5..cfa4c39 100644 (file)
@@ -67,7 +67,7 @@ typedef struct lnet_msg {
        struct list_head        msg_activelist;
        struct list_head        msg_list;       /* Q for credits/MD */
 
-       lnet_process_id_t       msg_target;
+       struct lnet_process_id  msg_target;
        /* Primary NID of the source. */
        lnet_nid_t              msg_initiator;
        /* where is it from, it's only for building event */
@@ -118,11 +118,10 @@ typedef struct lnet_msg {
        struct kvec          *msg_iov;
        lnet_kiov_t          *msg_kiov;
 
-       lnet_event_t          msg_ev;
-       lnet_hdr_t            msg_hdr;
+       struct lnet_event       msg_ev;
+       struct lnet_hdr         msg_hdr;
 } lnet_msg_t;
 
-
 typedef struct lnet_libhandle {
        struct list_head        lh_hash_chain;
        __u64                   lh_cookie;
@@ -133,31 +132,31 @@ typedef struct lnet_libhandle {
 
 typedef struct lnet_eq {
        struct list_head        eq_list;
-       lnet_libhandle_t        eq_lh;
-       lnet_seq_t              eq_enq_seq;
-       lnet_seq_t              eq_deq_seq;
+       struct lnet_libhandle   eq_lh;
+       unsigned long           eq_enq_seq;
+       unsigned long           eq_deq_seq;
        unsigned int            eq_size;
        lnet_eq_handler_t       eq_callback;
-       lnet_event_t            *eq_events;
+       struct lnet_event       *eq_events;
        int                     **eq_refs;      /* percpt refcount for EQ */
 } lnet_eq_t;
 
 typedef struct lnet_me {
        struct list_head        me_list;
-       lnet_libhandle_t        me_lh;
-       lnet_process_id_t       me_match_id;
+       struct lnet_libhandle   me_lh;
+       struct lnet_process_id  me_match_id;
        unsigned int            me_portal;
        unsigned int            me_pos;         /* hash offset in mt_hash */
        __u64                   me_match_bits;
        __u64                   me_ignore_bits;
-       lnet_unlink_t           me_unlink;
+       enum lnet_unlink        me_unlink;
        struct lnet_libmd      *me_md;
 } lnet_me_t;
 
 typedef struct lnet_libmd {
        struct list_head        md_list;
-       lnet_libhandle_t        md_lh;
-       lnet_me_t              *md_me;
+       struct lnet_libhandle   md_lh;
+       struct lnet_me         *md_me;
        char                   *md_start;
        unsigned int            md_offset;
        unsigned int            md_length;
@@ -168,8 +167,8 @@ typedef struct lnet_libmd {
        unsigned int            md_flags;
        unsigned int            md_niov;        /* # frags at end of struct */
        void                   *md_user_ptr;
-       lnet_eq_t              *md_eq;
-       lnet_handle_md_t       md_bulk_handle;
+       struct lnet_eq         *md_eq;
+       struct lnet_handle_md   md_bulk_handle;
        union {
                struct kvec     iov[LNET_MAX_IOV];
                lnet_kiov_t     kiov[LNET_MAX_IOV];
@@ -180,7 +179,7 @@ typedef struct lnet_libmd {
 #define LNET_MD_FLAG_AUTO_UNLINK (1 << 1)
 #define LNET_MD_FLAG_ABORTED    (1 << 2)
 
-typedef struct {
+typedef struct lnet_test_peer {
        /* info about peers we are trying to fail */
        struct list_head        tp_list;        /* ln_test_peers */
        lnet_nid_t              tp_nid;         /* matching nid */
@@ -196,8 +195,7 @@ typedef struct {
 struct lnet_ni;                                         /* forward ref */
 struct socket;
 
-typedef struct lnet_lnd
-{
+typedef struct lnet_lnd {
        /* fields managed by portals */
        struct list_head        lnd_list;       /* stash in the LND table */
        int                     lnd_refcount;   /* # active instances */
@@ -225,14 +223,15 @@ typedef struct lnet_lnd
         * and 'private' is the 'private' passed to lnet_parse().  Return
         * non-zero for immediate failure, otherwise complete later with
         * lnet_finalize() */
-       int (*lnd_send)(struct lnet_ni *ni, void *private, lnet_msg_t *msg);
+       int (*lnd_send)(struct lnet_ni *ni, void *private,
+                       struct lnet_msg *msg);
 
        /* Start receiving 'mlen' bytes of payload data, skipping the following
         * 'rlen' - 'mlen' bytes. 'private' is the 'private' passed to
         * lnet_parse().  Return non-zero for immedaite failure, otherwise
         * complete later with lnet_finalize().  This also gives back a receive
         * credit if the LND does flow control. */
-       int (*lnd_recv)(struct lnet_ni *ni, void *private, lnet_msg_t *msg,
+       int (*lnd_recv)(struct lnet_ni *ni, void *private, struct lnet_msg *msg,
                        int delayed, unsigned int niov,
                        struct kvec *iov, lnet_kiov_t *kiov,
                        unsigned int offset, unsigned int mlen, unsigned int rlen);
@@ -243,8 +242,8 @@ typedef struct lnet_lnd
         * for success and do NOT give back a receive credit; that has to wait
         * until lnd_recv() gets called.  On failure return < 0 and
         * release resources; lnd_recv() will not be called. */
-       int (*lnd_eager_recv)(struct lnet_ni *ni, void *private, lnet_msg_t *msg,
-                             void **new_privatep);
+       int (*lnd_eager_recv)(struct lnet_ni *ni, void *private,
+                             struct lnet_msg *msg, void **new_privatep);
 
        /* notification of peer health */
        void (*lnd_notify)(struct lnet_ni *ni, lnet_nid_t peer, int alive);
@@ -328,7 +327,7 @@ struct lnet_net {
        bool                    net_tunables_set;
 
        /* procedural interface */
-       lnd_t                   *net_lnd;
+       struct lnet_lnd         *net_lnd;
 
        /* list of NIs on this net */
        struct list_head        net_ni_list;
@@ -380,7 +379,7 @@ typedef struct lnet_ni {
        struct lnet_net         *ni_net;
 
        /* my health status */
-       lnet_ni_status_t        *ni_status;
+       struct lnet_ni_status   *ni_status;
 
        /* NI FSM */
        enum lnet_ni_state      ni_state;
@@ -431,10 +430,10 @@ typedef struct lnet_ping_info {
 /* router checker data, per router */
 #define LNET_MAX_RTR_NIS   16
 #define LNET_PINGINFO_SIZE offsetof(struct lnet_ping_info, pi_ni[LNET_MAX_RTR_NIS])
-typedef struct {
+typedef struct lnet_rc_data {
        /* chain on the_lnet.ln_zombie_rcd or ln_deathrow_rcd */
        struct list_head        rcd_list;
-       lnet_handle_md_t        rcd_mdh;        /* ping buffer MD */
+       struct lnet_handle_md   rcd_mdh;        /* ping buffer MD */
        struct lnet_peer_ni     *rcd_gateway;   /* reference to gateway */
        struct lnet_ping_info   *rcd_pinginfo;  /* ping buffer */
 } lnet_rc_data_t;
@@ -515,7 +514,7 @@ struct lnet_peer_ni {
        /* number of preferred NIDs in lnpi_pref_nids */
        __u32                   lpni_pref_nnids;
        /* router checker state */
-       lnet_rc_data_t          *lpni_rcd;
+       struct lnet_rc_data     *lpni_rcd;
 };
 
 struct lnet_peer {
@@ -561,12 +560,13 @@ struct lnet_peer_table {
 };
 
 /* peer aliveness is enabled only on routers for peers in a network where the
- * lnet_ni_t::ni_peertimeout has been set to a positive value */
+ * struct lnet_ni::ni_peertimeout has been set to a positive value
+ */
 #define lnet_peer_aliveness_enabled(lp) (the_lnet.ln_routing != 0 && \
                                        ((lp)->lpni_net) && \
                                        (lp)->lpni_net->net_tunables.lct_peer_timeout > 0)
 
-typedef struct {
+typedef struct lnet_route {
        struct list_head        lr_list;        /* chain on net */
        struct list_head        lr_gwlist;      /* chain on gateway */
        struct lnet_peer_ni     *lr_gateway;    /* router node */
@@ -581,7 +581,7 @@ typedef struct {
 #define LNET_REMOTE_NETS_HASH_MAX      (1U << 16)
 #define LNET_REMOTE_NETS_HASH_SIZE     (1 << the_lnet.ln_remote_nets_hbits)
 
-typedef struct {
+typedef struct lnet_remotenet {
        /* chain on ln_remote_nets_hash */
        struct list_head        lrn_list;
        /* routes to me */
@@ -595,7 +595,7 @@ typedef struct {
 /** lnet message is waiting for credit */
 #define LNET_CREDIT_WAIT       1
 
-typedef struct {
+typedef struct lnet_rtrbufpool {
        /* my free buffer pool */
        struct list_head        rbp_bufs;
        /* messages blocking for a buffer */
@@ -612,15 +612,15 @@ typedef struct {
        int                     rbp_mincredits;
 } lnet_rtrbufpool_t;
 
-typedef struct {
+typedef struct lnet_rtrbuf {
        struct list_head         rb_list;       /* chain on rbp_bufs */
-       lnet_rtrbufpool_t       *rb_pool;       /* owning pool */
+       struct lnet_rtrbufpool  *rb_pool;       /* owning pool */
        lnet_kiov_t              rb_kiov[0];    /* the buffer space */
 } lnet_rtrbuf_t;
 
 #define LNET_PEER_HASHSIZE   503               /* prime! */
 
-enum {
+enum lnet_match_flags {
        /* Didn't match anything */
        LNET_MATCHMD_NONE       = (1 << 0),
        /* Matched OK */
@@ -633,7 +633,7 @@ enum {
        LNET_MATCHMD_FINISH     = (LNET_MATCHMD_OK | LNET_MATCHMD_DROP),
 };
 
-/* Options for lnet_portal_t::ptl_options */
+/* Options for struct lnet_portal::ptl_options */
 #define LNET_PTL_LAZY              (1 << 0)
 #define LNET_PTL_MATCH_UNIQUE      (1 << 1)    /* unique match, for RDMA */
 #define LNET_PTL_MATCH_WILDCARD     (1 << 2)   /* wildcard match, request portal */
@@ -641,7 +641,7 @@ enum {
 /* parameter for matching operations (GET, PUT) */
 struct lnet_match_info {
        __u64                   mi_mbits;
-       lnet_process_id_t       mi_id;
+       struct lnet_process_id  mi_id;
        unsigned int            mi_cpt;
        unsigned int            mi_opc;
        unsigned int            mi_portal;
@@ -734,8 +734,7 @@ struct lnet_msg_container {
 #define LNET_RC_STATE_RUNNING          1       /* started up OK */
 #define LNET_RC_STATE_STOPPING         2       /* telling thread to stop */
 
-typedef struct
-{
+typedef struct lnet {
        /* CPU partition table of LNet */
        struct cfs_cpt_table            *ln_cpt_table;
        /* number of CPTs in ln_cpt_table */
@@ -747,7 +746,7 @@ typedef struct
        /* # portals */
        int                             ln_nportals;
        /* the vector of portals */
-       lnet_portal_t                   **ln_portals;
+       struct lnet_portal              **ln_portals;
        /* percpt ME containers */
        struct lnet_res_container       **ln_me_containers;
        /* percpt MD container */
@@ -764,7 +763,7 @@ typedef struct
        struct cfs_percpt_lock          *ln_net_lock;
        /* percpt message containers for active/finalizing/freed message */
        struct lnet_msg_container       **ln_msg_containers;
-       lnet_counters_t                 **ln_counters;
+       struct lnet_counters            **ln_counters;
        struct lnet_peer_table          **ln_peer_tables;
        /* list of configured or discovered peers */
        struct list_head                ln_peers;
@@ -790,16 +789,16 @@ typedef struct
        /* validity stamp */
        __u64                           ln_routers_version;
        /* percpt router buffer pools */
-       lnet_rtrbufpool_t               **ln_rtrpools;
+       struct lnet_rtrbufpool          **ln_rtrpools;
 
-       lnet_handle_md_t                ln_ping_target_md;
-       lnet_handle_eq_t                ln_ping_target_eq;
+       struct lnet_handle_md           ln_ping_target_md;
+       struct lnet_handle_eq           ln_ping_target_eq;
        struct lnet_ping_info           *ln_ping_info;
 
        /* router checker startup/shutdown state */
        int                             ln_rc_state;
        /* router checker's event queue */
-       lnet_handle_eq_t                ln_rc_eqh;
+       struct lnet_handle_eq           ln_rc_eqh;
        /* rcd still pending on net */
        struct list_head                ln_rcd_deathrow;
        /* rcd ready for free */