From: tappro Date: Sun, 9 Apr 2006 11:01:52 +0000 (+0000) Subject: -remove unneeded stuff from cmm X-Git-Tag: v1_8_0_110~486^2~2062 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=11523663d9ab377c18241b21f902739914901d4a;p=fs%2Flustre-release.git -remove unneeded stuff from cmm -update mds layers names and creation -osd gets mountpoint -fix issue in ldlm_lockd - wrong comparision --- diff --git a/lustre/cmm/cmm_device.c b/lustre/cmm/cmm_device.c index b401545..b49f010 100644 --- a/lustre/cmm/cmm_device.c +++ b/lustre/cmm/cmm_device.c @@ -258,8 +258,6 @@ struct lu_device *cmm_device_alloc(struct lu_device_type *t, { struct lu_device *l; struct cmm_device *m; - struct obd_device * obd = NULL; - char * child = lustre_cfg_string(cfg, 1); int err; diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index a6da2a9..6cbf5b9 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -924,7 +924,7 @@ int ldlm_handle_enqueue(struct ptlrpc_request *req, dlm_req = lustre_swab_reqbuf(req, MDS_REQ_INTENT_LOCKREQ_OFF, sizeof *dlm_req, lustre_swab_ldlm_request); - if (dlm_req == NULL) { + if (dlm_req != NULL) { rc = ldlm_handle_enqueue0(req, dlm_req, &cbs); } else { CERROR ("Can't unpack dlm_req\n"); diff --git a/lustre/mgs/mgs_llog.c b/lustre/mgs/mgs_llog.c index aa8d5af..1eef67f 100644 --- a/lustre/mgs/mgs_llog.c +++ b/lustre/mgs/mgs_llog.c @@ -1452,10 +1452,10 @@ static int mgs_write_log_mdd(struct obd_device *obd, struct fs_db *fsdb, sprintf((char *)uuid, "%s_UUID", dev); rc = record_start_log(obd, &llh, log); - rc = record_marker(obd, llh, fsdb, CM_START, log, "mdd setup"); + rc = record_marker(obd, llh, fsdb, CM_START, dev, "mdd setup"); rc = record_attach(obd, llh, dev, LUSTRE_MDD0_NAME, uuid); rc = record_setup(obd, llh, dev, child, lov, uuid, 0); - rc = record_marker(obd, llh, fsdb, CM_END, log, "mdd setup"); + rc = record_marker(obd, llh, fsdb, CM_END, dev, "mdd setup"); rc = record_end_log(obd, &llh); OBD_FREE(uuid, sizeof(*uuid)); @@ -1479,10 +1479,10 @@ static int mgs_write_log_osd(struct obd_device *obd, struct fs_db *fsdb, sprintf((char *)uuid, "%s_UUID", dev); rc = record_start_log(obd, &llh, log); - rc = record_marker(obd, llh, fsdb, CM_START, log, "osd setup"); + rc = record_marker(obd, llh, fsdb, CM_START, dev, "osd setup"); rc = record_attach(obd, llh, dev, LUSTRE_OSD0_NAME, uuid); rc = record_setup(obd, llh, dev, uuid, 0, 0, 0); - rc = record_marker(obd, llh, fsdb, CM_END, log, "osd setup"); + rc = record_marker(obd, llh, fsdb, CM_END, dev, "osd setup"); rc = record_end_log(obd, &llh); OBD_FREE(uuid, sizeof(*uuid)); @@ -1506,10 +1506,10 @@ static int mgs_write_log_mdt0(struct obd_device *obd, struct fs_db *fsdb, sprintf((char *)uuid, "%s_UUID", dev); /* add MDT itself */ rc = record_start_log(obd, &llh, log); - rc = record_marker(obd, llh, fsdb, CM_START, log, "add mdt"); - rc = record_attach(obd, llh, log, LUSTRE_MDT0_NAME, uuid); - rc = record_setup(obd, llh, log, child, uuid, 0, 0); - rc = record_marker(obd, llh, fsdb, CM_END, log, "add mdt"); + rc = record_marker(obd, llh, fsdb, CM_START, dev, "add mdt"); + rc = record_attach(obd, llh, dev, LUSTRE_MDT0_NAME, uuid); + rc = record_setup(obd, llh, dev, child, uuid, 0, 0); + rc = record_marker(obd, llh, fsdb, CM_END, dev, "add mdt"); rc = record_end_log(obd, &llh); OBD_FREE(uuid, sizeof(*uuid)); @@ -1533,25 +1533,23 @@ static int mgs_write_log_mds(struct obd_device *obd, struct fs_db *fsdb, /* Make up our own uuid */ snprintf(mti->mti_uuid, sizeof(mti->mti_uuid), "%s_UUID", mti->mti_svname); - name_create(mti->mti_fsname, "-mdscmm", &cmmname); - name_create(mti->mti_fsname, "-mdsmdd", &mddname); - name_create(mti->mti_fsname, "-mdsosd", &osdname); - name_create(mti->mti_fsname, "-mdsmdt", &mdtname); - name_create(mti->mti_fsname, "-mdslov", &lovname); + name_create(mti->mti_fsname, "-mdtcmm", &cmmname); + name_create(mti->mti_fsname, "-mdtmdd", &mddname); + name_create(mti->mti_fsname, "-mdtosd", &osdname); + name_create(mti->mti_fsname, "-mdtmdt", &mdtname); + name_create(mti->mti_fsname, "-mdtlov", &lovname); /* add osd */ - rc = mgs_write_log_osd(obd, fsdb, mti->mti_svname, osdname); + rc = mgs_write_log_osd(obd, fsdb, mti->mti_svname, mti->mti_svname); /* add lov */ rc = mgs_write_log_lov(obd, fsdb, mti, mti->mti_svname, lovname); /* add mdd */ rc = mgs_write_log_mdd(obd, fsdb, mti->mti_svname, mddname, osdname, lovname); /* add cmm */ - rc = mgs_write_log_cmm0(obd, fsdb, mti->mti_svname, cmmname, - mddname); + rc = mgs_write_log_cmm0(obd, fsdb, mti->mti_svname, cmmname, mddname); /* add mdt */ - rc = mgs_write_log_mdt0(obd, fsdb, mti->mti_svname, mdtname, - cmmname); + rc = mgs_write_log_mdt0(obd, fsdb, mti->mti_svname, mdtname, cmmname); name_destroy(lovname); name_destroy(osdname); name_destroy(mddname); diff --git a/lustre/osd/osd_handler.c b/lustre/osd/osd_handler.c index f1f5fe0..65bd69a 100644 --- a/lustre/osd/osd_handler.c +++ b/lustre/osd/osd_handler.c @@ -46,6 +46,7 @@ #include /* class_register_type(), class_unregister_type(), class_get_type() */ #include +#include #include "osd_internal.h" @@ -174,11 +175,40 @@ static void osd_type_fini(struct lu_device_type *t) static int osd_device_init(struct osd_device *d, struct lu_device_type *t, struct lustre_cfg *cfg) { + struct lustre_mount_info *lmi = NULL; + struct vfsmount *mnt = NULL; + char *disk = lustre_cfg_string(cfg, 0); + char *name = lustre_cfg_string(cfg, 1); + lu_device_init(&d->od_dt_dev.dd_lu_dev, t); d->od_dt_dev.dd_lu_dev.ld_ops = &osd_lu_ops; - /* - * mount file system... - */ + + if (!disk) { + CERROR("No obd device for OSD!\n"); +#if 1 + } else { + + lmi = server_get_mount(disk); + if (lmi) { + /* We already mounted in lustre_fill_super */ + struct lustre_sb_info *lsi = s2lsi(lmi->lmi_sb); + struct lustre_disk_data *ldd = lsi->lsi_ldd; + struct lustre_mount_data *lmd = lsi->lsi_lmd; + + CDEBUG(D_INFO, "%s info: device=%s,\n opts=%s,\n", + name, lmd->lmd_dev, ldd->ldd_mount_opts); + mnt = lmi->lmi_mnt; + + } else { + CERROR("Cannot get mount info for %s!\n", disk); + } +#endif + } + // to be continued... + + if (lmi) { + server_put_mount(disk, mnt); + } return 0; } @@ -208,6 +238,7 @@ static struct lu_device *osd_device_alloc(struct lu_device_type *t, } } else l = ERR_PTR(-ENOMEM); + return l; } diff --git a/lustre/osd/osd_internal.h b/lustre/osd/osd_internal.h index dfccf62..3cc4e39 100644 --- a/lustre/osd/osd_internal.h +++ b/lustre/osd/osd_internal.h @@ -52,5 +52,9 @@ struct osd_device { struct dt_device od_dt_dev; }; +static inline struct lu_device * osd2lu_dev(struct osd_device * osd) { + return &osd->od_dt_dev.dd_lu_dev; +} + #endif /* __KERNEL__ */ #endif /* _OSD_INTERNAL_H */