Whamcloud - gitweb
LU-6142 lnet: change wire protocol typedefs to proper structure
[fs/lustre-release.git] / lnet / lnet / api-ni.c
index e0c478b..a8eed05 100644 (file)
@@ -231,12 +231,12 @@ static void lnet_assert_wire_constants(void)
        CLASSERT(LNET_MSG_REPLY == 3);
        CLASSERT(LNET_MSG_HELLO == 4);
 
-       /* Checks for struct ptl_handle_wire_t */
-       CLASSERT((int)sizeof(lnet_handle_wire_t) == 16);
-       CLASSERT((int)offsetof(lnet_handle_wire_t, wh_interface_cookie) == 0);
-       CLASSERT((int)sizeof(((lnet_handle_wire_t *)0)->wh_interface_cookie) == 8);
-       CLASSERT((int)offsetof(lnet_handle_wire_t, wh_object_cookie) == 8);
-       CLASSERT((int)sizeof(((lnet_handle_wire_t *)0)->wh_object_cookie) == 8);
+       /* Checks for struct lnet_handle_wire */
+       CLASSERT((int)sizeof(struct lnet_handle_wire) == 16);
+       CLASSERT((int)offsetof(struct lnet_handle_wire, wh_interface_cookie) == 0);
+       CLASSERT((int)sizeof(((struct lnet_handle_wire *)0)->wh_interface_cookie) == 8);
+       CLASSERT((int)offsetof(struct lnet_handle_wire, wh_object_cookie) == 8);
+       CLASSERT((int)sizeof(((struct lnet_handle_wire *)0)->wh_object_cookie) == 8);
 
        /* Checks for struct lnet_magicversion_t */
        CLASSERT((int)sizeof(lnet_magicversion_t) == 8);
@@ -878,13 +878,13 @@ lnet_count_acceptor_nis (void)
        return count;
 }
 
