From: tappro Date: Tue, 18 Apr 2006 20:55:41 +0000 (+0000) Subject: add new lu_device_type method - config. It is needed to configure new MDC/OSC on MDS X-Git-Tag: v1_8_0_110~486^2~1965 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=85e6e3caf4e920f3447396fe58b84621b7a45413;p=fs%2Flustre-release.git add new lu_device_type method - config. It is needed to configure new MDC/OSC on MDS --- diff --git a/lustre/include/linux/lu_object.h b/lustre/include/linux/lu_object.h index f8cdf55..f5fb735 100644 --- a/lustre/include/linux/lu_object.h +++ b/lustre/include/linux/lu_object.h @@ -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 *); + }; /* diff --git a/lustre/include/linux/obd_class.h b/lustre/include/linux/obd_class.h index c2d5095..aabc024 100644 --- a/lustre/include/linux/obd_class.h +++ b/lustre/include/linux/obd_class.h @@ -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); }