Whamcloud - gitweb
LU-4423 lnet: Drop unnecessary wrapper function in lnetselftest console.c
[fs/lustre-release.git] / lnet / selftest / console.c
index 8179f10..af050a1 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2012, Intel Corporation.
+ * Copyright (c) 2012, 2014, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -40,7 +40,6 @@
  * Author: Liang Zhen <liangzhen@clusterfs.com>
  */
 
-#ifdef __KERNEL__
 
 #include <libcfs/libcfs.h>
 #include <lnet/lib-lnet.h>
@@ -62,7 +61,7 @@ do {                                                    \
 
 lstcon_session_t        console_session;
 
-void
+static void
 lstcon_node_get(lstcon_node_t *nd)
 {
         LASSERT (nd->nd_ref >= 1);
@@ -88,7 +87,7 @@ lstcon_node_find(lnet_process_id_t id, lstcon_node_t **ndpp, int create)
                *ndpp = ndl->ndl_node;
                return 0;
        }
-        
+
         if (!create)
                 return -ENOENT;
 
@@ -116,7 +115,7 @@ lstcon_node_find(lnet_process_id_t id, lstcon_node_t **ndpp, int create)
        return 0;
 }
 
-void
+static void
 lstcon_node_put(lstcon_node_t *nd)
 {
        lstcon_ndlink_t *ndl;
@@ -173,7 +172,7 @@ lstcon_ndlink_find(struct list_head *hash,
                 lstcon_node_put(nd);
                 return -ENOMEM;
         }
-        
+
         *ndlpp = ndl;
 
        ndl->ndl_node = nd;
@@ -288,12 +287,6 @@ lstcon_group_find(const char *name, lstcon_group_t **grpp)
        return -ENOENT;
 }
 
-static void
-lstcon_group_put(lstcon_group_t *grp)
-{
-        lstcon_group_decref(grp);
-}
-
 static int
 lstcon_group_ndlink_find(lstcon_group_t *grp, lnet_process_id_t id,
                          lstcon_ndlink_t **ndlpp, int create)
@@ -351,7 +344,7 @@ lstcon_group_move(lstcon_group_t *old, lstcon_group_t *new)
        }
 }
 
-int
+static int
 lstcon_sesrpc_condition(int transop, lstcon_node_t *nd, void *arg)
 {
         lstcon_group_t *grp = (lstcon_group_t *)arg;
@@ -380,9 +373,9 @@ lstcon_sesrpc_condition(int transop, lstcon_node_t *nd, void *arg)
         return 1;
 }
 