-static lnet_ping_info_t *
+static struct lnet_ping_info *
 lnet_ping_info_create(int num_ni)
 {
-       lnet_ping_info_t *ping_info;
+       struct lnet_ping_info *ping_info;
        unsigned int     infosz;
 
-       infosz = offsetof(lnet_ping_info_t, pi_ni[num_ni]);
+       infosz = offsetof(struct lnet_ping_info, pi_ni[num_ni]);
        LIBCFS_ALLOC(ping_info, infosz);
        if (ping_info == NULL) {
                CERROR("Can't allocate ping info[%d]\n", num_ni);
@@ -916,10 +916,10 @@ lnet_get_ni_count(void)
 }
 
 static inline void
-lnet_ping_info_free(lnet_ping_info_t *pinfo)
+lnet_ping_info_free(struct lnet_ping_info *pinfo)
 {
        LIBCFS_FREE(pinfo,
-                   offsetof(lnet_ping_info_t,
+                   offsetof(struct lnet_ping_info,
                             pi_ni[pinfo->pi_nnis]));
 }
 
@@ -945,14 +945,14 @@ lnet_ping_info_destroy(void)
 static void
 lnet_ping_event_handler(lnet_event_t *event)
 {
-       lnet_ping_info_t *pinfo = event->md.user_ptr;
+       struct lnet_ping_info *pinfo = event->md.user_ptr;
 
        if (event->unlinked)
                pinfo->pi_features = LNET_PING_FEAT_INVAL;
 }
 
 static int
-lnet_ping_info_setup(lnet_ping_info_t **ppinfo, lnet_handle_md_t *md_handle,
+lnet_ping_info_setup(struct lnet_ping_info **ppinfo, lnet_handle_md_t *md_handle,
                     int ni_count, bool set_eq)
 {
        lnet_handle_me_t  me_handle;
@@ -986,7 +986,7 @@ lnet_ping_info_setup(lnet_ping_info_t **ppinfo, lnet_handle_md_t *md_handle,
 
        /* initialize md content */
        md.start     = *ppinfo;
-       md.length    = offsetof(lnet_ping_info_t,
+       md.length    = offsetof(struct lnet_ping_info,
                                pi_ni[(*ppinfo)->pi_nnis]);
        md.threshold = LNET_MD_THRESH_INF;
        md.max_size  = 0;
@@ -1017,7 +1017,7 @@ failed_0:
 }
 
 static void
-lnet_ping_md_unlink(lnet_ping_info_t *pinfo, lnet_handle_md_t *md_handle)
+lnet_ping_md_unlink(struct lnet_ping_info *pinfo, lnet_handle_md_t *md_handle)
 {
        sigset_t        blocked = cfs_block_allsigs();
 
@@ -1035,11 +1035,11 @@ lnet_ping_md_unlink(lnet_ping_info_t *pinfo, lnet_handle_md_t *md_handle)
 }
 
 static void
-lnet_ping_info_install_locked(lnet_ping_info_t *ping_info)
+lnet_ping_info_install_locked(struct lnet_ping_info *ping_info)
 {
        int                     i;
        lnet_ni_t               *ni;
-       lnet_ni_status_t        *ns;
+       struct lnet_ni_status *ns;
 
        i = 0;
        list_for_each_entry(ni, &the_lnet.ln_nis, ni_list) {
@@ -1060,9 +1060,9 @@ lnet_ping_info_install_locked(lnet_ping_info_t *ping_info)
 }
 
 static void
-lnet_ping_target_update(lnet_ping_info_t *pinfo, lnet_handle_md_t md_handle)
+lnet_ping_target_update(struct lnet_ping_info *pinfo, lnet_handle_md_t md_handle)
 {
-       lnet_ping_info_t *old_pinfo = NULL;
+       struct lnet_ping_info *old_pinfo = NULL;
        lnet_handle_md_t old_md;
 
        /* switch the NIs to point to the new ping info created */
@@ -1549,7 +1549,7 @@ LNetNIInit(lnet_pid_t requested_pid)
        int                     im_a_router = 0;
        int                     rc;
        int                     ni_count;
-       lnet_ping_info_t        *pinfo;
+       struct lnet_ping_info   *pinfo;
        lnet_handle_md_t        md_handle;
        struct list_head        net_head;
 
@@ -1813,7 +1813,7 @@ int
 lnet_dyn_add_ni(lnet_pid_t requested_pid, struct lnet_ioctl_config_data *conf)
 {
        char                    *nets = conf->cfg_config_u.cfg_net.net_intf;
-       lnet_ping_info_t        *pinfo;
+       struct lnet_ping_info   *pinfo;
        lnet_handle_md_t        md_handle;
        struct lnet_ni          *ni;
        struct list_head        net_head;
@@ -1891,7 +1891,7 @@ int
 lnet_dyn_del_ni(__u32 net)
 {
        lnet_ni_t        *ni;
-       lnet_ping_info_t *pinfo;
+       struct lnet_ping_info *pinfo;
        lnet_handle_md_t  md_handle;
        int               rc;
 
@@ -2213,7 +2213,7 @@ lnet_ping(lnet_process_id_t id, int timeout_ms, lnet_process_id_t __user *ids,
        int                  replied = 0;
        const int            a_long_time = 60000; /* mS */
        int                  infosz;
-       lnet_ping_info_t    *info;
+       struct lnet_ping_info    *info;
        lnet_process_id_t    tmpid;
        int                  i;
        int                  nob;
@@ -2221,7 +2221,7 @@ lnet_ping(lnet_process_id_t id, int timeout_ms, lnet_process_id_t __user *ids,
        int                  rc2;
        sigset_t         blocked;
 
-       infosz = offsetof(lnet_ping_info_t, pi_ni[n_ids]);
+       infosz = offsetof(struct lnet_ping_info, pi_ni[n_ids]);
 
        if (n_ids <= 0 ||
            id.nid == LNET_NID_ANY ||
@@ -2349,18 +2349,18 @@ lnet_ping(lnet_process_id_t id, int timeout_ms, lnet_process_id_t __user *ids,
                goto out_1;
        }
 
-       if (nob < offsetof(lnet_ping_info_t, pi_ni[0])) {
+       if (nob < offsetof(struct lnet_ping_info, pi_ni[0])) {
                CERROR("%s: Short reply %d(%d min)\n", libcfs_id2str(id),
-                      nob, (int)offsetof(lnet_ping_info_t, pi_ni[0]));
+                      nob, (int)offsetof(struct lnet_ping_info, pi_ni[0]));
                goto out_1;
        }
 
        if (info->pi_nnis < n_ids)
                n_ids = info->pi_nnis;
 
-       if (nob < offsetof(lnet_ping_info_t, pi_ni[n_ids])) {
+       if (nob < offsetof(struct lnet_ping_info, pi_ni[n_ids])) {
                CERROR("%s: Short reply %d(%d expected)\n", libcfs_id2str(id),
-                      nob, (int)offsetof(lnet_ping_info_t, pi_ni[n_ids]));
+                      nob, (int)offsetof(struct lnet_ping_info, pi_ni[n_ids]));
                goto out_1;
        }