Whamcloud - gitweb
add new lu_device_type method - config. It is needed to configure new MDC/OSC on MDS
authortappro <tappro>
Tue, 18 Apr 2006 20:55:41 +0000 (20:55 +0000)
committertappro <tappro>
Tue, 18 Apr 2006 20:55:41 +0000 (20:55 +0000)
lustre/include/linux/lu_object.h
lustre/include/linux/obd_class.h

index f8cdf55..f5fb735 100644 (file)
@@ -219,13 +219,15 @@ struct lu_device_type_operations {
 
         /*
          * Initialize the devices after allocation
-         * called from top device, when all layers are linked
          */
         int  (*ldto_device_init)(struct lu_device *, struct lu_device *);
         struct lu_device *(*ldto_device_fini)(struct lu_device *);
 
         int  (*ldto_init)(struct lu_device_type *t);
         void (*ldto_fini)(struct lu_device_type *t);
+        /* configure device */
+        int  (*ldto_device_config)(struct lu_device *, struct lustre_cfg *);
+
 };
 
 /*
index c2d5095..aabc024 100644 (file)
@@ -365,12 +365,21 @@ static inline int
 obd_process_config(struct obd_device *obd, int datalen, void *data)
 {
         int rc;
+        struct lu_device *d;
+        struct lu_device_type *ldt;
         ENTRY;
 
-        OBD_CHECK_OP(obd, process_config, -EOPNOTSUPP);
-        OBD_COUNTER_INCREMENT(obd, process_config);
+        OBD_CHECK_DEV(obd);
 
-        rc = OBP(obd, process_config)(obd, datalen, data);
+        ldt = obd->obd_type->typ_lu;
+        d = obd->obd_lu_dev;
+        if (ldt != NULL && d != NULL) {
+                rc = ldt->ldt_ops->ldto_device_config(d, (struct lustre_cfg *)data);
+        } else {
+                OBD_CHECK_OP(obd, process_config, -EOPNOTSUPP);
+                OBD_COUNTER_INCREMENT(obd, process_config);
+                rc = OBP(obd, process_config)(obd, datalen, data);
+        }
         RETURN(rc);
 }