-int
+static int
 lstcon_sesrpc_readent(int transop, srpc_msg_t *msg,
-                      lstcon_rpc_ent_t *ent_up)
+                     lstcon_rpc_ent_t __user *ent_up)
 {
         srpc_debug_reply_t *rep;
 
@@ -411,8 +404,8 @@ lstcon_sesrpc_readent(int transop, srpc_msg_t *msg,
 
 static int
 lstcon_group_nodes_add(lstcon_group_t *grp,
-                      int count, lnet_process_id_t *ids_up,
-                      unsigned *featp, struct list_head *result_up)
+                      int count, lnet_process_id_t __user *ids_up,
+                      unsigned *featp, struct list_head __user *result_up)
 {
         lstcon_rpc_trans_t      *trans;
         lstcon_ndlink_t         *ndl;
@@ -447,7 +440,7 @@ lstcon_group_nodes_add(lstcon_group_t *grp,
         }
 
         if (rc != 0) {
-                lstcon_group_put(tmp);
+               lstcon_group_decref(tmp);
                 return rc;
         }
 
@@ -456,7 +449,7 @@ lstcon_group_nodes_add(lstcon_group_t *grp,
                                      tmp, lstcon_sesrpc_condition, &trans);
         if (rc != 0) {
                 CERROR("Can't create transaction: %d\n", rc);
-                lstcon_group_put(tmp);
+               lstcon_group_decref(tmp);
                 return rc;
         }
 
@@ -471,15 +464,15 @@ lstcon_group_nodes_add(lstcon_group_t *grp,
         lstcon_rpc_trans_destroy(trans);
 
         lstcon_group_move(tmp, grp);
-        lstcon_group_put(tmp);
+       lstcon_group_decref(tmp);
 
         return rc;
 }
 
 static int
 lstcon_group_nodes_remove(lstcon_group_t *grp,
-                          int count, lnet_process_id_t *ids_up,
-                         struct list_head *result_up)
+                         int count, lnet_process_id_t __user *ids_up,
+                         struct list_head __user *result_up)
 {
         lstcon_rpc_trans_t     *trans;
         lstcon_ndlink_t        *ndl;
@@ -501,7 +494,7 @@ lstcon_group_nodes_remove(lstcon_group_t *grp,
                         rc = -EFAULT;
                         goto error;
                 }
-                
+
                 /* move node to tmp group */
                 if (lstcon_group_ndlink_find(grp, id, &ndl, 0) == 0)
                         lstcon_group_ndlink_move(grp, tmp, ndl);
@@ -521,12 +514,12 @@ lstcon_group_nodes_remove(lstcon_group_t *grp,
 
         lstcon_rpc_trans_destroy(trans);
         /* release nodes anyway, because we can't rollback status */
-        lstcon_group_put(tmp);
+       lstcon_group_decref(tmp);
 
         return rc;
 error:
         lstcon_group_move(tmp, grp);
-        lstcon_group_put(tmp);
+       lstcon_group_decref(tmp);
 
         return rc;
 }
@@ -540,7 +533,7 @@ lstcon_group_add(char *name)
         rc = (lstcon_group_find(name, &grp) == 0)? -EEXIST: 0;
         if (rc != 0) {
                 /* find a group with same name */
-                lstcon_group_put(grp);
+               lstcon_group_decref(grp);
                 return rc;
         }
 
@@ -556,8 +549,8 @@ lstcon_group_add(char *name)
 }
 
 int
-lstcon_nodes_add(char *name, int count, lnet_process_id_t *ids_up,
-                unsigned *featp, struct list_head *result_up)
+lstcon_nodes_add(char *name, int count, lnet_process_id_t __user *ids_up,
+                unsigned *featp, struct list_head __user *result_up)
 {
         lstcon_group_t         *grp;
         int                     rc;
@@ -574,14 +567,14 @@ lstcon_nodes_add(char *name, int count, lnet_process_id_t *ids_up,
         if (grp->grp_ref > 2) {
                 /* referred by other threads or test */
                 CDEBUG(D_NET, "Group %s is busy\n", name);
-                lstcon_group_put(grp);
+               lstcon_group_decref(grp);
 
                 return -EBUSY;
         }
 
        rc = lstcon_group_nodes_add(grp, count, ids_up, featp, result_up);
 
-        lstcon_group_put(grp);
+       lstcon_group_decref(grp);
 
         return rc;
 }
@@ -602,7 +595,7 @@ lstcon_group_del(char *name)
         if (grp->grp_ref > 2) {
                 /* referred by others threads or test */
                 CDEBUG(D_NET, "Group %s is busy\n", name);
-                lstcon_group_put(grp);
+               lstcon_group_decref(grp);
                 return -EBUSY;
         }
 
@@ -611,7 +604,7 @@ lstcon_group_del(char *name)
                                      grp, lstcon_sesrpc_condition, &trans);
         if (rc != 0) {
                 CERROR("Can't create transaction: %d\n", rc);
-                lstcon_group_put(grp);
+               lstcon_group_decref(grp);
                 return rc;
         }
 
@@ -619,10 +612,10 @@ lstcon_group_del(char *name)
 
         lstcon_rpc_trans_destroy(trans);
 
-        lstcon_group_put(grp);
+       lstcon_group_decref(grp);
         /* -ref for session, it's destroyed,
          * status can't be rolled back, destroy group anway */
-        lstcon_group_put(grp);
+       lstcon_group_decref(grp);
 
         return rc;
 }
@@ -642,7 +635,7 @@ lstcon_group_clean(char *name, int args)
         if (grp->grp_ref > 2) {
                 /* referred by test */
                 CDEBUG(D_NET, "Group %s is busy\n", name);
-                lstcon_group_put(grp);
+               lstcon_group_decref(grp);
                 return -EBUSY;
         }
 
