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
|| /* address for output sid */
55 !args
->lstio_ses_key
|| /* no key is specified */
56 !args
->lstio_ses_namep
|| /* 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
, args
->lstio_ses_namep
,
66 args
->lstio_ses_nmlen
)) {
67 LIBCFS_FREE(name
, args
->lstio_ses_nmlen
+ 1);
71 name
[args
->lstio_ses_nmlen
] = 0;
73 rc
= lstcon_session_new(name
,
75 args
->lstio_ses_feats
,
76 args
->lstio_ses_force
,
77 args
->lstio_ses_timeout
,
80 LIBCFS_FREE(name
, args
->lstio_ses_nmlen
+ 1);
85 lst_session_end_ioctl(lstio_session_end_args_t
*args
)
87 if (args
->lstio_ses_key
!= console_session
.ses_key
)
90 return lstcon_session_end();
94 lst_session_info_ioctl(lstio_session_info_args_t
*args
)
96 /* no checking of key */
98 if (!args
->lstio_ses_idp
|| /* address for output sid */
99 !args
->lstio_ses_keyp
|| /* address for output key */
100 !args
->lstio_ses_featp
|| /* address for output features */
101 !args
->lstio_ses_ndinfo
|| /* address for output ndinfo */
102 !args
->lstio_ses_namep
|| /* address for output name */
103 args
->lstio_ses_nmlen
<= 0 ||
104 args
->lstio_ses_nmlen
> LST_NAME_SIZE
)
107 return lstcon_session_info(args
->lstio_ses_idp
,
108 args
->lstio_ses_keyp
,
109 args
->lstio_ses_featp
,
110 args
->lstio_ses_ndinfo
,
111 args
->lstio_ses_namep
,
112 args
->lstio_ses_nmlen
);
116 lst_debug_ioctl(lstio_debug_args_t
*args
)
122 if (args
->lstio_dbg_key
!= console_session
.ses_key
)
125 if (!args
->lstio_dbg_resultp
)
128 if (args
->lstio_dbg_namep
&& /* name of batch/group */
129 (args
->lstio_dbg_nmlen
<= 0 ||
130 args
->lstio_dbg_nmlen
> LST_NAME_SIZE
))
133 if (args
->lstio_dbg_namep
) {
134 LIBCFS_ALLOC(name
, args
->lstio_dbg_nmlen
+ 1);
138 if (copy_from_user(name
, args
->lstio_dbg_namep
,
139 args
->lstio_dbg_nmlen
)) {
140 LIBCFS_FREE(name
, args
->lstio_dbg_nmlen
+ 1);
145 name
[args
->lstio_dbg_nmlen
] = 0;
150 switch (args
->lstio_dbg_type
) {
151 case LST_OPC_SESSION
:
152 rc
= lstcon_session_debug(args
->lstio_dbg_timeout
,
153 args
->lstio_dbg_resultp
);
156 case LST_OPC_BATCHSRV
:
158 case LST_OPC_BATCHCLI
:
162 rc
= lstcon_batch_debug(args
->lstio_dbg_timeout
,
163 name
, client
, args
->lstio_dbg_resultp
);
170 rc
= lstcon_group_debug(args
->lstio_dbg_timeout
,
171 name
, args
->lstio_dbg_resultp
);
175 if (args
->lstio_dbg_count
<= 0 ||
176 !args
->lstio_dbg_idsp
)
179 rc
= lstcon_nodes_debug(args
->lstio_dbg_timeout
,
180 args
->lstio_dbg_count
,
181 args
->lstio_dbg_idsp
,
182 args
->lstio_dbg_resultp
);
191 LIBCFS_FREE(name
, args
->lstio_dbg_nmlen
+ 1);
197 lst_group_add_ioctl(lstio_group_add_args_t
*args
)
202 if (args
->lstio_grp_key
!= console_session
.ses_key
)
205 if (!args
->lstio_grp_namep
||
206 args
->lstio_grp_nmlen
<= 0 ||
207 args
->lstio_grp_nmlen
> LST_NAME_SIZE
)
210 LIBCFS_ALLOC(name
, args
->lstio_grp_nmlen
+ 1);
214 if (copy_from_user(name
, args
->lstio_grp_namep
,
215 args
->lstio_grp_nmlen
)) {
216 LIBCFS_FREE(name
, args
->lstio_grp_nmlen
);
220 name
[args
->lstio_grp_nmlen
] = 0;
222 rc
= lstcon_group_add(name
);
224 LIBCFS_FREE(name
, args
->lstio_grp_nmlen
+ 1);
230 lst_group_del_ioctl(lstio_group_del_args_t
*args
)
235 if (args
->lstio_grp_key
!= console_session
.ses_key
)
238 if (!args
->lstio_grp_namep
||
239 args
->lstio_grp_nmlen
<= 0 ||
240 args
->lstio_grp_nmlen
> LST_NAME_SIZE
)
243 LIBCFS_ALLOC(name
, args
->lstio_grp_nmlen
+ 1);
247 if (copy_from_user(name
, args
->lstio_grp_namep
,
248 args
->lstio_grp_nmlen
)) {
249 LIBCFS_FREE(name
, args
->lstio_grp_nmlen
+ 1);
253 name
[args
->lstio_grp_nmlen
] = 0;
255 rc
= lstcon_group_del(name
);
257 LIBCFS_FREE(name
, args
->lstio_grp_nmlen
+ 1);
263 lst_group_update_ioctl(lstio_group_update_args_t
*args
)
268 if (args
->lstio_grp_key
!= console_session
.ses_key
)
271 if (!args
->lstio_grp_resultp
||
272 !args
->lstio_grp_namep
||
273 args
->lstio_grp_nmlen
<= 0 ||
274 args
->lstio_grp_nmlen
> LST_NAME_SIZE
)
277 LIBCFS_ALLOC(name
, args
->lstio_grp_nmlen
+ 1);
281 if (copy_from_user(name
,
282 args
->lstio_grp_namep
,
283 args
->lstio_grp_nmlen
)) {
284 LIBCFS_FREE(name
, args
->lstio_grp_nmlen
+ 1);
288 name
[args
->lstio_grp_nmlen
] = 0;
290 switch (args
->lstio_grp_opc
) {
291 case LST_GROUP_CLEAN
:
292 rc
= lstcon_group_clean(name
, args
->lstio_grp_args
);
295 case LST_GROUP_REFRESH
:
296 rc
= lstcon_group_refresh(name
, args
->lstio_grp_resultp
);
300 if (args
->lstio_grp_count
<= 0 ||
301 !args
->lstio_grp_idsp
) {
305 rc
= lstcon_nodes_remove(name
, args
->lstio_grp_count
,
306 args
->lstio_grp_idsp
,
307 args
->lstio_grp_resultp
);
315 LIBCFS_FREE(name
, args
->lstio_grp_nmlen
+ 1);
321 lst_nodes_add_ioctl(lstio_group_nodes_args_t
*args
)
327 if (args
->lstio_grp_key
!= console_session
.ses_key
)
330 if (!args
->lstio_grp_idsp
|| /* array of ids */
331 args
->lstio_grp_count
<= 0 ||
332 !args
->lstio_grp_resultp
||
333 !args
->lstio_grp_featp
||
334 !args
->lstio_grp_namep
||
335 args
->lstio_grp_nmlen
<= 0 ||
336 args
->lstio_grp_nmlen
> LST_NAME_SIZE
)
339 LIBCFS_ALLOC(name
, args
->lstio_grp_nmlen
+ 1);
343 if (copy_from_user(name
, args
->lstio_grp_namep
,
344 args
->lstio_grp_nmlen
)) {
345 LIBCFS_FREE(name
, args
->lstio_grp_nmlen
+ 1);
350 name
[args
->lstio_grp_nmlen
] = 0;
352 rc
= lstcon_nodes_add(name
, args
->lstio_grp_count
,
353 args
->lstio_grp_idsp
, &feats
,
354 args
->lstio_grp_resultp
);
356 LIBCFS_FREE(name
, args
->lstio_grp_nmlen
+ 1);
358 copy_to_user(args
->lstio_grp_featp
, &feats
, sizeof(feats
))) {
366 lst_group_list_ioctl(lstio_group_list_args_t
*args
)
368 if (args
->lstio_grp_key
!= console_session
.ses_key
)
371 if (args
->lstio_grp_idx
< 0 ||
372 !args
->lstio_grp_namep
||
373 args
->lstio_grp_nmlen
<= 0 ||
374 args
->lstio_grp_nmlen
> LST_NAME_SIZE
)
377 return lstcon_group_list(args
->lstio_grp_idx
,
378 args
->lstio_grp_nmlen
,
379 args
->lstio_grp_namep
);
383 lst_group_info_ioctl(lstio_group_info_args_t
*args
)
390 if (args
->lstio_grp_key
!= console_session
.ses_key
)
393 if (!args
->lstio_grp_namep
||
394 args
->lstio_grp_nmlen
<= 0 ||
395 args
->lstio_grp_nmlen
> LST_NAME_SIZE
)
398 if (!args
->lstio_grp_entp
&& /* output: group entry */
399 !args
->lstio_grp_dentsp
) /* output: node entry */
402 if (args
->lstio_grp_dentsp
) { /* have node entry */
403 if (!args
->lstio_grp_idxp
|| /* node index */
404 !args
->lstio_grp_ndentp
) /* # of node entry */
407 if (copy_from_user(&ndent
, args
->lstio_grp_ndentp
,
409 copy_from_user(&index
, args
->lstio_grp_idxp
,
413 if (ndent
<= 0 || index
< 0)
417 LIBCFS_ALLOC(name
, args
->lstio_grp_nmlen
+ 1);
421 if (copy_from_user(name
, args
->lstio_grp_namep
,
422 args
->lstio_grp_nmlen
)) {
423 LIBCFS_FREE(name
, args
->lstio_grp_nmlen
+ 1);
427 name
[args
->lstio_grp_nmlen
] = 0;
429 rc
= lstcon_group_info(name
, args
->lstio_grp_entp
,
430 &index
, &ndent
, args
->lstio_grp_dentsp
);
432 LIBCFS_FREE(name
, args
->lstio_grp_nmlen
+ 1);
437 if (args
->lstio_grp_dentsp
&&
438 (copy_to_user(args
->lstio_grp_idxp
, &index
, sizeof(index
)) ||
439 copy_to_user(args
->lstio_grp_ndentp
, &ndent
, sizeof(ndent
))))
446 lst_batch_add_ioctl(lstio_batch_add_args_t
*args
)
451 if (args
->lstio_bat_key
!= console_session
.ses_key
)
454 if (!args
->lstio_bat_namep
||
455 args
->lstio_bat_nmlen
<= 0 ||
456 args
->lstio_bat_nmlen
> LST_NAME_SIZE
)
459 LIBCFS_ALLOC(name
, args
->lstio_bat_nmlen
+ 1);
463 if (copy_from_user(name
, args
->lstio_bat_namep
,
464 args
->lstio_bat_nmlen
)) {
465 LIBCFS_FREE(name
, args
->lstio_bat_nmlen
+ 1);
469 name
[args
->lstio_bat_nmlen
] = 0;
471 rc
= lstcon_batch_add(name
);
473 LIBCFS_FREE(name
, args
->lstio_bat_nmlen
+ 1);
479 lst_batch_run_ioctl(lstio_batch_run_args_t
*args
)
484 if (args
->lstio_bat_key
!= console_session
.ses_key
)
487 if (!args
->lstio_bat_namep
||
488 args
->lstio_bat_nmlen
<= 0 ||
489 args
->lstio_bat_nmlen
> LST_NAME_SIZE
)
492 LIBCFS_ALLOC(name
, args
->lstio_bat_nmlen
+ 1);
496 if (copy_from_user(name
, args
->lstio_bat_namep
,
497 args
->lstio_bat_nmlen
)) {
498 LIBCFS_FREE(name
, args
->lstio_bat_nmlen
+ 1);
502 name
[args
->lstio_bat_nmlen
] = 0;
504 rc
= lstcon_batch_run(name
, args
->lstio_bat_timeout
,
505 args
->lstio_bat_resultp
);
507 LIBCFS_FREE(name
, args
->lstio_bat_nmlen
+ 1);
513 lst_batch_stop_ioctl(lstio_batch_stop_args_t
*args
)
518 if (args
->lstio_bat_key
!= console_session
.ses_key
)
521 if (!args
->lstio_bat_resultp
||
522 !args
->lstio_bat_namep
||
523 args
->lstio_bat_nmlen
<= 0 ||
524 args
->lstio_bat_nmlen
> LST_NAME_SIZE
)
527 LIBCFS_ALLOC(name
, args
->lstio_bat_nmlen
+ 1);
531 if (copy_from_user(name
, args
->lstio_bat_namep
,
532 args
->lstio_bat_nmlen
)) {
533 LIBCFS_FREE(name
, args
->lstio_bat_nmlen
+ 1);
537 name
[args
->lstio_bat_nmlen
] = 0;
539 rc
= lstcon_batch_stop(name
, args
->lstio_bat_force
,
540 args
->lstio_bat_resultp
);
542 LIBCFS_FREE(name
, args
->lstio_bat_nmlen
+ 1);
548 lst_batch_query_ioctl(lstio_batch_query_args_t
*args
)
553 if (args
->lstio_bat_key
!= console_session
.ses_key
)
556 if (!args
->lstio_bat_resultp
||
557 !args
->lstio_bat_namep
||
558 args
->lstio_bat_nmlen
<= 0 ||
559 args
->lstio_bat_nmlen
> LST_NAME_SIZE
)
562 if (args
->lstio_bat_testidx
< 0)
565 LIBCFS_ALLOC(name
, args
->lstio_bat_nmlen
+ 1);
569 if (copy_from_user(name
, args
->lstio_bat_namep
,
570 args
->lstio_bat_nmlen
)) {
571 LIBCFS_FREE(name
, args
->lstio_bat_nmlen
+ 1);
575 name
[args
->lstio_bat_nmlen
] = 0;
577 rc
= lstcon_test_batch_query(name
,
578 args
->lstio_bat_testidx
,
579 args
->lstio_bat_client
,
580 args
->lstio_bat_timeout
,
581 args
->lstio_bat_resultp
);
583 LIBCFS_FREE(name
, args
->lstio_bat_nmlen
+ 1);
589 lst_batch_list_ioctl(lstio_batch_list_args_t
*args
)
591 if (args
->lstio_bat_key
!= console_session
.ses_key
)
594 if (args
->lstio_bat_idx
< 0 ||
595 !args
->lstio_bat_namep
||
596 args
->lstio_bat_nmlen
<= 0 ||
597 args
->lstio_bat_nmlen
> LST_NAME_SIZE
)
600 return lstcon_batch_list(args
->lstio_bat_idx
,
601 args
->lstio_bat_nmlen
,
602 args
->lstio_bat_namep
);
606 lst_batch_info_ioctl(lstio_batch_info_args_t
*args
)
613 if (args
->lstio_bat_key
!= console_session
.ses_key
)
616 if (!args
->lstio_bat_namep
|| /* batch name */
617 args
->lstio_bat_nmlen
<= 0 ||
618 args
->lstio_bat_nmlen
> LST_NAME_SIZE
)
621 if (!args
->lstio_bat_entp
&& /* output: batch entry */
622 !args
->lstio_bat_dentsp
) /* output: node entry */
625 if (args
->lstio_bat_dentsp
) { /* have node entry */
626 if (!args
->lstio_bat_idxp
|| /* node index */
627 !args
->lstio_bat_ndentp
) /* # of node entry */
630 if (copy_from_user(&index
, args
->lstio_bat_idxp
,
632 copy_from_user(&ndent
, args
->lstio_bat_ndentp
,
636 if (ndent
<= 0 || index
< 0)
640 LIBCFS_ALLOC(name
, args
->lstio_bat_nmlen
+ 1);
644 if (copy_from_user(name
, args
->lstio_bat_namep
,
645 args
->lstio_bat_nmlen
)) {
646 LIBCFS_FREE(name
, args
->lstio_bat_nmlen
+ 1);
650 name
[args
->lstio_bat_nmlen
] = 0;
652 rc
= lstcon_batch_info(name
, args
->lstio_bat_entp
,
653 args
->lstio_bat_server
, args
->lstio_bat_testidx
,
654 &index
, &ndent
, args
->lstio_bat_dentsp
);
656 LIBCFS_FREE(name
, args
->lstio_bat_nmlen
+ 1);
661 if (args
->lstio_bat_dentsp
&&
662 (copy_to_user(args
->lstio_bat_idxp
, &index
, sizeof(index
)) ||
663 copy_to_user(args
->lstio_bat_ndentp
, &ndent
, sizeof(ndent
))))
670 lst_stat_query_ioctl(lstio_stat_args_t
*args
)
675 /* TODO: not finished */
676 if (args
->lstio_sta_key
!= console_session
.ses_key
)
679 if (!args
->lstio_sta_resultp
||
680 (!args
->lstio_sta_namep
&& !args
->lstio_sta_idsp
) ||
681 args
->lstio_sta_nmlen
<= 0 ||
682 args
->lstio_sta_nmlen
> LST_NAME_SIZE
)
685 if (args
->lstio_sta_idsp
&&
686 args
->lstio_sta_count
<= 0)
689 LIBCFS_ALLOC(name
, args
->lstio_sta_nmlen
+ 1);
693 if (copy_from_user(name
, args
->lstio_sta_namep
,
694 args
->lstio_sta_nmlen
)) {
695 LIBCFS_FREE(name
, args
->lstio_sta_nmlen
+ 1);
699 if (!args
->lstio_sta_idsp
) {
700 rc
= lstcon_group_stat(name
, args
->lstio_sta_timeout
,
701 args
->lstio_sta_resultp
);
703 rc
= lstcon_nodes_stat(args
->lstio_sta_count
,
704 args
->lstio_sta_idsp
,
705 args
->lstio_sta_timeout
,
706 args
->lstio_sta_resultp
);
709 LIBCFS_FREE(name
, args
->lstio_sta_nmlen
+ 1);
714 static int lst_test_add_ioctl(lstio_test_args_t
*args
)
717 char *src_name
= NULL
;
718 char *dst_name
= NULL
;
723 if (!args
->lstio_tes_resultp
||
724 !args
->lstio_tes_retp
||
725 !args
->lstio_tes_bat_name
|| /* no specified batch */
726 args
->lstio_tes_bat_nmlen
<= 0 ||
727 args
->lstio_tes_bat_nmlen
> LST_NAME_SIZE
||
728 !args
->lstio_tes_sgrp_name
|| /* no source group */
729 args
->lstio_tes_sgrp_nmlen
<= 0 ||
730 args
->lstio_tes_sgrp_nmlen
> LST_NAME_SIZE
||
731 !args
->lstio_tes_dgrp_name
|| /* no target group */
732 args
->lstio_tes_dgrp_nmlen
<= 0 ||
733 args
->lstio_tes_dgrp_nmlen
> LST_NAME_SIZE
)
736 if (!args
->lstio_tes_loop
|| /* negative is infinite */
737 args
->lstio_tes_concur
<= 0 ||
738 args
->lstio_tes_dist
<= 0 ||
739 args
->lstio_tes_span
<= 0)
742 /* have parameter, check if parameter length is valid */
743 if (args
->lstio_tes_param
&&
744 (args
->lstio_tes_param_len
<= 0 ||
745 args
->lstio_tes_param_len
> PAGE_CACHE_SIZE
- sizeof(lstcon_test_t
)))
748 LIBCFS_ALLOC(batch_name
, args
->lstio_tes_bat_nmlen
+ 1);
752 LIBCFS_ALLOC(src_name
, args
->lstio_tes_sgrp_nmlen
+ 1);
756 LIBCFS_ALLOC(dst_name
, args
->lstio_tes_dgrp_nmlen
+ 1);
760 if (args
->lstio_tes_param
) {
761 LIBCFS_ALLOC(param
, args
->lstio_tes_param_len
);
767 if (copy_from_user(batch_name
, args
->lstio_tes_bat_name
,
768 args
->lstio_tes_bat_nmlen
) ||
769 copy_from_user(src_name
, args
->lstio_tes_sgrp_name
,
770 args
->lstio_tes_sgrp_nmlen
) ||
771 copy_from_user(dst_name
, args
->lstio_tes_dgrp_name
,
772 args
->lstio_tes_dgrp_nmlen
) ||
773 copy_from_user(param
, args
->lstio_tes_param
,
774 args
->lstio_tes_param_len
))
777 rc
= lstcon_test_add(batch_name
, args
->lstio_tes_type
,
778 args
->lstio_tes_loop
, args
->lstio_tes_concur
,
779 args
->lstio_tes_dist
, args
->lstio_tes_span
,
780 src_name
, dst_name
, param
,
781 args
->lstio_tes_param_len
,
782 &ret
, args
->lstio_tes_resultp
);
785 rc
= (copy_to_user(args
->lstio_tes_retp
, &ret
,
786 sizeof(ret
))) ? -EFAULT
: 0;
789 LIBCFS_FREE(batch_name
, args
->lstio_tes_bat_nmlen
+ 1);
792 LIBCFS_FREE(src_name
, args
->lstio_tes_sgrp_nmlen
+ 1);
795 LIBCFS_FREE(dst_name
, args
->lstio_tes_dgrp_nmlen
+ 1);
798 LIBCFS_FREE(param
, args
->lstio_tes_param_len
);
804 lstcon_ioctl_entry(unsigned int cmd
, struct libcfs_ioctl_hdr
*hdr
)
807 struct libcfs_ioctl_data
*data
;
811 if (cmd
!= IOC_LIBCFS_LNETST
)
814 data
= container_of(hdr
, struct libcfs_ioctl_data
, ioc_hdr
);
816 opc
= data
->ioc_u32
[0];
818 if (data
->ioc_plen1
> PAGE_CACHE_SIZE
)
821 LIBCFS_ALLOC(buf
, data
->ioc_plen1
);
825 /* copy in parameter */
826 if (copy_from_user(buf
, data
->ioc_pbuf1
, data
->ioc_plen1
)) {
827 LIBCFS_FREE(buf
, data
->ioc_plen1
);
831 mutex_lock(&console_session
.ses_mutex
);
833 console_session
.ses_laststamp
= ktime_get_real_seconds();
835 if (console_session
.ses_shutdown
) {
840 if (console_session
.ses_expired
)
841 lstcon_session_end();
843 if (opc
!= LSTIO_SESSION_NEW
&&
844 console_session
.ses_state
== LST_SESSION_NONE
) {
845 CDEBUG(D_NET
, "LST no active session\n");
850 memset(&console_session
.ses_trans_stat
, 0, sizeof(lstcon_trans_stat_t
));
853 case LSTIO_SESSION_NEW
:
854 rc
= lst_session_new_ioctl((lstio_session_new_args_t
*)buf
);
856 case LSTIO_SESSION_END
:
857 rc
= lst_session_end_ioctl((lstio_session_end_args_t
*)buf
);
859 case LSTIO_SESSION_INFO
:
860 rc
= lst_session_info_ioctl((lstio_session_info_args_t
*)buf
);
863 rc
= lst_debug_ioctl((lstio_debug_args_t
*)buf
);
865 case LSTIO_GROUP_ADD
:
866 rc
= lst_group_add_ioctl((lstio_group_add_args_t
*)buf
);
868 case LSTIO_GROUP_DEL
:
869 rc
= lst_group_del_ioctl((lstio_group_del_args_t
*)buf
);
871 case LSTIO_GROUP_UPDATE
:
872 rc
= lst_group_update_ioctl((lstio_group_update_args_t
*)buf
);
874 case LSTIO_NODES_ADD
:
875 rc
= lst_nodes_add_ioctl((lstio_group_nodes_args_t
*)buf
);
877 case LSTIO_GROUP_LIST
:
878 rc
= lst_group_list_ioctl((lstio_group_list_args_t
*)buf
);
880 case LSTIO_GROUP_INFO
:
881 rc
= lst_group_info_ioctl((lstio_group_info_args_t
*)buf
);
883 case LSTIO_BATCH_ADD
:
884 rc
= lst_batch_add_ioctl((lstio_batch_add_args_t
*)buf
);
886 case LSTIO_BATCH_START
:
887 rc
= lst_batch_run_ioctl((lstio_batch_run_args_t
*)buf
);
889 case LSTIO_BATCH_STOP
:
890 rc
= lst_batch_stop_ioctl((lstio_batch_stop_args_t
*)buf
);
892 case LSTIO_BATCH_QUERY
:
893 rc
= lst_batch_query_ioctl((lstio_batch_query_args_t
*)buf
);
895 case LSTIO_BATCH_LIST
:
896 rc
= lst_batch_list_ioctl((lstio_batch_list_args_t
*)buf
);
898 case LSTIO_BATCH_INFO
:
899 rc
= lst_batch_info_ioctl((lstio_batch_info_args_t
*)buf
);
902 rc
= lst_test_add_ioctl((lstio_test_args_t
*)buf
);
904 case LSTIO_STAT_QUERY
:
905 rc
= lst_stat_query_ioctl((lstio_stat_args_t
*)buf
);
911 if (copy_to_user(data
->ioc_pbuf2
, &console_session
.ses_trans_stat
,
912 sizeof(lstcon_trans_stat_t
)))
915 mutex_unlock(&console_session
.ses_mutex
);
917 LIBCFS_FREE(buf
, data
->ioc_plen1
);