Whamcloud - gitweb
The variable, not the literal. Thanks mjmac.
[fs/lustre-release.git] / lustre / obdclass / llog_obd.c
index 6e3d512..f0ccd0c 100644 (file)
 #include <linux/obd_class.h>
 #include <linux/lustre_log.h>
 #include <linux/lustre_mds.h>
-#include <portals/list.h>
+#include <libcfs/list.h>
 
 /* helper functions for calling the llog obd methods */
-
 int obd_llog_setup(struct obd_device *obd, struct obd_llogs *llogs, 
                    int index, struct obd_device *disk_obd, int count, 
                    struct llog_logid *logid, struct llog_operations *op)
 {
-        int rc = 0;
         struct llog_ctxt *ctxt;
+        int rc = 0;
         ENTRY;
 
         LASSERT(llogs);
@@ -56,10 +55,14 @@ int obd_llog_setup(struct obd_device *obd, struct obd_llogs *llogs,
         if (op->lop_close == llog_lvfs_ops.lop_close) {
                 ctxt->loc_fsops = disk_obd->obd_fsops;
                 ctxt->loc_lvfs_ctxt = &disk_obd->obd_lvfs_ctxt;
-                if (!strcmp(disk_obd->obd_type->typ_name, LUSTRE_MDS_NAME)) {
+                if (!strcmp(disk_obd->obd_type->typ_name, OBD_MDS_DEVICENAME)) {
                         struct mds_obd *mds = &disk_obd->u.mds;
                         ctxt->loc_objects_dir = mds->mds_objects_dir;
                         ctxt->loc_logs_dir = mds->mds_logs_dir;
+                } else if (!strcmp(disk_obd->obd_type->typ_name, OBD_CONF_DEVICENAME)) {
+                        struct conf_obd *confobd = &disk_obd->u.conf;
+                        ctxt->loc_objects_dir = confobd->cfobd_objects_dir;
+                        ctxt->loc_logs_dir = confobd->cfobd_logs_dir;
                 }
         }
 
@@ -67,6 +70,7 @@ int obd_llog_setup(struct obd_device *obd, struct obd_llogs *llogs,
                 rc = op->lop_setup(obd, llogs, index, disk_obd, count, logid);
         if (ctxt && rc) {
                 obd->obd_llog_ctxt[index] = NULL;
+                llogs->llog_ctxt[index] = NULL;
                 OBD_FREE(ctxt, sizeof(*ctxt));
         }
 
@@ -175,7 +179,7 @@ int llog_obd_origin_setup(struct obd_device *obd, struct obd_llogs *llogs,
 EXPORT_SYMBOL(llog_obd_origin_setup);
 
 int obd_llog_cat_initialize(struct obd_device *obd, struct obd_llogs *llogs, 
-                            int count, char *name)
+                            int count, const char *name)
 {
         struct llog_catid *idarray;
         int size = sizeof(*idarray) * count;