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.gnu.org/licenses/gpl-2.0.html
23 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Use is subject to license terms.
26 * Copyright (c) 2012, 2014, Intel Corporation.
29 * This file is part of Lustre, http://www.lustre.org/
30 * Lustre is a trademark of Sun Microsystems, Inc.
32 * lnet/selftest/conctl.c
34 * IOC handle in kernel
36 * Author: Liang Zhen <liangzhen@clusterfs.com>
39 #include <libcfs/libcfs.h>
40 #include <lnet/lib-lnet.h>
41 #include <uapi/linux/lnet/lnetst.h>
45 lst_session_new_ioctl(struct lstio_session_new_args *args)
50 if (args->lstio_ses_idp == NULL || /* address for output sid */
51 args->lstio_ses_key == 0 || /* no key is specified */
52 args->lstio_ses_namep == NULL || /* session name */
53 args->lstio_ses_nmlen <= 0 ||
54 args->lstio_ses_nmlen > LST_NAME_SIZE)
57 LIBCFS_ALLOC(name, args->lstio_ses_nmlen + 1);
61 if (copy_from_user(name, args->lstio_ses_namep,
62 args->lstio_ses_nmlen)) {
63 LIBCFS_FREE(name, args->lstio_ses_nmlen + 1);
67 name[args->lstio_ses_nmlen] = 0;
69 rc = lstcon_session_new(name,
71 args->lstio_ses_feats,
72 args->lstio_ses_timeout,
73 args->lstio_ses_force,
76 LIBCFS_FREE(name, args->lstio_ses_nmlen + 1);
81 lst_session_end_ioctl(struct lstio_session_end_args *args)
83 if (args->lstio_ses_key != console_session.ses_key)
86 return lstcon_session_end();
90 lst_session_info_ioctl(struct lstio_session_info_args *args)
92 /* no checking of key */
94 if (args->lstio_ses_idp == NULL || /* address for ouput sid */
95 args->lstio_ses_keyp == NULL || /* address for ouput key */
96 args->lstio_ses_featp == NULL || /* address for ouput features */
97 args->lstio_ses_ndinfo == NULL || /* address for output ndinfo */
98 args->lstio_ses_namep == NULL || /* address for ouput name */
99 args->lstio_ses_nmlen <= 0 ||
100 args->lstio_ses_nmlen > LST_NAME_SIZE)
103 return lstcon_session_info(args->lstio_ses_idp,
104 args->lstio_ses_keyp,
105 args->lstio_ses_featp,
106 args->lstio_ses_ndinfo,
107 args->lstio_ses_namep,
108 args->lstio_ses_nmlen);
112 lst_debug_ioctl(struct lstio_debug_args *args)
118 if (args->lstio_dbg_key != console_session.ses_key)
121 if (args->lstio_dbg_resultp == NULL)
124 if (args->lstio_dbg_namep != NULL && /* name of batch/group */
125 (args->lstio_dbg_nmlen <= 0 ||
126 args->lstio_dbg_nmlen > LST_NAME_SIZE))
129 if (args->lstio_dbg_namep != NULL) {
130 LIBCFS_ALLOC(name, args->lstio_dbg_nmlen + 1);
134 if (copy_from_user(name, args->lstio_dbg_namep,
135 args->lstio_dbg_nmlen)) {
136 LIBCFS_FREE(name, args->lstio_dbg_nmlen + 1);
141 name[args->lstio_dbg_nmlen] = 0;
146 switch (args->lstio_dbg_type) {
147 case LST_OPC_SESSION:
148 rc = lstcon_session_debug(args->lstio_dbg_timeout,
149 args->lstio_dbg_resultp);
152 case LST_OPC_BATCHSRV:
155 case LST_OPC_BATCHCLI:
159 rc = lstcon_batch_debug(args->lstio_dbg_timeout,
160 name, client, args->lstio_dbg_resultp);
167 rc = lstcon_group_debug(args->lstio_dbg_timeout,
168 name, args->lstio_dbg_resultp);
172 if (args->lstio_dbg_count <= 0 ||
173 args->lstio_dbg_idsp == NULL)
176 rc = lstcon_nodes_debug(args->lstio_dbg_timeout,
177 args->lstio_dbg_count,
178 args->lstio_dbg_idsp,
179 args->lstio_dbg_resultp);
188 LIBCFS_FREE(name, args->lstio_dbg_nmlen + 1);
194 lst_group_add_ioctl(struct lstio_group_add_args *args)
199 if (args->lstio_grp_key != console_session.ses_key)
202 if (args->lstio_grp_namep == NULL ||
203 args->lstio_grp_nmlen <= 0 ||
204 args->lstio_grp_nmlen > LST_NAME_SIZE)
207 LIBCFS_ALLOC(name, args->lstio_grp_nmlen + 1);
211 if (copy_from_user(name, args->lstio_grp_namep,
212 args->lstio_grp_nmlen)) {
213 LIBCFS_FREE(name, args->lstio_grp_nmlen);
217 name[args->lstio_grp_nmlen] = 0;
219 rc = lstcon_group_add(name);
221 LIBCFS_FREE(name, args->lstio_grp_nmlen + 1);
227 lst_group_del_ioctl(struct lstio_group_del_args *args)
232 if (args->lstio_grp_key != console_session.ses_key)
235 if (args->lstio_grp_namep == NULL ||
236 args->lstio_grp_nmlen <= 0 ||
237 args->lstio_grp_nmlen > LST_NAME_SIZE)
240 LIBCFS_ALLOC(name, args->lstio_grp_nmlen + 1);
244 if (copy_from_user(name, args->lstio_grp_namep,
245 args->lstio_grp_nmlen)) {
246 LIBCFS_FREE(name, args->lstio_grp_nmlen + 1);
250 name[args->lstio_grp_nmlen] = 0;
252 rc = lstcon_group_del(name);
254 LIBCFS_FREE(name, args->lstio_grp_nmlen + 1);
260 lst_group_update_ioctl(struct lstio_group_update_args *args)
265 if (args->lstio_grp_key != console_session.ses_key)
268 if (args->lstio_grp_resultp == NULL ||
269 args->lstio_grp_namep == NULL ||
270 args->lstio_grp_nmlen <= 0 ||
271 args->lstio_grp_nmlen > LST_NAME_SIZE)
274 LIBCFS_ALLOC(name, args->lstio_grp_nmlen + 1);
278 if (copy_from_user(name, args->lstio_grp_namep,
279 args->lstio_grp_nmlen)) {
280 LIBCFS_FREE(name, args->lstio_grp_nmlen + 1);
284 name[args->lstio_grp_nmlen] = 0;
286 switch (args->lstio_grp_opc) {
287 case LST_GROUP_CLEAN:
288 rc = lstcon_group_clean(name, args->lstio_grp_args);
291 case LST_GROUP_REFRESH:
292 rc = lstcon_group_refresh(name, args->lstio_grp_resultp);
296 if (args->lstio_grp_count <= 0 ||
297 args->lstio_grp_idsp == NULL) {
301 rc = lstcon_nodes_remove(name, args->lstio_grp_count,
302 args->lstio_grp_idsp,
303 args->lstio_grp_resultp);
311 LIBCFS_FREE(name, args->lstio_grp_nmlen + 1);
317 lst_nodes_add_ioctl(struct lstio_group_nodes_args *args)
323 if (args->lstio_grp_key != console_session.ses_key)
326 if (args->lstio_grp_idsp == NULL || /* array of ids */
327 args->lstio_grp_count <= 0 ||
328 args->lstio_grp_resultp == NULL ||
329 args->lstio_grp_featp == NULL ||
330 args->lstio_grp_namep == NULL ||
331 args->lstio_grp_nmlen <= 0 ||
332 args->lstio_grp_nmlen > LST_NAME_SIZE)
335 LIBCFS_ALLOC(name, args->lstio_grp_nmlen + 1);
339 if (copy_from_user(name, args->lstio_grp_namep,
340 args->lstio_grp_nmlen)) {
341 LIBCFS_FREE(name, args->lstio_grp_nmlen + 1);
346 name[args->lstio_grp_nmlen] = 0;
348 rc = lstcon_nodes_add(name, args->lstio_grp_count,
349 args->lstio_grp_idsp, &feats,
350 args->lstio_grp_resultp);
352 LIBCFS_FREE(name, args->lstio_grp_nmlen + 1);
354 copy_to_user(args->lstio_grp_featp, &feats, sizeof(feats))) {
362 lst_group_list_ioctl(struct lstio_group_list_args *args)
364 if (args->lstio_grp_key != console_session.ses_key)
367 if (args->lstio_grp_idx < 0 ||
368 args->lstio_grp_namep == NULL ||
369 args->lstio_grp_nmlen <= 0 ||
370 args->lstio_grp_nmlen > LST_NAME_SIZE)
373 return lstcon_group_list(args->lstio_grp_idx,
374 args->lstio_grp_nmlen,
375 args->lstio_grp_namep);
379 lst_group_info_ioctl(struct lstio_group_info_args *args)
386 if (args->lstio_grp_key != console_session.ses_key)
389 if (args->lstio_grp_namep == NULL ||
390 args->lstio_grp_nmlen <= 0 ||
391 args->lstio_grp_nmlen > LST_NAME_SIZE)
394 if (args->lstio_grp_entp == NULL && /* output: group entry */
395 args->lstio_grp_dentsp == NULL) /* output: node entry */
398 if (args->lstio_grp_dentsp != NULL) { /* have node entry */
399 if (args->lstio_grp_idxp == NULL || /* node index */
400 args->lstio_grp_ndentp == NULL) /* # of node entry */
403 if (copy_from_user(&ndent, args->lstio_grp_ndentp,
405 copy_from_user(&index, args->lstio_grp_idxp,
409 if (ndent <= 0 || index < 0)
413 LIBCFS_ALLOC(name, args->lstio_grp_nmlen + 1);
417 if (copy_from_user(name, args->lstio_grp_namep,
418 args->lstio_grp_nmlen)) {
419 LIBCFS_FREE(name, args->lstio_grp_nmlen + 1);
423 name[args->lstio_grp_nmlen] = 0;
425 rc = lstcon_group_info(name, args->lstio_grp_entp,
426 &index, &ndent, args->lstio_grp_dentsp);
428 LIBCFS_FREE(name, args->lstio_grp_nmlen + 1);
433 if (args->lstio_grp_dentsp != NULL &&
434 (copy_to_user(args->lstio_grp_idxp, &index, sizeof(index)) ||
435 copy_to_user(args->lstio_grp_ndentp, &ndent, sizeof(ndent))))
442 lst_batch_add_ioctl(struct lstio_batch_add_args *args)
447 if (args->lstio_bat_key != console_session.ses_key)
450 if (args->lstio_bat_namep == NULL ||
451 args->lstio_bat_nmlen <= 0 ||
452 args->lstio_bat_nmlen > LST_NAME_SIZE)
455 LIBCFS_ALLOC(name, args->lstio_bat_nmlen + 1);
459 if (copy_from_user(name, args->lstio_bat_namep,
460 args->lstio_bat_nmlen)) {
461 LIBCFS_FREE(name, args->lstio_bat_nmlen + 1);
465 name[args->lstio_bat_nmlen] = 0;
467 rc = lstcon_batch_add(name);
469 LIBCFS_FREE(name, args->lstio_bat_nmlen + 1);
475 lst_batch_run_ioctl(struct lstio_batch_run_args *args)
480 if (args->lstio_bat_key != console_session.ses_key)
483 if (args->lstio_bat_namep == NULL ||
484 args->lstio_bat_nmlen <= 0 ||
485 args->lstio_bat_nmlen > LST_NAME_SIZE)
488 LIBCFS_ALLOC(name, args->lstio_bat_nmlen + 1);
492 if (copy_from_user(name, args->lstio_bat_namep,
493 args->lstio_bat_nmlen)) {
494 LIBCFS_FREE(name, args->lstio_bat_nmlen + 1);
498 name[args->lstio_bat_nmlen] = 0;
500 rc = lstcon_batch_run(name, args->lstio_bat_timeout,
501 args->lstio_bat_resultp);
503 LIBCFS_FREE(name, args->lstio_bat_nmlen + 1);
509 lst_batch_stop_ioctl(struct lstio_batch_stop_args *args)
514 if (args->lstio_bat_key != console_session.ses_key)
517 if (args->lstio_bat_resultp == NULL ||
518 args->lstio_bat_namep == NULL ||
519 args->lstio_bat_nmlen <= 0 ||
520 args->lstio_bat_nmlen > LST_NAME_SIZE)
523 LIBCFS_ALLOC(name, args->lstio_bat_nmlen + 1);
527 if (copy_from_user(name, args->lstio_bat_namep,
528 args->lstio_bat_nmlen)) {
529 LIBCFS_FREE(name, args->lstio_bat_nmlen + 1);
533 name[args->lstio_bat_nmlen] = 0;
535 rc = lstcon_batch_stop(name, args->lstio_bat_force,
536 args->lstio_bat_resultp);
538 LIBCFS_FREE(name, args->lstio_bat_nmlen + 1);
544 lst_batch_query_ioctl(struct lstio_batch_query_args *args)
549 if (args->lstio_bat_key != console_session.ses_key)
552 if (args->lstio_bat_resultp == NULL ||
553 args->lstio_bat_namep == NULL ||
554 args->lstio_bat_nmlen <= 0 ||
555 args->lstio_bat_nmlen > LST_NAME_SIZE)
558 if (args->lstio_bat_testidx < 0)
561 LIBCFS_ALLOC(name, args->lstio_bat_nmlen + 1);
565 if (copy_from_user(name, args->lstio_bat_namep,
566 args->lstio_bat_nmlen)) {
567 LIBCFS_FREE(name, args->lstio_bat_nmlen + 1);
571 name[args->lstio_bat_nmlen] = 0;
573 rc = lstcon_test_batch_query(name,
574 args->lstio_bat_testidx,
575 args->lstio_bat_client,
576 args->lstio_bat_timeout,
577 args->lstio_bat_resultp);
579 LIBCFS_FREE(name, args->lstio_bat_nmlen + 1);
585 lst_batch_list_ioctl(struct lstio_batch_list_args *args)
587 if (args->lstio_bat_key != console_session.ses_key)
590 if (args->lstio_bat_idx < 0 ||
591 args->lstio_bat_namep == NULL ||
592 args->lstio_bat_nmlen <= 0 ||
593 args->lstio_bat_nmlen > LST_NAME_SIZE)
596 return lstcon_batch_list(args->lstio_bat_idx,
597 args->lstio_bat_nmlen,
598 args->lstio_bat_namep);
602 lst_batch_info_ioctl(struct lstio_batch_info_args *args)
609 if (args->lstio_bat_key != console_session.ses_key)
612 if (args->lstio_bat_namep == NULL || /* batch name */
613 args->lstio_bat_nmlen <= 0 ||
614 args->lstio_bat_nmlen > LST_NAME_SIZE)
617 if (args->lstio_bat_entp == NULL && /* output: batch entry */
618 args->lstio_bat_dentsp == NULL) /* output: node entry */
621 if (args->lstio_bat_dentsp != NULL) { /* have node entry */
622 if (args->lstio_bat_idxp == NULL || /* node index */
623 args->lstio_bat_ndentp == NULL) /* # of node entry */
626 if (copy_from_user(&index, args->lstio_bat_idxp,
628 copy_from_user(&ndent, args->lstio_bat_ndentp,
632 if (ndent <= 0 || index < 0)
636 LIBCFS_ALLOC(name, args->lstio_bat_nmlen + 1);
640 if (copy_from_user(name, args->lstio_bat_namep,
641 args->lstio_bat_nmlen)) {
642 LIBCFS_FREE(name, args->lstio_bat_nmlen + 1);
646 name[args->lstio_bat_nmlen] = 0;
648 rc = lstcon_batch_info(name,
649 args->lstio_bat_entp, args->lstio_bat_server,
650 args->lstio_bat_testidx, &index, &ndent,
651 args->lstio_bat_dentsp);
653 LIBCFS_FREE(name, args->lstio_bat_nmlen + 1);
658 if (args->lstio_bat_dentsp != NULL &&
659 (copy_to_user(args->lstio_bat_idxp, &index, sizeof(index)) ||
660 copy_to_user(args->lstio_bat_ndentp, &ndent, sizeof(ndent))))
667 lst_stat_query_ioctl(struct lstio_stat_args *args)
672 /* TODO: not finished */
673 if (args->lstio_sta_key != console_session.ses_key)
676 if (args->lstio_sta_resultp == NULL)
679 if (args->lstio_sta_idsp != NULL) {
680 if (args->lstio_sta_count <= 0)
683 rc = lstcon_nodes_stat(args->lstio_sta_count,
684 args->lstio_sta_idsp,
685 args->lstio_sta_timeout,
686 args->lstio_sta_resultp);
687 } else if (args->lstio_sta_namep != NULL) {
688 if (args->lstio_sta_nmlen <= 0 ||
689 args->lstio_sta_nmlen > LST_NAME_SIZE)
692 LIBCFS_ALLOC(name, args->lstio_sta_nmlen + 1);
696 rc = copy_from_user(name, args->lstio_sta_namep,
697 args->lstio_sta_nmlen);
699 rc = lstcon_group_stat(name, args->lstio_sta_timeout,
700 args->lstio_sta_resultp);
709 LIBCFS_FREE(name, args->lstio_sta_nmlen + 1);
713 static int lst_test_add_ioctl(struct lstio_test_args *args)
716 char *src_name = NULL;
717 char *dst_name = NULL;
722 if (args->lstio_tes_resultp == NULL ||
723 args->lstio_tes_retp == NULL ||
724 args->lstio_tes_bat_name == NULL || /* no specified batch */
725 args->lstio_tes_bat_nmlen <= 0 ||
726 args->lstio_tes_bat_nmlen > LST_NAME_SIZE ||
727 args->lstio_tes_sgrp_name == NULL || /* no source group */
728 args->lstio_tes_sgrp_nmlen <= 0 ||
729 args->lstio_tes_sgrp_nmlen > LST_NAME_SIZE ||
730 args->lstio_tes_dgrp_name == NULL || /* no target group */
731 args->lstio_tes_dgrp_nmlen <= 0 ||
732 args->lstio_tes_dgrp_nmlen > LST_NAME_SIZE)
735 if (args->lstio_tes_loop == 0 || /* negative is infinite */
736 args->lstio_tes_concur <= 0 ||
737 args->lstio_tes_dist <= 0 ||
738 args->lstio_tes_span <= 0)
741 /* have parameter, check if parameter length is valid */
742 if (args->lstio_tes_param != NULL &&
743 (args->lstio_tes_param_len <= 0 ||
744 args->lstio_tes_param_len >
745 PAGE_SIZE - sizeof(struct lstcon_test)))
748 LIBCFS_ALLOC(batch_name, args->lstio_tes_bat_nmlen + 1);
749 if (batch_name == NULL)
752 LIBCFS_ALLOC(src_name, args->lstio_tes_sgrp_nmlen + 1);
753 if (src_name == NULL)
756 LIBCFS_ALLOC(dst_name, args->lstio_tes_dgrp_nmlen + 1);
757 if (dst_name == NULL)
760 if (args->lstio_tes_param != NULL) {
761 LIBCFS_ALLOC(param, args->lstio_tes_param_len);
764 if (copy_from_user(param, args->lstio_tes_param,
765 args->lstio_tes_param_len)) {
772 if (copy_from_user(batch_name, args->lstio_tes_bat_name,
773 args->lstio_tes_bat_nmlen) ||
774 copy_from_user(src_name, args->lstio_tes_sgrp_name,
775 args->lstio_tes_sgrp_nmlen) ||
776 copy_from_user(dst_name, args->lstio_tes_dgrp_name,
777 args->lstio_tes_dgrp_nmlen))
780 rc = lstcon_test_add(batch_name,
781 args->lstio_tes_type,
782 args->lstio_tes_loop,
783 args->lstio_tes_concur,
784 args->lstio_tes_dist, args->lstio_tes_span,
785 src_name, dst_name, param,
786 args->lstio_tes_param_len,
787 &ret, args->lstio_tes_resultp);
790 rc = (copy_to_user(args->lstio_tes_retp, &ret,
791 sizeof(ret))) ? -EFAULT : 0;
793 if (batch_name != NULL)
794 LIBCFS_FREE(batch_name, args->lstio_tes_bat_nmlen + 1);
796 if (src_name != NULL)
797 LIBCFS_FREE(src_name, args->lstio_tes_sgrp_nmlen + 1);
799 if (dst_name != NULL)
800 LIBCFS_FREE(dst_name, args->lstio_tes_dgrp_nmlen + 1);
803 LIBCFS_FREE(param, args->lstio_tes_param_len);
809 lstcon_ioctl_entry(struct notifier_block *nb,
810 unsigned long cmd, void *vdata)
812 struct libcfs_ioctl_hdr *hdr = vdata;
813 struct libcfs_ioctl_data *data;
818 if (cmd != IOC_LIBCFS_LNETST)
821 data = container_of(hdr, struct libcfs_ioctl_data, ioc_hdr);
823 opc = data->ioc_u32[0];
825 if (data->ioc_plen1 > PAGE_SIZE)
828 LIBCFS_ALLOC(buf, data->ioc_plen1);
834 /* copy in parameter */
835 if (copy_from_user(buf, data->ioc_pbuf1, data->ioc_plen1)) {
840 mutex_lock(&console_session.ses_mutex);
842 console_session.ses_laststamp = ktime_get_real_seconds();
844 if (console_session.ses_shutdown) {
849 if (console_session.ses_expired)
850 lstcon_session_end();
852 if (opc != LSTIO_SESSION_NEW &&
853 console_session.ses_state == LST_SESSION_NONE) {
854 CDEBUG(D_NET, "LST no active session\n");
859 memset(&console_session.ses_trans_stat, 0,
860 sizeof(struct lstcon_trans_stat));
863 case LSTIO_SESSION_NEW:
864 rc = lst_session_new_ioctl((struct lstio_session_new_args *)buf);
866 case LSTIO_SESSION_END:
867 rc = lst_session_end_ioctl((struct lstio_session_end_args *)buf);
869 case LSTIO_SESSION_INFO:
870 rc = lst_session_info_ioctl((struct lstio_session_info_args *)buf);
873 rc = lst_debug_ioctl((struct lstio_debug_args *)buf);
875 case LSTIO_GROUP_ADD:
876 rc = lst_group_add_ioctl((struct lstio_group_add_args *)buf);
878 case LSTIO_GROUP_DEL:
879 rc = lst_group_del_ioctl((struct lstio_group_del_args *)buf);
881 case LSTIO_GROUP_UPDATE:
882 rc = lst_group_update_ioctl((struct lstio_group_update_args *)buf);
884 case LSTIO_NODES_ADD:
885 rc = lst_nodes_add_ioctl((struct lstio_group_nodes_args *)buf);
887 case LSTIO_GROUP_LIST:
888 rc = lst_group_list_ioctl((struct lstio_group_list_args *)buf);
890 case LSTIO_GROUP_INFO:
891 rc = lst_group_info_ioctl((struct lstio_group_info_args *)buf);
893 case LSTIO_BATCH_ADD:
894 rc = lst_batch_add_ioctl((struct lstio_batch_add_args *)buf);
896 case LSTIO_BATCH_START:
897 rc = lst_batch_run_ioctl((struct lstio_batch_run_args *)buf);
899 case LSTIO_BATCH_STOP:
900 rc = lst_batch_stop_ioctl((struct lstio_batch_stop_args *)buf);
902 case LSTIO_BATCH_QUERY:
903 rc = lst_batch_query_ioctl((struct lstio_batch_query_args *)buf);
905 case LSTIO_BATCH_LIST:
906 rc = lst_batch_list_ioctl((struct lstio_batch_list_args *)buf);
908 case LSTIO_BATCH_INFO:
909 rc = lst_batch_info_ioctl((struct lstio_batch_info_args *)buf);
912 rc = lst_test_add_ioctl((struct lstio_test_args *)buf);
914 case LSTIO_STAT_QUERY:
915 rc = lst_stat_query_ioctl((struct lstio_stat_args *)buf);
922 if (copy_to_user(data->ioc_pbuf2, &console_session.ses_trans_stat,
923 sizeof(struct lstcon_trans_stat)))
926 mutex_unlock(&console_session.ses_mutex);
928 LIBCFS_FREE(buf, data->ioc_plen1);
930 return notifier_from_ioctl_errno(rc);