Whamcloud - gitweb
LU-6142 selftest: SPDX for lnet/selftest/
[fs/lustre-release.git] / lnet / selftest / console.h
index 001d8f3..9f89071 100644 (file)
@@ -1,35 +1,14 @@
-/*
- * GPL HEADER START
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 only,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License version 2 for more details (a copy is included
- * in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see
- * http://www.gnu.org/licenses/gpl-2.0.html
- *
- * GPL HEADER END
- */
+// SPDX-License-Identifier: GPL-2.0
+
 /*
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
  * Copyright (c) 2012, 2013, Intel Corporation.
  */
+
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- *
- * lnet/selftest/console.h
  *
  * kernel structure for LST console
  *
@@ -43,7 +22,6 @@
 
 #include <libcfs/libcfs.h>
 #include <lnet/lib-types.h>
-#include <uapi/linux/lnet/lnetst.h>
 #include "selftest.h"
 #include "conrpc.h"
 
@@ -53,7 +31,7 @@ struct lstcon_node {
         int                  nd_ref;         /* reference count */
         int                  nd_state;       /* state of the node */
         int                  nd_timeout;     /* session timeout */
-        cfs_time_t           nd_stamp;       /* timestamp of last replied RPC */
+       ktime_t                 nd_stamp;       /* last RPC reply timestamp */
        struct lstcon_rpc       nd_ping;        /* ping rpc */
 };
 
@@ -150,8 +128,8 @@ struct lstcon_test {
 
 struct lstcon_session {
        struct mutex            ses_mutex;      /* only 1 thread in session */
-       struct lst_sid          ses_id;         /* global session id */
-        int                     ses_key;        /* local session key */
+       struct lst_session_id   ses_id;         /* global session id */
+       u32                     ses_key;        /* local session key */
         int                     ses_state;      /* state of session */
         int                     ses_timeout;    /* timeout in seconds */
        time64_t                ses_laststamp;  /* last operation stamp (seconds) */
@@ -200,11 +178,7 @@ lstcon_id2hash(struct lnet_process_id id, struct list_head *hash)
 
 extern int lstcon_session_match(struct lst_sid sid);
 extern int lstcon_session_new(char *name, int key, unsigned version,
-                             int timeout, int flags, struct lst_sid __user *sid_up);
-extern int lstcon_session_info(struct lst_sid __user *sid_up, int __user *key,
-                              unsigned __user *verp,
-                              struct lstcon_ndlist_ent __user *entp,
-                              char __user *name_up, int len);
+                             int timeout, int flags);
 extern int lstcon_session_end(void);
 extern int lstcon_session_debug(int timeout,
                                struct list_head __user *result_up);
@@ -218,6 +192,9 @@ extern int lstcon_nodes_debug(int timeout, int nnd,
                              struct list_head __user *result_up);
 extern int lstcon_group_add(char *name);
 extern int lstcon_group_del(char *name);
+void lstcon_group_addref(struct lstcon_group *grp);
+void lstcon_group_decref(struct lstcon_group *grp);
+int lstcon_group_find(const char *name, struct lstcon_group **grpp);
 extern int lstcon_group_clean(char *name, int args);
 extern int lstcon_group_refresh(char *name, struct list_head __user *result_up);
 extern int lstcon_nodes_add(char *name, int nnd,
@@ -230,7 +207,6 @@ extern int lstcon_nodes_remove(char *name, int nnd,
 extern int lstcon_group_info(char *name, struct lstcon_ndlist_ent __user *gent_up,
                             int *index_p, int *ndent_p,
                             struct lstcon_node_ent __user *ndents_up);
-extern int lstcon_group_list(int idx, int len, char __user *name_up);
 extern int lstcon_batch_add(char *name);
 extern int lstcon_batch_run(char *name, int timeout,
                            struct list_head __user *result_up);
@@ -256,7 +232,13 @@ extern int lstcon_test_add(char *batch_name, int type, int loop,
                           void *param, int paramlen, int *retp,
                           struct list_head __user *result_up);
 
+int lstcon_ioctl_entry(struct notifier_block *nb,
+                      unsigned long cmd, void *vdata);
+
 int lstcon_console_init(void);
 int lstcon_console_fini(void);
 
+int lstcon_init_netlink(void);
+void lstcon_fini_netlink(void);
+
 #endif