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>
43 #include "../../include/linux/libcfs/libcfs.h"
44 #include "../../include/linux/lnet/lib-lnet.h"
45 #include "../../include/linux/lnet/lnetst.h"
49 lst_session_new_ioctl(lstio_session_new_args_t *args)
54 if (args->lstio_ses_idp == NULL || /* address for output sid */
55 args->lstio_ses_key == 0 || /* no key is specified */
56 args->lstio_ses_namep == NULL || /* session name */
57 args->lstio_ses_nmlen <= 0 ||
58 args->lstio_ses_nmlen > LST_NAME_SIZE)
61 LIBCFS_ALLOC(name, args->lstio_ses_nmlen + 1);
65 if (copy_from_user(name,
66 args->lstio_ses_namep,
67 args->lstio_ses_nmlen)) {
68 LIBCFS_FREE(name, args->lstio_ses_nmlen + 1);
72 name[args->lstio_ses_nmlen] = 0;
74 rc = lstcon_session_new(name,
76 args->lstio_ses_feats,
77 args->lstio_ses_force,
78 args->lstio_ses_timeout,
81 LIBCFS_FREE(name, args->lstio_ses_nmlen + 1);
86 lst_session_end_ioctl(lstio_session_end_args_t *args)
88 if (args->lstio_ses_key != console_session.ses_key)
91 return lstcon_session_end();
95 lst_session_info_ioctl(lstio_session_info_args_t *args)
97 /* no checking of key */
99 if (args->lstio_ses_idp == NULL || /* address for output sid */
100 args->lstio_ses_keyp == NULL || /* address for output key */
101 args->lstio_ses_featp == NULL || /* address for output features */
102 args->lstio_ses_ndinfo == NULL || /* address for output ndinfo */
103 args->lstio_ses_namep == NULL || /* address for output name */
104 args->lstio_ses_nmlen <= 0 ||
105 args->lstio_ses_nmlen > LST_NAME_SIZE)
108 return lstcon_session_info(args->lstio_ses_idp,
109 args->lstio_ses_keyp,
110 args->lstio_ses_featp,
111 args->lstio_ses_ndinfo,
112 args->lstio_ses_namep,
113 args->lstio_ses_nmlen);
117 lst_debug_ioctl(lstio_debug_args_t *args)
123 if (args->lstio_dbg_key != console_session.ses_key)
126 if (args->lstio_dbg_resultp == NULL)
129 if (args->lstio_dbg_namep != NULL && /* name of batch/group */
130 (args->lstio_dbg_nmlen <= 0 ||
131 args->lstio_dbg_nmlen > LST_NAME_SIZE))
134 if (args->lstio_dbg_namep != NULL) {
135 LIBCFS_ALLOC(name, args->lstio_dbg_nmlen + 1);
139 if (copy_from_user(name, args->lstio_dbg_namep,
140 args->lstio_dbg_nmlen)) {
141 LIBCFS_FREE(name, args->lstio_dbg_nmlen + 1);
146 name[args->lstio_dbg_nmlen] = 0;
151 switch (args->lstio_dbg_type) {
152 case LST_OPC_SESSION:
153 rc = lstcon_session_debug(args->lstio_dbg_timeout,
154 args->lstio_dbg_resultp);
157 case LST_OPC_BATCHSRV:
159 case LST_OPC_BATCHCLI:
163 rc = lstcon_batch_debug(args->lstio_dbg_timeout,
164 name, client, args->lstio_dbg_resultp);
171 rc = lstcon_group_debug(args->lstio_dbg_timeout,
172 name, args->lstio_dbg_resultp);
176 if (args->lstio_dbg_count <= 0 ||
177 args->lstio_dbg_idsp == NULL)
180 rc = lstcon_nodes_debug(args->lstio_dbg_timeout,
181 args->lstio_dbg_count,
182 args->lstio_dbg_idsp,
183 args->lstio_dbg_resultp);
192 LIBCFS_FREE(name, args->lstio_dbg_nmlen + 1);
198 lst_group_add_ioctl(lstio_group_add_args_t *args)
203 if (args->lstio_grp_key != console_session.ses_key)
206 if (args->lstio_grp_namep == NULL ||
207 args->lstio_grp_nmlen <= 0 ||
208 args->lstio_grp_nmlen > LST_NAME_SIZE)
211 LIBCFS_ALLOC(name, args->lstio_grp_nmlen + 1);
215 if (copy_from_user(name,
216 args->lstio_grp_namep,
217 args->lstio_grp_nmlen)) {
218 LIBCFS_FREE(name, args->lstio_grp_nmlen);
222 name[args->lstio_grp_nmlen] = 0;
224 rc = lstcon_group_add(name);
226 LIBCFS_FREE(name, args->lstio_grp_nmlen + 1);
232 lst_group_del_ioctl(lstio_group_del_args_t *args)
237 if (args->lstio_grp_key != console_session.ses_key)
240 if (args->lstio_grp_namep == NULL ||
241 args->lstio_grp_nmlen <= 0 ||
242 args->lstio_grp_nmlen > LST_NAME_SIZE)
245 LIBCFS_ALLOC(name, args->lstio_grp_nmlen + 1);
249 if (copy_from_user(name,
250 args->lstio_grp_namep,
251 args->lstio_grp_nmlen)) {
252 LIBCFS_FREE(name, args->lstio_grp_nmlen + 1);
256 name[args->lstio_grp_nmlen] = 0;
258 rc = lstcon_group_del(name);
260 LIBCFS_FREE(name, args->lstio_grp_nmlen + 1);
266 lst_group_update_ioctl(lstio_group_update_args_t *args)
271 if (args->lstio_grp_key != console_session.ses_key)
274 if (args->lstio_grp_resultp == NULL ||
275 args->lstio_grp_namep == NULL ||
276 args->lstio_grp_nmlen <= 0 ||
277 args->lstio_grp_nmlen > LST_NAME_SIZE)
280 LIBCFS_ALLOC(name, args->lstio_grp_nmlen + 1);
284 if (copy_from_user(name,
285 args->lstio_grp_namep,
286 args->lstio_grp_nmlen)) {
287 LIBCFS_FREE(name, args->lstio_grp_nmlen + 1);
291 name[args->lstio_grp_nmlen] = 0;
293 switch (args->lstio_grp_opc) {
294 case LST_GROUP_CLEAN:
295 rc = lstcon_group_clean(name, args->lstio_grp_args);
298 case LST_GROUP_REFRESH:
299 rc = lstcon_group_refresh(name, args->lstio_grp_resultp);
303 if (args->lstio_grp_count <= 0 ||
304 args->lstio_grp_idsp == NULL) {
308 rc = lstcon_nodes_remove(name, args->lstio_grp_count,
309 args->lstio_grp_idsp,
310 args->lstio_grp_resultp);
318 LIBCFS_FREE(name, args->lstio_grp_nmlen + 1);
324 lst_nodes_add_ioctl(lstio_group_nodes_args_t *args)
330 if (args->lstio_grp_key != console_session.ses_key)
333 if (args->lstio_grp_idsp == NULL || /* array of ids */
334 args->lstio_grp_count <= 0 ||
335 args->lstio_grp_resultp == NULL ||
336 args->lstio_grp_featp == NULL ||
337 args->lstio_grp_namep == NULL ||
338 args->lstio_grp_nmlen <= 0 ||
339 args->lstio_grp_nmlen > LST_NAME_SIZE)
342 LIBCFS_ALLOC(name, args->lstio_grp_nmlen + 1);
346 if (copy_from_user(name, args->lstio_grp_namep,
347 args->lstio_grp_nmlen)) {
348 LIBCFS_FREE(name, args->lstio_grp_nmlen + 1);
353 name[args->lstio_grp_nmlen] = 0;
355 rc = lstcon_nodes_add(name, args->lstio_grp_count,
356 args->lstio_grp_idsp, &feats,
357 args->lstio_grp_resultp);
359 LIBCFS_FREE(name, args->lstio_grp_nmlen + 1);
361 copy_to_user(args->lstio_grp_featp, &feats, sizeof(feats))) {
369 lst_group_list_ioctl(lstio_group_list_args_t *args)
371 if (args->lstio_grp_key != console_session.ses_key)
374 if (args->lstio_grp_idx < 0 ||
375 args->lstio_grp_namep == NULL ||
376 args->lstio_grp_nmlen <= 0 ||
377 args->lstio_grp_nmlen > LST_NAME_SIZE)
380 return lstcon_group_list(args->lstio_grp_idx,
381 args->lstio_grp_nmlen,
382 args->lstio_grp_namep);
386 lst_group_info_ioctl(lstio_group_info_args_t *args)
393 if (args->lstio_grp_key != console_session.ses_key)
396 if (args->lstio_grp_namep == NULL ||
397 args->lstio_grp_nmlen <= 0 ||
398 args->lstio_grp_nmlen > LST_NAME_SIZE)
401 if (args->lstio_grp_entp == NULL && /* output: group entry */
402 args->lstio_grp_dentsp == NULL) /* output: node entry */
405 if (args->lstio_grp_dentsp != NULL) { /* have node entry */
406 if (args->lstio_grp_idxp == NULL || /* node index */
407 args->lstio_grp_ndentp == NULL) /* # of node entry */
410 if (copy_from_user(&ndent, args->lstio_grp_ndentp,
412 copy_from_user(&index, args->lstio_grp_idxp,
416 if (ndent <= 0 || index < 0)
420 LIBCFS_ALLOC(name, args->lstio_grp_nmlen + 1);
424 if (copy_from_user(name,
425 args->lstio_grp_namep,
426 args->lstio_grp_nmlen)) {
427 LIBCFS_FREE(name, args->lstio_grp_nmlen + 1);
431 name[args->lstio_grp_nmlen] = 0;
433 rc = lstcon_group_info(name, args->lstio_grp_entp,
434 &index, &ndent, args->lstio_grp_dentsp);
436 LIBCFS_FREE(name, args->lstio_grp_nmlen + 1);
441 if (args->lstio_grp_dentsp != NULL &&
442 (copy_to_user(args->lstio_grp_idxp, &index, sizeof(index)) ||
443 copy_to_user(args->lstio_grp_ndentp, &ndent, sizeof(ndent))))
450 lst_batch_add_ioctl(lstio_batch_add_args_t *args)
455 if (args->lstio_bat_key != console_session.ses_key)
458 if (args->lstio_bat_namep == NULL ||
459 args->lstio_bat_nmlen <= 0 ||
460 args->lstio_bat_nmlen > LST_NAME_SIZE)
463 LIBCFS_ALLOC(name, args->lstio_bat_nmlen + 1);
467 if (copy_from_user(name,
468 args->lstio_bat_namep,
469 args->lstio_bat_nmlen)) {
470 LIBCFS_FREE(name, args->lstio_bat_nmlen + 1);
474 name[args->lstio_bat_nmlen] = 0;
476 rc = lstcon_batch_add(name);
478 LIBCFS_FREE(name, args->lstio_bat_nmlen + 1);
484 lst_batch_run_ioctl(lstio_batch_run_args_t *args)
489 if (args->lstio_bat_key != console_session.ses_key)
492 if (args->lstio_bat_namep == NULL ||
493 args->lstio_bat_nmlen <= 0 ||
494 args->lstio_bat_nmlen > LST_NAME_SIZE)
497 LIBCFS_ALLOC(name, args->lstio_bat_nmlen + 1);
501 if (copy_from_user(name,
502 args->lstio_bat_namep,
503 args->lstio_bat_nmlen)) {
504 LIBCFS_FREE(name, args->lstio_bat_nmlen + 1);
508 name[args->lstio_bat_nmlen] = 0;
510 rc = lstcon_batch_run(name, args->lstio_bat_timeout,
511 args->lstio_bat_resultp);
513 LIBCFS_FREE(name, args->lstio_bat_nmlen + 1);
519 lst_batch_stop_ioctl(lstio_batch_stop_args_t *args)
524 if (args->lstio_bat_key != console_session.ses_key)
527 if (args->lstio_bat_resultp == NULL ||
528 args->lstio_bat_namep == NULL ||
529 args->lstio_bat_nmlen <= 0 ||
530 args->lstio_bat_nmlen > LST_NAME_SIZE)
533 LIBCFS_ALLOC(name, args->lstio_bat_nmlen + 1);
537 if (copy_from_user(name,
538 args->lstio_bat_namep,
539 args->lstio_bat_nmlen)) {
540 LIBCFS_FREE(name, args->lstio_bat_nmlen + 1);
544 name[args->lstio_bat_nmlen] = 0;
546 rc = lstcon_batch_stop(name, args->lstio_bat_force,
547 args->lstio_bat_resultp);
549 LIBCFS_FREE(name, args->lstio_bat_nmlen + 1);
555 lst_batch_query_ioctl(lstio_batch_query_args_t *args)
560 if (args->lstio_bat_key != console_session.ses_key)
563 if (args->lstio_bat_resultp == NULL ||
564 args->lstio_bat_namep == NULL ||
565 args->lstio_bat_nmlen <= 0 ||
566 args->lstio_bat_nmlen > LST_NAME_SIZE)
569 if (args->lstio_bat_testidx < 0)
572 LIBCFS_ALLOC(name, args->lstio_bat_nmlen + 1);
576 if (copy_from_user(name,
577 args->lstio_bat_namep,
578 args->lstio_bat_nmlen)) {
579 LIBCFS_FREE(name, args->lstio_bat_nmlen + 1);
583 name[args->lstio_bat_nmlen] = 0;
585 rc = lstcon_test_batch_query(name,
586 args->lstio_bat_testidx,
587 args->lstio_bat_client,
588 args->lstio_bat_timeout,
589 args->lstio_bat_resultp);
591 LIBCFS_FREE(name, args->lstio_bat_nmlen + 1);
597 lst_batch_list_ioctl(lstio_batch_list_args_t *args)
599 if (args->lstio_bat_key != console_session.ses_key)
602 if (args->lstio_bat_idx < 0 ||
603 args->lstio_bat_namep == NULL ||
604 args->lstio_bat_nmlen <= 0 ||
605 args->lstio_bat_nmlen > LST_NAME_SIZE)
608 return lstcon_batch_list(args->lstio_bat_idx,
609 args->lstio_bat_nmlen,
610 args->lstio_bat_namep);
614 lst_batch_info_ioctl(lstio_batch_info_args_t *args)
621 if (args->lstio_bat_key != console_session.ses_key)
624 if (args->lstio_bat_namep == NULL || /* batch name */
625 args->lstio_bat_nmlen <= 0 ||
626 args->lstio_bat_nmlen > LST_NAME_SIZE)
629 if (args->lstio_bat_entp == NULL && /* output: batch entry */
630 args->lstio_bat_dentsp == NULL) /* output: node entry */
633 if (args->lstio_bat_dentsp != NULL) { /* have node entry */
634 if (args->lstio_bat_idxp == NULL || /* node index */
635 args->lstio_bat_ndentp == NULL) /* # of node entry */
638 if (copy_from_user(&index, args->lstio_bat_idxp,
640 copy_from_user(&ndent, args->lstio_bat_ndentp,
644 if (ndent <= 0 || index < 0)
648 LIBCFS_ALLOC(name, args->lstio_bat_nmlen + 1);
652 if (copy_from_user(name,
653 args->lstio_bat_namep, args->lstio_bat_nmlen)) {
654 LIBCFS_FREE(name, args->lstio_bat_nmlen + 1);
658 name[args->lstio_bat_nmlen] = 0;
660 rc = lstcon_batch_info(name,
661 args->lstio_bat_entp, args->lstio_bat_server,
662 args->lstio_bat_testidx, &index, &ndent,
663 args->lstio_bat_dentsp);
665 LIBCFS_FREE(name, args->lstio_bat_nmlen + 1);
670 if (args->lstio_bat_dentsp != NULL &&
671 (copy_to_user(args->lstio_bat_idxp, &index, sizeof(index)) ||
672 copy_to_user(args->lstio_bat_ndentp, &ndent, sizeof(ndent))))
679 lst_stat_query_ioctl(lstio_stat_args_t *args)
684 /* TODO: not finished */
685 if (args->lstio_sta_key != console_session.ses_key)
688 if (args->lstio_sta_resultp == NULL ||
689 (args->lstio_sta_namep == NULL &&
690 args->lstio_sta_idsp == NULL) ||
691 args->lstio_sta_nmlen <= 0 ||
692 args->lstio_sta_nmlen > LST_NAME_SIZE)
695 if (args->lstio_sta_idsp != NULL &&
696 args->lstio_sta_count <= 0)
699 LIBCFS_ALLOC(name, args->lstio_sta_nmlen + 1);
703 if (copy_from_user(name, args->lstio_sta_namep,
704 args->lstio_sta_nmlen)) {
705 LIBCFS_FREE(name, args->lstio_sta_nmlen + 1);
709 if (args->lstio_sta_idsp == NULL) {
710 rc = lstcon_group_stat(name, args->lstio_sta_timeout,
711 args->lstio_sta_resultp);
713 rc = lstcon_nodes_stat(args->lstio_sta_count,
714 args->lstio_sta_idsp,
715 args->lstio_sta_timeout,
716 args->lstio_sta_resultp);
719 LIBCFS_FREE(name, args->lstio_sta_nmlen + 1);
724 static int lst_test_add_ioctl(lstio_test_args_t *args)
727 char *src_name = NULL;
728 char *dst_name = NULL;
733 if (args->lstio_tes_resultp == NULL ||
734 args->lstio_tes_retp == NULL ||
735 args->lstio_tes_bat_name == NULL || /* no specified batch */
736 args->lstio_tes_bat_nmlen <= 0 ||
737 args->lstio_tes_bat_nmlen > LST_NAME_SIZE ||
738 args->lstio_tes_sgrp_name == NULL || /* no source group */
739 args->lstio_tes_sgrp_nmlen <= 0 ||
740 args->lstio_tes_sgrp_nmlen > LST_NAME_SIZE ||
741 args->lstio_tes_dgrp_name == NULL || /* no target group */
742 args->lstio_tes_dgrp_nmlen <= 0 ||
743 args->lstio_tes_dgrp_nmlen > LST_NAME_SIZE)
746 if (args->lstio_tes_loop == 0 || /* negative is infinite */
747 args->lstio_tes_concur <= 0 ||
748 args->lstio_tes_dist <= 0 ||
749 args->lstio_tes_span <= 0)
752 /* have parameter, check if parameter length is valid */
753 if (args->lstio_tes_param != NULL &&
754 (args->lstio_tes_param_len <= 0 ||
755 args->lstio_tes_param_len > PAGE_CACHE_SIZE - sizeof(lstcon_test_t)))
758 LIBCFS_ALLOC(batch_name, args->lstio_tes_bat_nmlen + 1);
759 if (batch_name == NULL)
762 LIBCFS_ALLOC(src_name, args->lstio_tes_sgrp_nmlen + 1);
763 if (src_name == NULL)
766 LIBCFS_ALLOC(dst_name, args->lstio_tes_dgrp_nmlen + 1);
767 if (dst_name == NULL)
770 if (args->lstio_tes_param != NULL) {
771 LIBCFS_ALLOC(param, args->lstio_tes_param_len);
777 if (copy_from_user(batch_name, args->lstio_tes_bat_name,
778 args->lstio_tes_bat_nmlen) ||
779 copy_from_user(src_name, args->lstio_tes_sgrp_name,
780 args->lstio_tes_sgrp_nmlen) ||
781 copy_from_user(dst_name, args->lstio_tes_dgrp_name,
782 args->lstio_tes_dgrp_nmlen) ||
783 copy_from_user(param, args->lstio_tes_param,
784 args->lstio_tes_param_len))
787 rc = lstcon_test_add(batch_name,
788 args->lstio_tes_type,
789 args->lstio_tes_loop,
790 args->lstio_tes_concur,
791 args->lstio_tes_dist, args->lstio_tes_span,
792 src_name, dst_name, param,
793 args->lstio_tes_param_len,
794 &ret, args->lstio_tes_resultp);
797 rc = (copy_to_user(args->lstio_tes_retp, &ret,
798 sizeof(ret))) ? -EFAULT : 0;
800 if (batch_name != NULL)
801 LIBCFS_FREE(batch_name, args->lstio_tes_bat_nmlen + 1);
803 if (src_name != NULL)
804 LIBCFS_FREE(src_name, args->lstio_tes_sgrp_nmlen + 1);
806 if (dst_name != NULL)
807 LIBCFS_FREE(dst_name, args->lstio_tes_dgrp_nmlen + 1);
810 LIBCFS_FREE(param, args->lstio_tes_param_len);
816 lstcon_ioctl_entry(unsigned int cmd, struct libcfs_ioctl_data *data)
819 int opc = data->ioc_u32[0];
822 if (cmd != IOC_LIBCFS_LNETST)
825 if (data->ioc_plen1 > PAGE_CACHE_SIZE)
828 LIBCFS_ALLOC(buf, data->ioc_plen1);
832 /* copy in parameter */
833 if (copy_from_user(buf, data->ioc_pbuf1, data->ioc_plen1)) {
834 LIBCFS_FREE(buf, data->ioc_plen1);
838 mutex_lock(&console_session.ses_mutex);
840 console_session.ses_laststamp = get_seconds();
842 if (console_session.ses_shutdown) {
847 if (console_session.ses_expired)
848 lstcon_session_end();
850 if (opc != LSTIO_SESSION_NEW &&
851 console_session.ses_state == LST_SESSION_NONE) {
852 CDEBUG(D_NET, "LST no active session\n");
857 memset(&console_session.ses_trans_stat, 0, sizeof(lstcon_trans_stat_t));
860 case LSTIO_SESSION_NEW:
861 rc = lst_session_new_ioctl((lstio_session_new_args_t *)buf);
863 case LSTIO_SESSION_END:
864 rc = lst_session_end_ioctl((lstio_session_end_args_t *)buf);
866 case LSTIO_SESSION_INFO:
867 rc = lst_session_info_ioctl((lstio_session_info_args_t *)buf);
870 rc = lst_debug_ioctl((lstio_debug_args_t *)buf);
872 case LSTIO_GROUP_ADD:
873 rc = lst_group_add_ioctl((lstio_group_add_args_t *)buf);
875 case LSTIO_GROUP_DEL:
876 rc = lst_group_del_ioctl((lstio_group_del_args_t *)buf);
878 case LSTIO_GROUP_UPDATE:
879 rc = lst_group_update_ioctl((lstio_group_update_args_t *)buf);
881 case LSTIO_NODES_ADD:
882 rc = lst_nodes_add_ioctl((lstio_group_nodes_args_t *)buf);
884 case LSTIO_GROUP_LIST:
885 rc = lst_group_list_ioctl((lstio_group_list_args_t *)buf);
887 case LSTIO_GROUP_INFO:
888 rc = lst_group_info_ioctl((lstio_group_info_args_t *)buf);
890 case LSTIO_BATCH_ADD:
891 rc = lst_batch_add_ioctl((lstio_batch_add_args_t *)buf);
893 case LSTIO_BATCH_START:
894 rc = lst_batch_run_ioctl((lstio_batch_run_args_t *)buf);
896 case LSTIO_BATCH_STOP:
897 rc = lst_batch_stop_ioctl((lstio_batch_stop_args_t *)buf);
899 case LSTIO_BATCH_QUERY:
900 rc = lst_batch_query_ioctl((lstio_batch_query_args_t *)buf);
902 case LSTIO_BATCH_LIST:
903 rc = lst_batch_list_ioctl((lstio_batch_list_args_t *)buf);
905 case LSTIO_BATCH_INFO:
906 rc = lst_batch_info_ioctl((lstio_batch_info_args_t *)buf);
909 rc = lst_test_add_ioctl((lstio_test_args_t *)buf);
911 case LSTIO_STAT_QUERY:
912 rc = lst_stat_query_ioctl((lstio_stat_args_t *)buf);
918 if (copy_to_user(data->ioc_pbuf2, &console_session.ses_trans_stat,
919 sizeof(lstcon_trans_stat_t)))
922 mutex_unlock(&console_session.ses_mutex);
924 LIBCFS_FREE(buf, data->ioc_plen1);
929 EXPORT_SYMBOL(lstcon_ioctl_entry);