4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 only,
8 * as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License version 2 for more details (a copy is included
14 * in the LICENSE file that accompanied this code).
16 * You should have received a copy of the GNU General Public License
17 * version 2 along with this program; If not, see
18 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
20 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
21 * CA 95054 USA or visit www.sun.com if you need additional information or
27 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
28 * Use is subject to license terms.
30 * Copyright (c) 2012, Intel Corporation.
33 * This file is part of Lustre, http://www.lustre.org/
34 * Lustre is a trademark of Sun Microsystems, Inc.
36 * lnet/selftest/conctl.c
38 * IOC handle in kernel
40 * Author: Liang Zhen <liangzhen@clusterfs.com>
44 #include <libcfs/libcfs.h>
45 #include <lnet/lib-lnet.h>
46 #include <lnet/lnetst.h>
50 lst_session_new_ioctl(lstio_session_new_args_t *args)
55 if (args->lstio_ses_idp == NULL || /* address for output sid */
56 args->lstio_ses_key == 0 || /* no key is specified */
57 args->lstio_ses_namep == NULL || /* session name */
58 args->lstio_ses_nmlen <= 0 ||
59 args->lstio_ses_nmlen > LST_NAME_SIZE)
62 LIBCFS_ALLOC(name, args->lstio_ses_nmlen + 1);
66 if (cfs_copy_from_user(name,
67 args->lstio_ses_namep,
68 args->lstio_ses_nmlen)) {
69 LIBCFS_FREE(name, args->lstio_ses_nmlen + 1);
73 name[args->lstio_ses_nmlen] = 0;
75 rc = lstcon_session_new(name,
77 args->lstio_ses_feats,
78 args->lstio_ses_force,
79 args->lstio_ses_timeout,
82 LIBCFS_FREE(name, args->lstio_ses_nmlen + 1);
87 lst_session_end_ioctl(lstio_session_end_args_t *args)
89 if (args->lstio_ses_key != console_session.ses_key)
92 return lstcon_session_end();
96 lst_session_info_ioctl(lstio_session_info_args_t *args)
98 /* no checking of key */
100 if (args->lstio_ses_idp == NULL || /* address for ouput sid */
101 args->lstio_ses_keyp == NULL || /* address for ouput key */
102 args->lstio_ses_featp == NULL || /* address for ouput features */
103 args->lstio_ses_ndinfo == NULL || /* address for output ndinfo */
104 args->lstio_ses_namep == NULL || /* address for ouput name */
105 args->lstio_ses_nmlen <= 0 ||
106 args->lstio_ses_nmlen > LST_NAME_SIZE)
109 return lstcon_session_info(args->lstio_ses_idp,
110 args->lstio_ses_keyp,
111 args->lstio_ses_featp,
112 args->lstio_ses_ndinfo,
113 args->lstio_ses_namep,
114 args->lstio_ses_nmlen);
118 lst_debug_ioctl(lstio_debug_args_t *args)
124 if (args->lstio_dbg_key != console_session.ses_key)
127 if (args->lstio_dbg_resultp == NULL)
130 if (args->lstio_dbg_namep != NULL && /* name of batch/group */
131 (args->lstio_dbg_nmlen <= 0 ||
132 args->lstio_dbg_nmlen > LST_NAME_SIZE))
135 if (args->lstio_dbg_namep != NULL) {
136 LIBCFS_ALLOC(name, args->lstio_dbg_nmlen + 1);
140 if (cfs_copy_from_user(name, args->lstio_dbg_namep,
141 args->lstio_dbg_nmlen)) {
142 LIBCFS_FREE(name, args->lstio_dbg_nmlen + 1);
147 name[args->lstio_dbg_nmlen] = 0;
152 switch (args->lstio_dbg_type) {
153 case LST_OPC_SESSION:
154 rc = lstcon_session_debug(args->lstio_dbg_timeout,
155 args->lstio_dbg_resultp);
158 case LST_OPC_BATCHSRV:
160 case LST_OPC_BATCHCLI:
164 rc = lstcon_batch_debug(args->lstio_dbg_timeout,
165 name, client, args->lstio_dbg_resultp);
172 rc = lstcon_group_debug(args->lstio_dbg_timeout,
173 name, args->lstio_dbg_resultp);
177 if (args->lstio_dbg_count <= 0 ||
178 args->lstio_dbg_idsp == NULL)
181 rc = lstcon_nodes_debug(args->lstio_dbg_timeout,
182 args->lstio_dbg_count,
183 args->lstio_dbg_idsp,
184 args->lstio_dbg_resultp);
193 LIBCFS_FREE(name, args->lstio_dbg_nmlen + 1);
199 lst_group_add_ioctl(lstio_group_add_args_t *args)
204 if (args->lstio_grp_key != console_session.ses_key)
207 if (args->lstio_grp_namep == NULL||
208 args->lstio_grp_nmlen <= 0 ||
209 args->lstio_grp_nmlen > LST_NAME_SIZE)
212 LIBCFS_ALLOC(name, args->lstio_grp_nmlen + 1);
216 if (cfs_copy_from_user(name,
217 args->lstio_grp_namep,
218 args->lstio_grp_nmlen)) {
219 LIBCFS_FREE(name, args->lstio_grp_nmlen);
223 name[args->lstio_grp_nmlen] = 0;
225 rc = lstcon_group_add(name);
227 LIBCFS_FREE(name, args->lstio_grp_nmlen + 1);
233 lst_group_del_ioctl(lstio_group_del_args_t *args)
238 if (args->lstio_grp_key != console_session.ses_key)
241 if (args->lstio_grp_namep == NULL ||
242 args->lstio_grp_nmlen <= 0 ||
243 args->lstio_grp_nmlen > LST_NAME_SIZE)
246 LIBCFS_ALLOC(name, args->lstio_grp_nmlen + 1);
250 if (cfs_copy_from_user(name,
251 args->lstio_grp_namep,
252 args->lstio_grp_nmlen)) {
253 LIBCFS_FREE(name, args->lstio_grp_nmlen + 1);
257 name[args->lstio_grp_nmlen] = 0;
259 rc = lstcon_group_del(name);
261 LIBCFS_FREE(name, args->lstio_grp_nmlen + 1);
267 lst_group_update_ioctl(lstio_group_update_args_t *args)
272 if (args->lstio_grp_key != console_session.ses_key)
275 if (args->lstio_grp_resultp == NULL ||
276 args->lstio_grp_namep == NULL ||
277 args->lstio_grp_nmlen <= 0 ||
278 args->lstio_grp_nmlen > LST_NAME_SIZE)
281 LIBCFS_ALLOC(name, args->lstio_grp_nmlen + 1);
285 if (cfs_copy_from_user(name,
286 args->lstio_grp_namep,
287 args->lstio_grp_nmlen)) {
288 LIBCFS_FREE(name, args->lstio_grp_nmlen + 1);
292 name[args->lstio_grp_nmlen] = 0;
294 switch (args->lstio_grp_opc) {
295 case LST_GROUP_CLEAN:
296 rc = lstcon_group_clean(name, args->lstio_grp_args);
299 case LST_GROUP_REFRESH:
300 rc = lstcon_group_refresh(name, args->lstio_grp_resultp);
304 if (args->lstio_grp_count <= 0 ||
305 args->lstio_grp_idsp == NULL) {
309 rc = lstcon_nodes_remove(name, args->lstio_grp_count,
310 args->lstio_grp_idsp,
311 args->lstio_grp_resultp);
319 LIBCFS_FREE(name, args->lstio_grp_nmlen + 1);
325 lst_nodes_add_ioctl(lstio_group_nodes_args_t *args)
331 if (args->lstio_grp_key != console_session.ses_key)
334 if (args->lstio_grp_idsp == NULL || /* array of ids */
335 args->lstio_grp_count <= 0 ||
336 args->lstio_grp_resultp == NULL ||
337 args->lstio_grp_featp == NULL ||
338 args->lstio_grp_namep == NULL ||
339 args->lstio_grp_nmlen <= 0 ||
340 args->lstio_grp_nmlen > LST_NAME_SIZE)
343 LIBCFS_ALLOC(name, args->lstio_grp_nmlen + 1);
347 if (cfs_copy_from_user(name, args->lstio_grp_namep,
348 args->lstio_grp_nmlen)) {
349 LIBCFS_FREE(name, args->lstio_grp_nmlen + 1);
354 name[args->lstio_grp_nmlen] = 0;
356 rc = lstcon_nodes_add(name, args->lstio_grp_count,
357 args->lstio_grp_idsp, &feats,
358 args->lstio_grp_resultp);
360 LIBCFS_FREE(name, args->lstio_grp_nmlen + 1);
362 cfs_copy_to_user(args->lstio_grp_featp, &feats, sizeof(feats))) {
370 lst_group_list_ioctl(lstio_group_list_args_t *args)
372 if (args->lstio_grp_key != console_session.ses_key)
375 if (args->lstio_grp_idx < 0 ||
376 args->lstio_grp_namep == NULL ||
377 args->lstio_grp_nmlen <= 0 ||
378 args->lstio_grp_nmlen > LST_NAME_SIZE)
381 return lstcon_group_list(args->lstio_grp_idx,
382 args->lstio_grp_nmlen,
383 args->lstio_grp_namep);
387 lst_group_info_ioctl(lstio_group_info_args_t *args)
394 if (args->lstio_grp_key != console_session.ses_key)
397 if (args->lstio_grp_namep == NULL ||
398 args->lstio_grp_nmlen <= 0 ||
399 args->lstio_grp_nmlen > LST_NAME_SIZE)
402 if (args->lstio_grp_entp == NULL && /* output: group entry */
403 args->lstio_grp_dentsp == NULL) /* output: node entry */
406 if (args->lstio_grp_dentsp != NULL) { /* have node entry */
407 if (args->lstio_grp_idxp == NULL || /* node index */
408 args->lstio_grp_ndentp == NULL) /* # of node entry */
411 if (cfs_copy_from_user(&ndent, args->lstio_grp_ndentp,
413 cfs_copy_from_user(&index, args->lstio_grp_idxp,
417 if (ndent <= 0 || index < 0)
421 LIBCFS_ALLOC(name, args->lstio_grp_nmlen + 1);
425 if (cfs_copy_from_user(name,
426 args->lstio_grp_namep,
427 args->lstio_grp_nmlen)) {
428 LIBCFS_FREE(name, args->lstio_grp_nmlen + 1);
432 name[args->lstio_grp_nmlen] = 0;
434 rc = lstcon_group_info(name, args->lstio_grp_entp,
435 &index, &ndent, args->lstio_grp_dentsp);
437 LIBCFS_FREE(name, args->lstio_grp_nmlen + 1);
442 if (args->lstio_grp_dentsp != NULL &&
443 (cfs_copy_to_user(args->lstio_grp_idxp, &index, sizeof(index)) ||
444 cfs_copy_to_user(args->lstio_grp_ndentp, &ndent, sizeof(ndent))))
451 lst_batch_add_ioctl(lstio_batch_add_args_t *args)
456 if (args->lstio_bat_key != console_session.ses_key)
459 if (args->lstio_bat_namep == NULL ||
460 args->lstio_bat_nmlen <= 0 ||
461 args->lstio_bat_nmlen > LST_NAME_SIZE)
464 LIBCFS_ALLOC(name, args->lstio_bat_nmlen + 1);
468 if (cfs_copy_from_user(name,
469 args->lstio_bat_namep,
470 args->lstio_bat_nmlen)) {
471 LIBCFS_FREE(name, args->lstio_bat_nmlen + 1);
475 name[args->lstio_bat_nmlen] = 0;
477 rc = lstcon_batch_add(name);
479 LIBCFS_FREE(name, args->lstio_bat_nmlen + 1);
485 lst_batch_run_ioctl(lstio_batch_run_args_t *args)
490 if (args->lstio_bat_key != console_session.ses_key)
493 if (args->lstio_bat_namep == NULL ||
494 args->lstio_bat_nmlen <= 0 ||
495 args->lstio_bat_nmlen > LST_NAME_SIZE)
498 LIBCFS_ALLOC(name, args->lstio_bat_nmlen + 1);
502 if (cfs_copy_from_user(name,
503 args->lstio_bat_namep,
504 args->lstio_bat_nmlen)) {
505 LIBCFS_FREE(name, args->lstio_bat_nmlen + 1);
509 name[args->lstio_bat_nmlen] = 0;
511 rc = lstcon_batch_run(name, args->lstio_bat_timeout,
512 args->lstio_bat_resultp);
514 LIBCFS_FREE(name, args->lstio_bat_nmlen + 1);
520 lst_batch_stop_ioctl(lstio_batch_stop_args_t *args)
525 if (args->lstio_bat_key != console_session.ses_key)
528 if (args->lstio_bat_resultp == NULL ||
529 args->lstio_bat_namep == NULL ||
530 args->lstio_bat_nmlen <= 0 ||
531 args->lstio_bat_nmlen > LST_NAME_SIZE)
534 LIBCFS_ALLOC(name, args->lstio_bat_nmlen + 1);
538 if (cfs_copy_from_user(name,
539 args->lstio_bat_namep,
540 args->lstio_bat_nmlen)) {
541 LIBCFS_FREE(name, args->lstio_bat_nmlen + 1);
545 name[args->lstio_bat_nmlen] = 0;
547 rc = lstcon_batch_stop(name, args->lstio_bat_force,
548 args->lstio_bat_resultp);
550 LIBCFS_FREE(name, args->lstio_bat_nmlen + 1);
556 lst_batch_query_ioctl(lstio_batch_query_args_t *args)
561 if (args->lstio_bat_key != console_session.ses_key)
564 if (args->lstio_bat_resultp == NULL ||
565 args->lstio_bat_namep == NULL ||
566 args->lstio_bat_nmlen <= 0 ||
567 args->lstio_bat_nmlen > LST_NAME_SIZE)
570 if (args->lstio_bat_testidx < 0)
573 LIBCFS_ALLOC(name, args->lstio_bat_nmlen + 1);
577 if (cfs_copy_from_user(name,
578 args->lstio_bat_namep,
579 args->lstio_bat_nmlen)) {
580 LIBCFS_FREE(name, args->lstio_bat_nmlen + 1);
584 name[args->lstio_bat_nmlen] = 0;
586 rc = lstcon_test_batch_query(name,
587 args->lstio_bat_testidx,
588 args->lstio_bat_client,
589 args->lstio_bat_timeout,
590 args->lstio_bat_resultp);
592 LIBCFS_FREE(name, args->lstio_bat_nmlen + 1);
598 lst_batch_list_ioctl(lstio_batch_list_args_t *args)
600 if (args->lstio_bat_key != console_session.ses_key)
603 if (args->lstio_bat_idx < 0 ||
604 args->lstio_bat_namep == NULL ||
605 args->lstio_bat_nmlen <= 0 ||
606 args->lstio_bat_nmlen > LST_NAME_SIZE)
609 return lstcon_batch_list(args->lstio_bat_idx,
610 args->lstio_bat_nmlen,
611 args->lstio_bat_namep);
615 lst_batch_info_ioctl(lstio_batch_info_args_t *args)
622 if (args->lstio_bat_key != console_session.ses_key)
625 if (args->lstio_bat_namep == NULL || /* batch name */
626 args->lstio_bat_nmlen <= 0 ||
627 args->lstio_bat_nmlen > LST_NAME_SIZE)
630 if (args->lstio_bat_entp == NULL && /* output: batch entry */
631 args->lstio_bat_dentsp == NULL) /* output: node entry */
634 if (args->lstio_bat_dentsp != NULL) { /* have node entry */
635 if (args->lstio_bat_idxp == NULL || /* node index */
636 args->lstio_bat_ndentp == NULL) /* # of node entry */
639 if (cfs_copy_from_user(&index, args->lstio_bat_idxp,
641 cfs_copy_from_user(&ndent, args->lstio_bat_ndentp,
645 if (ndent <= 0 || index < 0)
649 LIBCFS_ALLOC(name, args->lstio_bat_nmlen + 1);
653 if (cfs_copy_from_user(name,
654 args->lstio_bat_namep, args->lstio_bat_nmlen)) {
655 LIBCFS_FREE(name, args->lstio_bat_nmlen + 1);
659 name[args->lstio_bat_nmlen] = 0;
661 rc = lstcon_batch_info(name,
662 args->lstio_bat_entp, args->lstio_bat_server,
663 args->lstio_bat_testidx, &index, &ndent,
664 args->lstio_bat_dentsp);
666 LIBCFS_FREE(name, args->lstio_bat_nmlen + 1);
671 if (args->lstio_bat_dentsp != NULL &&
672 (cfs_copy_to_user(args->lstio_bat_idxp, &index, sizeof(index)) ||
673 cfs_copy_to_user(args->lstio_bat_ndentp, &ndent, sizeof(ndent))))
680 lst_stat_query_ioctl(lstio_stat_args_t *args)
685 /* TODO: not finished */
686 if (args->lstio_sta_key != console_session.ses_key)
689 if (args->lstio_sta_resultp == NULL ||
690 (args->lstio_sta_namep == NULL &&
691 args->lstio_sta_idsp == NULL) ||
692 args->lstio_sta_nmlen <= 0 ||
693 args->lstio_sta_nmlen > LST_NAME_SIZE)
696 if (args->lstio_sta_idsp != NULL &&
697 args->lstio_sta_count <= 0)
700 LIBCFS_ALLOC(name, args->lstio_sta_nmlen + 1);
704 if (cfs_copy_from_user(name, args->lstio_sta_namep,
705 args->lstio_sta_nmlen)) {
706 LIBCFS_FREE(name, args->lstio_sta_nmlen + 1);
710 if (args->lstio_sta_idsp == NULL) {
711 rc = lstcon_group_stat(name, args->lstio_sta_timeout,
712 args->lstio_sta_resultp);
714 rc = lstcon_nodes_stat(args->lstio_sta_count,
715 args->lstio_sta_idsp,
716 args->lstio_sta_timeout,
717 args->lstio_sta_resultp);
720 LIBCFS_FREE(name, args->lstio_sta_nmlen + 1);
725 int lst_test_add_ioctl(lstio_test_args_t *args)
734 if (args->lstio_tes_resultp == NULL ||
735 args->lstio_tes_retp == NULL ||
736 args->lstio_tes_bat_name == NULL || /* no specified batch */
737 args->lstio_tes_bat_nmlen <= 0 ||
738 args->lstio_tes_bat_nmlen > LST_NAME_SIZE ||
739 args->lstio_tes_sgrp_name == NULL || /* no source group */
740 args->lstio_tes_sgrp_nmlen <= 0 ||
741 args->lstio_tes_sgrp_nmlen > LST_NAME_SIZE ||
742 args->lstio_tes_dgrp_name == NULL || /* no target group */
743 args->lstio_tes_dgrp_nmlen <= 0 ||
744 args->lstio_tes_dgrp_nmlen > LST_NAME_SIZE)
747 if (args->lstio_tes_loop == 0 || /* negative is infinite */
748 args->lstio_tes_concur <= 0 ||
749 args->lstio_tes_dist <= 0 ||
750 args->lstio_tes_span <= 0)
753 /* have parameter, check if parameter length is valid */
754 if (args->lstio_tes_param != NULL &&
755 (args->lstio_tes_param_len <= 0 ||
756 args->lstio_tes_param_len > CFS_PAGE_SIZE - sizeof(lstcon_test_t)))
759 LIBCFS_ALLOC(name, args->lstio_tes_bat_nmlen + 1);
763 LIBCFS_ALLOC(srcgrp, args->lstio_tes_sgrp_nmlen + 1);
767 LIBCFS_ALLOC(dstgrp, args->lstio_tes_dgrp_nmlen + 1);
771 if (args->lstio_tes_param != NULL) {
772 LIBCFS_ALLOC(param, args->lstio_tes_param_len);
778 if (cfs_copy_from_user(name,
779 args->lstio_tes_bat_name,
780 args->lstio_tes_bat_nmlen) ||
781 cfs_copy_from_user(srcgrp,
782 args->lstio_tes_sgrp_name,
783 args->lstio_tes_sgrp_nmlen) ||
784 cfs_copy_from_user(dstgrp,
785 args->lstio_tes_dgrp_name,
786 args->lstio_tes_dgrp_nmlen) ||
787 cfs_copy_from_user(param, args->lstio_tes_param,
788 args->lstio_tes_param_len))
791 rc = lstcon_test_add(name,
792 args->lstio_tes_type,
793 args->lstio_tes_loop,
794 args->lstio_tes_concur,
795 args->lstio_tes_dist, args->lstio_tes_span,
796 srcgrp, dstgrp, param, args->lstio_tes_param_len,
797 &ret, args->lstio_tes_resultp);
800 rc = (cfs_copy_to_user(args->lstio_tes_retp, &ret,
801 sizeof(ret))) ? -EFAULT : 0;
804 LIBCFS_FREE(name, args->lstio_tes_bat_nmlen + 1);
807 LIBCFS_FREE(srcgrp, args->lstio_tes_sgrp_nmlen + 1);
810 LIBCFS_FREE(dstgrp, args->lstio_tes_dgrp_nmlen + 1);
813 LIBCFS_FREE(param, args->lstio_tes_param_len);
819 lstcon_ioctl_entry(unsigned int cmd, struct libcfs_ioctl_data *data)
822 int opc = data->ioc_u32[0];
825 if (cmd != IOC_LIBCFS_LNETST)
828 if (data->ioc_plen1 > CFS_PAGE_SIZE)
831 LIBCFS_ALLOC(buf, data->ioc_plen1);
835 /* copy in parameter */
836 if (cfs_copy_from_user(buf, data->ioc_pbuf1, data->ioc_plen1)) {
837 LIBCFS_FREE(buf, data->ioc_plen1);
841 mutex_lock(&console_session.ses_mutex);
843 console_session.ses_laststamp = cfs_time_current_sec();
845 if (console_session.ses_shutdown) {
850 if (console_session.ses_expired)
851 lstcon_session_end();
853 if (opc != LSTIO_SESSION_NEW &&
854 console_session.ses_state == LST_SESSION_NONE) {
855 CDEBUG(D_NET, "LST no active session\n");
860 memset(&console_session.ses_trans_stat, 0, sizeof(lstcon_trans_stat_t));
863 case LSTIO_SESSION_NEW:
864 rc = lst_session_new_ioctl((lstio_session_new_args_t *)buf);
866 case LSTIO_SESSION_END:
867 rc = lst_session_end_ioctl((lstio_session_end_args_t *)buf);
869 case LSTIO_SESSION_INFO:
870 rc = lst_session_info_ioctl((lstio_session_info_args_t *)buf);
873 rc = lst_debug_ioctl((lstio_debug_args_t *)buf);
875 case LSTIO_GROUP_ADD:
876 rc = lst_group_add_ioctl((lstio_group_add_args_t *)buf);
878 case LSTIO_GROUP_DEL:
879 rc = lst_group_del_ioctl((lstio_group_del_args_t *)buf);
881 case LSTIO_GROUP_UPDATE:
882 rc = lst_group_update_ioctl((lstio_group_update_args_t *)buf);
884 case LSTIO_NODES_ADD:
885 rc = lst_nodes_add_ioctl((lstio_group_nodes_args_t *)buf);
887 case LSTIO_GROUP_LIST:
888 rc = lst_group_list_ioctl((lstio_group_list_args_t *)buf);
890 case LSTIO_GROUP_INFO:
891 rc = lst_group_info_ioctl((lstio_group_info_args_t *)buf);
893 case LSTIO_BATCH_ADD:
894 rc = lst_batch_add_ioctl((lstio_batch_add_args_t *)buf);
896 case LSTIO_BATCH_START:
897 rc = lst_batch_run_ioctl((lstio_batch_run_args_t *)buf);
899 case LSTIO_BATCH_STOP:
900 rc = lst_batch_stop_ioctl((lstio_batch_stop_args_t *)buf);
902 case LSTIO_BATCH_QUERY:
903 rc = lst_batch_query_ioctl((lstio_batch_query_args_t *)buf);
905 case LSTIO_BATCH_LIST:
906 rc = lst_batch_list_ioctl((lstio_batch_list_args_t *)buf);
908 case LSTIO_BATCH_INFO:
909 rc = lst_batch_info_ioctl((lstio_batch_info_args_t *)buf);
912 rc = lst_test_add_ioctl((lstio_test_args_t *)buf);
914 case LSTIO_STAT_QUERY:
915 rc = lst_stat_query_ioctl((lstio_stat_args_t *)buf);
921 if (cfs_copy_to_user(data->ioc_pbuf2, &console_session.ses_trans_stat,
922 sizeof(lstcon_trans_stat_t)))
925 mutex_unlock(&console_session.ses_mutex);
927 LIBCFS_FREE(buf, data->ioc_plen1);
932 EXPORT_SYMBOL(lstcon_ioctl_entry);