+
+static struct attribute *lov_attrs[] = {
+ &lustre_attr_activeobd.attr,
+ &lustre_attr_numobd.attr,
+ &lustre_attr_desc_uuid.attr,
+ &lustre_attr_stripeoffset.attr,
+ &lustre_attr_stripetype.attr,
+ &lustre_attr_stripecount.attr,
+ NULL,
+};
+
+int lov_tunables_init(struct obd_device *obd)
+{
+ struct lov_obd *lov = &obd->u.lov;
+#if defined(CONFIG_PROC_FS) && defined(HAVE_SERVER_SUPPORT)
+ struct obd_type *type;
+#endif
+ int rc;
+
+ obd->obd_vars = lprocfs_lov_obd_vars;
+#if defined(CONFIG_PROC_FS) && defined(HAVE_SERVER_SUPPORT)
+ /* If this is true then both client (lov) and server
+ * (lod) are on the same node. The lod layer if loaded
+ * first will register the lov proc directory. In that
+ * case obd->obd_type->typ_procroot will be not set.
+ * Instead we use type->typ_procsym as the parent.
+ */
+ type = class_search_type(LUSTRE_LOD_NAME);
+ if (type && type->typ_procsym) {
+ obd->obd_proc_entry = lprocfs_register(obd->obd_name,
+ type->typ_procsym,
+ obd->obd_vars, obd);
+ if (IS_ERR(obd->obd_proc_entry)) {
+ rc = PTR_ERR(obd->obd_proc_entry);
+ CERROR("error %d setting up lprocfs for %s\n", rc,
+ obd->obd_name);
+ obd->obd_proc_entry = NULL;
+ }
+ }
+#endif
+ obd->obd_ktype.default_attrs = lov_attrs;
+ rc = lprocfs_obd_setup(obd, false);
+ if (rc)
+ GOTO(out, rc);
+
+#ifdef CONFIG_PROC_FS
+ rc = lprocfs_seq_create(obd->obd_proc_entry, "target_obd", 0444,
+ &lov_proc_target_fops, obd);
+ if (rc)
+ CWARN("%s: Error adding the target_obd file : rc %d\n",
+ obd->obd_name, rc);
+
+ lov->lov_pool_proc_entry = lprocfs_register("pools",
+ obd->obd_proc_entry,
+ NULL, NULL);
+ if (IS_ERR(lov->lov_pool_proc_entry)) {
+ rc = PTR_ERR(lov->lov_pool_proc_entry);
+ CERROR("%s: error setting up debugfs for pools : rc %d\n",
+ obd->obd_name, rc);
+ lov->lov_pool_proc_entry = NULL;
+ }
+#endif /* CONFIG_FS_PROC */
+out:
+ return rc;
+}