@@ -651,17 +644,18 @@ lstcon_group_clean(char *name, int args)
 
         lstcon_group_drain(grp, args);
 
-       lstcon_group_put(grp);
+       lstcon_group_decref(grp);
        /* release empty group */
        if (list_empty(&grp->grp_ndl_list))
-               lstcon_group_put(grp);
+               lstcon_group_decref(grp);
 
        return 0;
 }
 
 int
 lstcon_nodes_remove(char *name, int count,
-                   lnet_process_id_t *ids_up, struct list_head *result_up)
+                   lnet_process_id_t __user *ids_up,
+                   struct list_head __user *result_up)
 {
         lstcon_group_t *grp = NULL;
         int             rc;
@@ -675,22 +669,22 @@ lstcon_nodes_remove(char *name, int count,
         if (grp->grp_ref > 2) {
                 /* referred by test */
                 CDEBUG(D_NET, "Group %s is busy\n", name);
-                lstcon_group_put(grp);
+               lstcon_group_decref(grp);
                 return -EBUSY;
         }
 
         rc = lstcon_group_nodes_remove(grp, count, ids_up, result_up);
 
-       lstcon_group_put(grp);
+       lstcon_group_decref(grp);
        /* release empty group */
        if (list_empty(&grp->grp_ndl_list))
-               lstcon_group_put(grp);
+               lstcon_group_decref(grp);
 
        return rc;
 }
 
 int
-lstcon_group_refresh(char *name, struct list_head *result_up)
+lstcon_group_refresh(char *name, struct list_head __user *result_up)
 {
         lstcon_rpc_trans_t      *trans;
         lstcon_group_t          *grp;
@@ -705,7 +699,7 @@ lstcon_group_refresh(char *name, struct list_head *result_up)
         if (grp->grp_ref > 2) {
                 /* referred by test */
                 CDEBUG(D_NET, "Group %s is busy\n", name);
-                lstcon_group_put(grp);
+               lstcon_group_decref(grp);
                 return -EBUSY;
         }
 
@@ -716,7 +710,7 @@ lstcon_group_refresh(char *name, struct list_head *result_up)
         if (rc != 0) {
                 /* local error, return */
                 CDEBUG(D_NET, "Can't create transaction: %d\n", rc);
-                lstcon_group_put(grp);
+               lstcon_group_decref(grp);
                 return rc;
         }
 
@@ -726,7 +720,7 @@ lstcon_group_refresh(char *name, struct list_head *result_up)
 
         lstcon_rpc_trans_destroy(trans);
         /* -ref for me */
-        lstcon_group_put(grp);
+       lstcon_group_decref(grp);
 
         return rc;
 }
@@ -751,7 +745,7 @@ lstcon_group_list(int index, int len, char __user *name_up)
 
 static int
 lstcon_nodes_getent(struct list_head *head, int *index_p,
-                    int *count_p, lstcon_node_ent_t *dents_up)
+                   int *count_p, lstcon_node_ent_t __user *dents_up)
 {
         lstcon_ndlink_t  *ndl;
         lstcon_node_t    *nd;
@@ -790,8 +784,9 @@ lstcon_nodes_getent(struct list_head *head, int *index_p,
 }
 
 int
-lstcon_group_info(char *name, lstcon_ndlist_ent_t *gents_p,
-                  int *index_p, int *count_p, lstcon_node_ent_t *dents_up)
+lstcon_group_info(char *name, lstcon_ndlist_ent_t __user *gents_p,
+                 int *index_p, int *count_p,
+                 lstcon_node_ent_t __user *dents_up)
 {
         lstcon_ndlist_ent_t *gentp;
         lstcon_group_t      *grp;
@@ -804,11 +799,11 @@ lstcon_group_info(char *name, lstcon_ndlist_ent_t *gents_p,
                 return rc;
         }
 
-        if (dents_up != 0) {
+       if (dents_up != NULL) {
                 /* verbose query */
                 rc = lstcon_nodes_getent(&grp->grp_ndl_list,
                                          index_p, count_p, dents_up);
-                lstcon_group_put(grp);
+               lstcon_group_decref(grp);
 
                 return rc;
         }
@@ -817,7 +812,7 @@ lstcon_group_info(char *name, lstcon_ndlist_ent_t *gents_p,
         LIBCFS_ALLOC(gentp, sizeof(lstcon_ndlist_ent_t));
         if (gentp == NULL) {
                 CERROR("Can't allocate ndlist_ent\n");
-                lstcon_group_put(grp);
+               lstcon_group_decref(grp);
 
                 return -ENOMEM;
         }
@@ -832,7 +827,7 @@ lstcon_group_info(char *name, lstcon_ndlist_ent_t *gents_p,
 
        LIBCFS_FREE(gentp, sizeof(lstcon_ndlist_ent_t));
 
-       lstcon_group_put(grp);
+       lstcon_group_decref(grp);
 
        return 0;
 }
@@ -937,9 +932,9 @@ lstcon_batch_list(int index, int len, char __user *name_up)
 }
 
 int
-lstcon_batch_info(char *name, lstcon_test_batch_ent_t *ent_up, int server,
-                  int testidx, int *index_p, int *ndent_p,
-                  lstcon_node_ent_t *dents_up)
+lstcon_batch_info(char *name, lstcon_test_batch_ent_t __user *ent_up,
+                 int server, int testidx, int *index_p, int *ndent_p,
+                 lstcon_node_ent_t __user *dents_up)
 {
         lstcon_test_batch_ent_t *entp;
        struct list_head        *clilst;
@@ -1011,7 +1006,7 @@ lstcon_batch_info(char *name, lstcon_test_batch_ent_t *ent_up, int server,
        return rc;
 }
 
-int
+static int
 lstcon_batrpc_condition(int transop, lstcon_node_t *nd, void *arg)
 {
         switch (transop) {
@@ -1035,7 +1030,7 @@ lstcon_batrpc_condition(int transop, lstcon_node_t *nd, void *arg)
 
 static int
 lstcon_batch_op(lstcon_batch_t *bat, int transop,
-               struct list_head *result_up)
+               struct list_head __user *result_up)
 {
         lstcon_rpc_trans_t *trans;
         int                 rc;
@@ -1058,7 +1053,7 @@ lstcon_batch_op(lstcon_batch_t *bat, int transop,
 }
 
 int
-lstcon_batch_run(char *name, int timeout, struct list_head *result_up)
+lstcon_batch_run(char *name, int timeout, struct list_head __user *result_up)
 {
         lstcon_batch_t *bat;
         int             rc;
@@ -1080,7 +1075,7 @@ lstcon_batch_run(char *name, int timeout, struct list_head *result_up)
 }
 
 int
-lstcon_batch_stop(char *name, int force, struct list_head *result_up)
+lstcon_batch_stop(char *name, int force, struct list_head __user *result_up)
 {
         lstcon_batch_t *bat;
         int             rc;
@@ -1093,7 +1088,7 @@ lstcon_batch_stop(char *name, int force, struct list_head *result_up)
         bat->bat_arg = force;
 
         rc = lstcon_batch_op(bat, LST_TRANS_TSBSTOP, result_up);
-        
+
         /* mark batch as stopped if all RPCs finished */
         if (lstcon_tsbop_stat_failure(lstcon_trans_stat(), 0) == 0)
                 bat->bat_state = LST_BATCH_IDLE;
@@ -1117,8 +1112,8 @@ lstcon_batch_destroy(lstcon_batch_t *bat)
 
                list_del(&test->tes_link);
 
-               lstcon_group_put(test->tes_src_grp);
-               lstcon_group_put(test->tes_dst_grp);
+               lstcon_group_decref(test->tes_src_grp);
+               lstcon_group_decref(test->tes_dst_grp);
 
                LIBCFS_FREE(test, offsetof(lstcon_test_t,
                                           tes_param[test->tes_paramlen]));
@@ -1154,7 +1149,7 @@ lstcon_batch_destroy(lstcon_batch_t *bat)
        LIBCFS_FREE(bat, sizeof(lstcon_batch_t));
 }
 
-int
+static int
 lstcon_testrpc_condition(int transop, lstcon_node_t *nd, void *arg)
 {
        lstcon_test_t    *test;
@@ -1179,7 +1174,7 @@ lstcon_testrpc_condition(int transop, lstcon_node_t *nd, void *arg)
         if (transop == LST_TRANS_TSBCLIADD) {
                 hash = batch->bat_cli_hash;
                 head = &batch->bat_cli_list;
-        
+
         } else {
                 LASSERT (transop == LST_TRANS_TSBSRVADD);
 
@@ -1199,7 +1194,7 @@ lstcon_testrpc_condition(int transop, lstcon_node_t *nd, void *arg)
 }
 
 static int
-lstcon_test_nodes_add(lstcon_test_t *test, struct list_head *result_up)
+lstcon_test_nodes_add(lstcon_test_t *test, struct list_head __user *result_up)
 {
         lstcon_rpc_trans_t     *trans;
         lstcon_group_t         *grp;
@@ -1297,7 +1292,7 @@ lstcon_test_add(char *batch_name, int type, int loop,
                int concur, int dist, int span,
                char *src_name, char *dst_name,
                void *param, int paramlen, int *retp,
-               struct list_head *result_up)
+               struct list_head __user *result_up)
 {
        lstcon_test_t    *test   = NULL;
        int              rc;
@@ -1376,15 +1371,15 @@ out:
                LIBCFS_FREE(test, offsetof(lstcon_test_t, tes_param[paramlen]));
 
        if (dst_grp != NULL)
-               lstcon_group_put(dst_grp);
+               lstcon_group_decref(dst_grp);
 
        if (src_grp != NULL)
-               lstcon_group_put(src_grp);
+               lstcon_group_decref(src_grp);
 
        return rc;
 }
 
-int
+static int
 lstcon_test_find(lstcon_batch_t *batch, int idx, lstcon_test_t **testpp)
 {
        lstcon_test_t *test;
@@ -1399,9 +1394,9 @@ lstcon_test_find(lstcon_batch_t *batch, int idx, lstcon_test_t **testpp)
        return -ENOENT;
 }
 
-int
+static int
 lstcon_tsbrpc_readent(int transop, srpc_msg_t *msg,
-                      lstcon_rpc_ent_t *ent_up)
+                     lstcon_rpc_ent_t __user *ent_up)
 {
         srpc_batch_reply_t *rep = &msg->msg_body.bat_reply;
 
@@ -1418,7 +1413,7 @@ lstcon_tsbrpc_readent(int transop, srpc_msg_t *msg,
 
 int
 lstcon_test_batch_query(char *name, int testidx, int client,
-                       int timeout, struct list_head *result_up)
+                       int timeout, struct list_head __user *result_up)
 {
         lstcon_rpc_trans_t *trans;
        struct list_head   *translist;
@@ -1447,11 +1442,11 @@ lstcon_test_batch_query(char *name, int testidx, int client,
                         CDEBUG(D_NET, "Can't find test: %d\n", testidx);
                         return rc;
                 }
-        
+
                 translist = &test->tes_trans_list;
                 ndlist    = &test->tes_src_grp->grp_ndl_list;
                 hdr       = &test->tes_hdr;
-        } 
+       }
 
         transop = client ? LST_TRANS_TSBCLIQRY : LST_TRANS_TSBSRVQRY;
 
@@ -1478,21 +1473,23 @@ lstcon_test_batch_query(char *name, int testidx, int client,
         return rc;
 }
 
-int
+static int
 lstcon_statrpc_readent(int transop, srpc_msg_t *msg,
-                       lstcon_rpc_ent_t *ent_up)
+                      lstcon_rpc_ent_t __user *ent_up)
 {
-        srpc_stat_reply_t *rep = &msg->msg_body.stat_reply;
-        sfw_counters_t    *sfwk_stat;
-        srpc_counters_t   *srpc_stat;
-        lnet_counters_t   *lnet_stat;
-        
+       srpc_stat_reply_t *rep = &msg->msg_body.stat_reply;
+       sfw_counters_t __user  *sfwk_stat;
+       srpc_counters_t __user *srpc_stat;
+       lnet_counters_t __user *lnet_stat;
+
         if (rep->str_status != 0)
                 return 0;
 
-        sfwk_stat = (sfw_counters_t *)&ent_up->rpe_payload[0];
-        srpc_stat = (srpc_counters_t *)((char *)sfwk_stat + sizeof(*sfwk_stat));
-        lnet_stat = (lnet_counters_t *)((char *)srpc_stat + sizeof(*srpc_stat));
+       sfwk_stat = (sfw_counters_t __user *)&ent_up->rpe_payload[0];
+       srpc_stat = (srpc_counters_t __user *)
+               ((char __user *)sfwk_stat + sizeof(*sfwk_stat));
+       lnet_stat = (lnet_counters_t __user *)
+               ((char __user *)srpc_stat + sizeof(*srpc_stat));
 
        if (copy_to_user(sfwk_stat, &rep->str_fw, sizeof(*sfwk_stat)) ||
            copy_to_user(srpc_stat, &rep->str_rpc, sizeof(*srpc_stat)) ||
@@ -1502,9 +1499,9 @@ lstcon_statrpc_readent(int transop, srpc_msg_t *msg,
         return 0;
 }
 
-int
+static int
 lstcon_ndlist_stat(struct list_head *ndlist,
-                  int timeout, struct list_head *result_up)
+                  int timeout, struct list_head __user *result_up)
 {
        struct list_head    head;
        lstcon_rpc_trans_t *trans;
@@ -1529,7 +1526,8 @@ lstcon_ndlist_stat(struct list_head *ndlist,
 }
 
 int
-lstcon_group_stat(char *grp_name, int timeout, struct list_head *result_up)
+lstcon_group_stat(char *grp_name, int timeout,
+                 struct list_head __user *result_up)
 {
         lstcon_group_t     *grp;
         int                 rc;
@@ -1542,14 +1540,14 @@ lstcon_group_stat(char *grp_name, int timeout, struct list_head *result_up)
 
         rc = lstcon_ndlist_stat(&grp->grp_ndl_list, timeout, result_up);
 
-        lstcon_group_put(grp);
+       lstcon_group_decref(grp);
 
         return rc;
 }
 
 int
-lstcon_nodes_stat(int count, lnet_process_id_t *ids_up,
-                 int timeout, struct list_head *result_up)
+lstcon_nodes_stat(int count, lnet_process_id_t __user *ids_up,
+                 int timeout, struct list_head __user *result_up)
 {
         lstcon_ndlink_t         *ndl;
         lstcon_group_t          *tmp;
@@ -1580,21 +1578,21 @@ lstcon_nodes_stat(int count, lnet_process_id_t *ids_up,
         }
 
         if (rc != 0) {
-                lstcon_group_put(tmp);
+               lstcon_group_decref(tmp);
                 return rc;
         }
 
         rc = lstcon_ndlist_stat(&tmp->grp_ndl_list, timeout, result_up);
 
-        lstcon_group_put(tmp);
+       lstcon_group_decref(tmp);
 
         return rc;
 }
 
-int
+static int
 lstcon_debug_ndlist(struct list_head *ndlist,
                    struct list_head *translist,
-                   int timeout, struct list_head *result_up)
+                   int timeout, struct list_head __user *result_up)
 {
         lstcon_rpc_trans_t *trans;
         int                 rc;
@@ -1616,7 +1614,7 @@ lstcon_debug_ndlist(struct list_head *ndlist,
 }
 
 int
-lstcon_session_debug(int timeout, struct list_head *result_up)
+lstcon_session_debug(int timeout, struct list_head __user *result_up)
 {
         return lstcon_debug_ndlist(&console_session.ses_ndl_list,
                                    NULL, timeout, result_up);
@@ -1624,7 +1622,7 @@ lstcon_session_debug(int timeout, struct list_head *result_up)
 
 int
 lstcon_batch_debug(int timeout, char *name,
-                  int client, struct list_head *result_up)
+                  int client, struct list_head __user *result_up)
 {
         lstcon_batch_t *bat;
         int             rc;
@@ -1642,7 +1640,7 @@ lstcon_batch_debug(int timeout, char *name,
 
 int
 lstcon_group_debug(int timeout, char *name,
-                  struct list_head *result_up)
+                  struct list_head __user *result_up)
 {
         lstcon_group_t *grp;
         int             rc;
@@ -1653,15 +1651,15 @@ lstcon_group_debug(int timeout, char *name,
 
         rc = lstcon_debug_ndlist(&grp->grp_ndl_list, NULL,
                                  timeout, result_up);
-        lstcon_group_put(grp);
+       lstcon_group_decref(grp);
 
         return rc;
 }
 
 int
 lstcon_nodes_debug(int timeout,
-                   int count, lnet_process_id_t *ids_up, 
-                  struct list_head *result_up)
+                  int count, lnet_process_id_t __user *ids_up,
+                  struct list_head __user *result_up)
 {
         lnet_process_id_t  id;
         lstcon_ndlink_t   *ndl;
@@ -1690,14 +1688,14 @@ lstcon_nodes_debug(int timeout,
         }
 
         if (rc != 0) {
-                lstcon_group_put(grp);
+               lstcon_group_decref(grp);
                 return rc;
         }
 
         rc = lstcon_debug_ndlist(&grp->grp_ndl_list, NULL,
                                  timeout, result_up);
 
-        lstcon_group_put(grp);
+       lstcon_group_decref(grp);
 
         return rc;
 }
@@ -1721,11 +1719,9 @@ lstcon_new_session_id(lst_sid_t *sid)
         sid->ses_stamp = cfs_time_current();
 }
 
-extern srpc_service_t lstcon_acceptor_service;
-
 int
 lstcon_session_new(char *name, int key, unsigned feats,
-                  int timeout, int force, lst_sid_t *sid_up)
+                  int timeout, int force, lst_sid_t __user *sid_up)
 {
         int     rc = 0;
         int     i;
@@ -1793,8 +1789,10 @@ lstcon_session_new(char *name, int key, unsigned feats,
 }
 
 int
-lstcon_session_info(lst_sid_t *sid_up, int *key_up, unsigned *featp,
-                    lstcon_ndlist_ent_t *ndinfo_up, char *name_up, int len)
+lstcon_session_info(lst_sid_t __user *sid_up, int __user *key_up,
+                   unsigned __user *featp,
+                   lstcon_ndlist_ent_t __user *ndinfo_up,
+                   char __user *name_up, int len)
 {
         lstcon_ndlist_ent_t *entp;
         lstcon_ndlink_t     *ndl;
@@ -1837,7 +1835,7 @@ lstcon_session_end()
 
         LASSERT (console_session.ses_state == LST_SESSION_ACTIVE);
 
-        rc = lstcon_rpc_trans_ndlist(&console_session.ses_ndl_list, 
+       rc = lstcon_rpc_trans_ndlist(&console_session.ses_ndl_list,
                                      NULL, LST_TRANS_SESEND, NULL,
                                      lstcon_sesrpc_condition, &trans);
         if (rc != 0) {
@@ -1877,7 +1875,7 @@ lstcon_session_end()
                                 lstcon_group_t, grp_link);
                LASSERT(grp->grp_ref == 1);
 
-               lstcon_group_put(grp);
+               lstcon_group_decref(grp);
        }
 
        /* all nodes should be released */
@@ -1998,15 +1996,15 @@ lstcon_acceptor_handle (srpc_server_rpc_t *rpc)
 out:
        rep->msg_ses_feats = console_session.ses_features;
         if (grp != NULL)
-                lstcon_group_put(grp);
+               lstcon_group_decref(grp);
 
        mutex_unlock(&console_session.ses_mutex);
 
         return rc;
 }
 
-srpc_service_t lstcon_acceptor_service;
-void lstcon_init_acceptor_service(void)
+static srpc_service_t lstcon_acceptor_service;
+static void lstcon_init_acceptor_service(void)
 {
         /* initialize selftest console acceptor service table */
         lstcon_acceptor_service.sv_name    = "join session";
@@ -2015,7 +2013,7 @@ void lstcon_init_acceptor_service(void)
        lstcon_acceptor_service.sv_wi_total = SFW_FRWK_WI_MAX;
 }
 
-extern int lstcon_ioctl_entry(unsigned int cmd, struct libcfs_ioctl_data *data);
+int lstcon_ioctl_entry(unsigned int cmd, struct libcfs_ioctl_hdr *hdr);
 
 DECLARE_IOCTL_HANDLER(lstcon_ioctl_handler, lstcon_ioctl_entry);
 
@@ -2125,4 +2123,3 @@ lstcon_console_fini(void)
        return 0;
 }
 
-#endif