Whamcloud - gitweb
LU-11233 build: support for gcc8
[fs/lustre-release.git] / lustre / obdclass / genops.c
index 6d06336..0a840c9 100644 (file)
@@ -239,7 +239,7 @@ int class_register_type(struct obd_ops *dt_ops, struct md_ops *md_ops,
        if (enable_proc) {
                type->typ_procroot = lprocfs_register(type->typ_name,
                                                      proc_lustre_root,
-                                                     vars, type);
+                                                     NULL, type);
                if (IS_ERR(type->typ_procroot)) {
                        rc = PTR_ERR(type->typ_procroot);
                        type->typ_procroot = NULL;
@@ -262,7 +262,7 @@ int class_register_type(struct obd_ops *dt_ops, struct md_ops *md_ops,
 
        type->typ_debugfs_entry = ldebugfs_register(type->typ_name,
                                                    debugfs_lustre_root,
-                                                   NULL, type);
+                                                   vars, type);
        if (IS_ERR_OR_NULL(type->typ_debugfs_entry)) {
                rc = type->typ_debugfs_entry ? PTR_ERR(type->typ_debugfs_entry)
                                             : -ENOMEM;
@@ -445,7 +445,7 @@ struct obd_device *class_newdev(const char *type_name, const char *name,
 
        newdev->obd_conn_inprogress = 0;
 
-       strncpy(newdev->obd_uuid.uuid, uuid, strlen(uuid));
+       strncpy(newdev->obd_uuid.uuid, uuid, UUID_MAX);
 
        CDEBUG(D_IOCTL, "Allocate new device %s (%p)\n",
               newdev->obd_name, newdev);
@@ -2225,8 +2225,6 @@ int obd_set_max_mod_rpcs_in_flight(struct client_obd *cli, __u16 max)
 }
 EXPORT_SYMBOL(obd_set_max_mod_rpcs_in_flight);
 
-
-#define pct(a, b) (b ? a * 100 / b : 0)
 int obd_mod_rpc_stats_seq_show(struct client_obd *cli,
                               struct seq_file *seq)
 {
@@ -2252,7 +2250,7 @@ int obd_mod_rpc_stats_seq_show(struct client_obd *cli,
        for (i = 0; i < OBD_HIST_MAX; i++) {
                unsigned long mod = cli->cl_mod_rpcs_hist.oh_buckets[i];
                mod_cum += mod;
-               seq_printf(seq, "%d:\t\t%10lu %3lu %3lu\n",
+               seq_printf(seq, "%d:\t\t%10lu %3u %3u\n",
                           i, mod, pct(mod, mod_tot),
                           pct(mod_cum, mod_tot));
                if (mod_cum == mod_tot)
@@ -2264,8 +2262,6 @@ int obd_mod_rpc_stats_seq_show(struct client_obd *cli,
        return 0;
 }
 EXPORT_SYMBOL(obd_mod_rpc_stats_seq_show);
-#undef pct
-
 
 /* The number of modify RPCs sent in parallel is limited
  * because the server has a finite number of slots per client to