Whamcloud - gitweb
LU-6142 llite: Fix style issues for llite_nfs.c
[fs/lustre-release.git] / lnet / selftest / console.c
index 554ce0b..1e37454 100644 (file)
@@ -93,13 +93,13 @@ lstcon_node_find(struct lnet_process_id id, struct lstcon_node **ndpp,
 
        ndl = (struct lstcon_ndlink *)(*ndpp + 1);
 
-        ndl->ndl_node = *ndpp;
+       ndl->ndl_node = *ndpp;
 
-        ndl->ndl_node->nd_ref   = 1;
-        ndl->ndl_node->nd_id    = id;
-        ndl->ndl_node->nd_stamp = cfs_time_current();
-        ndl->ndl_node->nd_state = LST_NODE_UNKNOWN;
-        ndl->ndl_node->nd_timeout = 0;
+       ndl->ndl_node->nd_ref   = 1;
+       ndl->ndl_node->nd_id    = id;
+       ndl->ndl_node->nd_stamp = ktime_get();
+       ndl->ndl_node->nd_state = LST_NODE_UNKNOWN;
+       ndl->ndl_node->nd_timeout = 0;
        memset(&ndl->ndl_node->nd_ping, 0, sizeof(ndl->ndl_node->nd_ping));
 
        /* queued in global hash & list, no refcount is taken by
@@ -1472,7 +1472,7 @@ lstcon_statrpc_readent(int transop, struct srpc_msg *msg,
        struct srpc_stat_reply *rep = &msg->msg_body.stat_reply;
        struct sfw_counters __user *sfwk_stat;
        struct srpc_counters __user *srpc_stat;
-       struct lnet_counters __user *lnet_stat;
+       struct lnet_counters_common __user *lnet_stat;
 
         if (rep->str_status != 0)
                 return 0;
@@ -1480,7 +1480,7 @@ lstcon_statrpc_readent(int transop, struct srpc_msg *msg,
        sfwk_stat = (struct sfw_counters __user *)&ent_up->rpe_payload[0];
        srpc_stat = (struct srpc_counters __user *)
                ((char __user *)sfwk_stat + sizeof(*sfwk_stat));
-       lnet_stat = (struct lnet_counters __user *)
+       lnet_stat = (struct lnet_counters_common __user *)
                ((char __user *)srpc_stat + sizeof(*srpc_stat));
 
        if (copy_to_user(sfwk_stat, &rep->str_fw, sizeof(*sfwk_stat)) ||
@@ -1704,11 +1704,11 @@ lstcon_new_session_id(struct lst_sid *sid)
 {
        struct lnet_process_id id;
 
-        LASSERT (console_session.ses_state == LST_SESSION_NONE);
+       LASSERT(console_session.ses_state == LST_SESSION_NONE);
 
-        LNetGetId(1, &id);
-        sid->ses_nid   = id.nid;
-        sid->ses_stamp = cfs_time_current();
+       LNetGetId(1, &id);
+       sid->ses_nid = id.nid;
+       sid->ses_stamp = div_u64(ktime_get_ns(), NSEC_PER_MSEC);
 }
 
 int
@@ -2004,9 +2004,9 @@ static void lstcon_init_acceptor_service(void)
        lstcon_acceptor_service.sv_wi_total = SFW_FRWK_WI_MAX;
 }
 
-int lstcon_ioctl_entry(unsigned int cmd, struct libcfs_ioctl_hdr *hdr);
-
-DECLARE_IOCTL_HANDLER(lstcon_ioctl_handler, lstcon_ioctl_entry);
+static struct notifier_block lstcon_ioctl_handler = {
+       .notifier_call = lstcon_ioctl_entry,
+};
 
 /* initialize console */
 int
@@ -2058,12 +2058,12 @@ lstcon_console_init(void)
                 goto out;
         }
 
-        rc = libcfs_register_ioctl(&lstcon_ioctl_handler);
-
-        if (rc == 0) {
-                lstcon_rpc_module_init();
-                return 0;
-        }
+       rc = blocking_notifier_chain_register(&libcfs_ioctl_list,
+                                             &lstcon_ioctl_handler);
+       if (rc == 0) {
+               lstcon_rpc_module_init();
+               return 0;
+       }
 
 out:
        srpc_shutdown_service(&lstcon_acceptor_service);
@@ -2080,9 +2080,10 @@ out:
 int
 lstcon_console_fini(void)
 {
-        int     i;
+       int i;
 
-        libcfs_deregister_ioctl(&lstcon_ioctl_handler);
+       blocking_notifier_chain_unregister(&libcfs_ioctl_list,
+                                          &lstcon_ioctl_handler);
 
        mutex_lock(&console_session.ses_mutex);