From 281327de4119c0db6cedd29f63d1cbd610e465c0 Mon Sep 17 00:00:00 2001 From: zhanghc Date: Wed, 9 Dec 2009 07:25:40 +0000 Subject: [PATCH] b=21379 1, fix a bug in osc_create there is no need to proceed after the orphans are deleted, which could cause the oscc->oscc_next_id is increased by 1 and break the balance between it and the last objid stored in "mds->mds_lov_page_array" 2, change "mds_osc_obd" and "mds_osc_exp" into "mds_lov_obd" and "mds_lov_exp" in mds_obd 3, check the specified osc's export instead lov's export in mds_lov_get_objid i=johann@sun.com i=tappro@sun.com --- lustre/include/obd.h | 5 +-- lustre/lov/lov_obd.c | 13 ++++++++ lustre/mds/handler.c | 32 +++++++++---------- lustre/mds/lproc_mds.c | 2 +- lustre/mds/mds_log.c | 34 ++++++++++---------- lustre/mds/mds_lov.c | 74 ++++++++++++++++++++++++-------------------- lustre/mds/mds_open.c | 16 +++++----- lustre/mds/mds_reint.c | 18 +++++------ lustre/mds/mds_unlink_open.c | 10 +++--- lustre/osc/osc_create.c | 3 +- lustre/quota/quota_master.c | 18 +++++------ 11 files changed, 123 insertions(+), 102 deletions(-) diff --git a/lustre/include/obd.h b/lustre/include/obd.h index c14c51b..ff1988b 100644 --- a/lustre/include/obd.h +++ b/lustre/include/obd.h @@ -584,10 +584,10 @@ struct mds_obd { cfs_dentry_t *mds_objects_dir; struct llog_handle *mds_cfg_llh; // struct llog_handle *mds_catalog; - struct obd_device *mds_osc_obd; /* XXX lov_obd */ + struct obd_device *mds_lov_obd; struct obd_uuid mds_lov_uuid; char *mds_profile; - struct obd_export *mds_osc_exp; /* XXX lov_exp */ + struct obd_export *mds_lov_exp; struct lov_desc mds_lov_desc; /* mark pages dirty for write. */ @@ -1110,6 +1110,7 @@ enum obd_cleanup_stage { #define KEY_BLOCKSIZE_BITS "blocksize_bits" #define KEY_MAX_EASIZE "max_ea_size" #define KEY_FIEMAP "fiemap" +#define KEY_CONNECT_FLAG "connect_flags" /* XXX unused */ #define KEY_ASYNC "async" #define KEY_CAPA_KEY "capa_key" diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index 571a5bb..28e2d94 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -2974,6 +2974,19 @@ static int lov_get_info(struct obd_export *exp, __u32 keylen, GOTO(out, rc = -ESRCH); rc = obd_get_info(tgt->ltd_exp, keylen, key, vallen, val, NULL); GOTO(out, rc); + } else if (KEY_IS(KEY_CONNECT_FLAG)) { + struct lov_tgt_desc *tgt; + __u64 ost_idx = *((__u64*)val); + + LASSERT(*vallen == sizeof(__u64)); + LASSERT(ost_idx < lov->desc.ld_tgt_count); + tgt = lov->lov_tgts[ost_idx]; + + if (!tgt || !tgt->ltd_exp) + GOTO(out, rc = -ESRCH); + + *((__u64*)val) = tgt->ltd_exp->exp_connect_flags; + GOTO(out, rc = 0); } rc = -EINVAL; diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index fea6ba9..9f97a21 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -2111,7 +2111,7 @@ err_put: static int mds_lov_clean(struct obd_device *obd) { struct mds_obd *mds = &obd->u.mds; - struct obd_device *osc = mds->mds_osc_obd; + struct obd_device *lov = mds->mds_lov_obd; ENTRY; if (mds->mds_profile) { @@ -2121,21 +2121,21 @@ static int mds_lov_clean(struct obd_device *obd) } /* There better be a lov */ - if (!osc) + if (!lov) RETURN(0); - if (IS_ERR(osc)) - RETURN(PTR_ERR(osc)); + if (IS_ERR(lov)) + RETURN(PTR_ERR(lov)); - obd_register_observer(osc, NULL); + obd_register_observer(lov, NULL); /* Give lov our same shutdown flags */ - osc->obd_force = obd->obd_force; - osc->obd_fail = obd->obd_fail; + lov->obd_force = obd->obd_force; + lov->obd_fail = obd->obd_fail; /* Cleanup the lov */ - obd_disconnect(mds->mds_osc_exp); - class_manual_cleanup(osc); - mds->mds_osc_exp = NULL; + obd_disconnect(mds->mds_lov_exp); + class_manual_cleanup(lov); + mds->mds_lov_exp = NULL; RETURN(0); } @@ -2209,7 +2209,7 @@ int mds_postrecov(struct obd_device *obd) /* Notify the LOV, which will in turn call mds_notify for each tgt */ /* This means that we have to hack obd_notify to think we're obd_set_up during mds_lov_connect. */ - obd_notify(obd->u.mds.mds_osc_obd, NULL, + obd_notify(obd->u.mds.mds_lov_obd, NULL, obd->obd_async_recov ? OBD_NOTIFY_SYNC_NONBLOCK : OBD_NOTIFY_SYNC, NULL); @@ -2225,13 +2225,13 @@ out: static int mds_lov_early_clean(struct obd_device *obd) { struct mds_obd *mds = &obd->u.mds; - struct obd_device *osc = mds->mds_osc_obd; + struct obd_device *lov = mds->mds_lov_obd; - if (!osc || (!obd->obd_force && !obd->obd_fail)) + if (!lov || (!obd->obd_force && !obd->obd_fail)) return(0); CDEBUG(D_HA, "abort inflight\n"); - return (obd_precleanup(osc, OBD_CLEANUP_EARLY)); + return (obd_precleanup(lov, OBD_CLEANUP_EARLY)); } static int mds_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage) @@ -2269,10 +2269,10 @@ static int mds_cleanup(struct obd_device *obd) RETURN(0); save_dev = lvfs_sbdev(obd->u.obt.obt_sb); - if (mds->mds_osc_exp) + if (mds->mds_lov_exp) /* lov export was disconnected by mds_lov_clean; we just need to drop our ref */ - class_export_put(mds->mds_osc_exp); + class_export_put(mds->mds_lov_exp); remove_proc_entry("clear", obd->obd_proc_exports_entry); lprocfs_free_per_client_stats(obd); diff --git a/lustre/mds/lproc_mds.c b/lustre/mds/lproc_mds.c index 834b67f..b36b6d9 100644 --- a/lustre/mds/lproc_mds.c +++ b/lustre/mds/lproc_mds.c @@ -99,7 +99,7 @@ static int lprocfs_mds_wr_evict_client(struct file *file, const char *buffer, return -ENOMEM; if (obd->u.mds.mds_evict_ost_nids) { - rc = obd_set_info_async(mds->mds_osc_exp,sizeof(KEY_EVICT_BY_NID), + rc = obd_set_info_async(mds->mds_lov_exp,sizeof(KEY_EVICT_BY_NID), KEY_EVICT_BY_NID, strlen(tmpbuf + 4) + 1, tmpbuf + 4, set); if (rc) diff --git a/lustre/mds/mds_log.c b/lustre/mds/mds_log.c index 9cb213d..4d0bf42 100644 --- a/lustre/mds/mds_log.c +++ b/lustre/mds/mds_log.c @@ -60,7 +60,7 @@ static int mds_llog_origin_add(struct llog_ctxt *ctxt, struct llog_rec_hdr *rec, struct llog_cookie *logcookies, int numcookies) { struct obd_device *obd = ctxt->loc_obd; - struct obd_device *lov_obd = obd->u.mds.mds_osc_obd; + struct obd_device *lov_obd = obd->u.mds.mds_lov_obd; struct llog_ctxt *lctxt; int rc; ENTRY; @@ -78,7 +78,7 @@ static int mds_llog_origin_connect(struct llog_ctxt *ctxt, struct obd_uuid *uuid) { struct obd_device *obd = ctxt->loc_obd; - struct obd_device *lov_obd = obd->u.mds.mds_osc_obd; + struct obd_device *lov_obd = obd->u.mds.mds_lov_obd; struct llog_ctxt *lctxt; int rc; ENTRY; @@ -93,7 +93,7 @@ static int mds_llog_repl_cancel(struct llog_ctxt *ctxt, struct lov_stripe_md *ls int count, struct llog_cookie *cookies, int flags) { struct obd_device *obd = ctxt->loc_obd; - struct obd_device *lov_obd = obd->u.mds.mds_osc_obd; + struct obd_device *lov_obd = obd->u.mds.mds_lov_obd; struct llog_ctxt *lctxt; int rc; ENTRY; @@ -112,7 +112,7 @@ static int mds_llog_add_unlink(struct obd_device *obd, struct llog_ctxt *ctxt; int rc; - rc = obd_checkmd(obd->u.mds.mds_osc_exp, obd->obd_self_export, lsm); + rc = obd_checkmd(obd->u.mds.mds_lov_exp, obd->obd_self_export, lsm); if (rc) RETURN(rc); /* first prepare unlink log record */ @@ -140,15 +140,15 @@ int mds_log_op_unlink(struct obd_device *obd, int rc; ENTRY; - if (IS_ERR(mds->mds_osc_obd)) - RETURN(PTR_ERR(mds->mds_osc_obd)); + if (IS_ERR(mds->mds_lov_obd)) + RETURN(PTR_ERR(mds->mds_lov_obd)); - rc = obd_unpackmd(mds->mds_osc_exp, &lsm, lmm, lmm_size); + rc = obd_unpackmd(mds->mds_lov_exp, &lsm, lmm, lmm_size); if (rc < 0) RETURN(rc); rc = mds_llog_add_unlink(obd, lsm, 0, logcookies, cookies_size / sizeof(struct llog_cookie)); - obd_free_memmd(mds->mds_osc_exp, &lsm); + obd_free_memmd(mds->mds_lov_exp, &lsm); RETURN(rc); } @@ -160,10 +160,10 @@ int mds_log_op_orphan(struct obd_device *obd, struct lov_stripe_md *lsm, int rc; ENTRY; - if (IS_ERR(mds->mds_osc_obd)) - RETURN(PTR_ERR(mds->mds_osc_obd)); + if (IS_ERR(mds->mds_lov_obd)) + RETURN(PTR_ERR(mds->mds_lov_obd)); - rc = obd_checkmd(mds->mds_osc_exp, obd->obd_self_export, lsm); + rc = obd_checkmd(mds->mds_lov_exp, obd->obd_self_export, lsm); if (rc) RETURN(rc); rc = mds_llog_add_unlink(obd, lsm, count - 1, &logcookie, 1); @@ -181,14 +181,14 @@ int mds_log_op_setattr(struct obd_device *obd, struct inode *inode, int rc; ENTRY; - if (IS_ERR(mds->mds_osc_obd)) - RETURN(PTR_ERR(mds->mds_osc_obd)); + if (IS_ERR(mds->mds_lov_obd)) + RETURN(PTR_ERR(mds->mds_lov_obd)); - rc = obd_unpackmd(mds->mds_osc_exp, &lsm, lmm, lmm_size); + rc = obd_unpackmd(mds->mds_lov_exp, &lsm, lmm, lmm_size); if (rc < 0) RETURN(rc); - rc = obd_checkmd(mds->mds_osc_exp, obd->obd_self_export, lsm); + rc = obd_checkmd(mds->mds_lov_exp, obd->obd_self_export, lsm); if (rc) GOTO(out, rc); @@ -211,7 +211,7 @@ int mds_log_op_setattr(struct obd_device *obd, struct inode *inode, OBD_FREE(lsr, sizeof(*lsr)); out: - obd_free_memmd(mds->mds_osc_exp, &lsm); + obd_free_memmd(mds->mds_lov_exp, &lsm); RETURN(rc); } @@ -227,7 +227,7 @@ static struct llog_operations mds_size_repl_logops = { int mds_llog_init(struct obd_device *obd, struct obd_device *disk_obd, int *index) { - struct obd_device *lov_obd = obd->u.mds.mds_osc_obd; + struct obd_device *lov_obd = obd->u.mds.mds_lov_obd; struct llog_ctxt *ctxt; int rc; ENTRY; diff --git a/lustre/mds/mds_lov.c b/lustre/mds/mds_lov.c index 5c13f76..4cec524 100644 --- a/lustre/mds/mds_lov.c +++ b/lustre/mds/mds_lov.c @@ -272,7 +272,7 @@ static int mds_log_lost_precreated(struct obd_device *obd, ENTRY; if (*lsmp == NULL) { - rc = obd_alloc_memmd(obd->u.mds.mds_osc_exp, &lsm); + rc = obd_alloc_memmd(obd->u.mds.mds_lov_exp, &lsm); if (rc < 0) RETURN(rc); /* need only one stripe, save old value */ @@ -341,7 +341,7 @@ void mds_lov_update_objids(struct obd_device *obd, struct lov_mds_md *lmm) if (lsm) { /* restore stripes number */ lsm->lsm_stripe_count = stripes; - obd_free_memmd(mds->mds_osc_exp, &lsm); + obd_free_memmd(mds->mds_lov_exp, &lsm); } #endif EXIT; @@ -471,28 +471,36 @@ static int mds_lov_get_objid(struct obd_device * obd, obd_id idx) { struct mds_obd *mds = &obd->u.mds; - struct obd_export *osc_exp = mds->mds_osc_exp; + struct obd_export *lov_exp = mds->mds_lov_exp; unsigned int page; unsigned int off; obd_id *data; + __u64 connect_flags; + __u32 size; int rc = 0; ENTRY; - LASSERT(osc_exp != NULL); + LASSERT(lov_exp != NULL); page = idx / OBJID_PER_PAGE(); off = idx % OBJID_PER_PAGE(); data = mds->mds_lov_page_array[page]; - if (data[off] < 2 || - !(osc_exp->exp_connect_flags & OBD_CONNECT_SKIP_ORPHAN)) { + size = sizeof(__u64); + connect_flags = idx; + rc = obd_get_info(lov_exp, sizeof(KEY_CONNECT_FLAG), KEY_CONNECT_FLAG, + &size, &connect_flags, NULL); + if (rc) + GOTO(out, rc); + + if (data[off] < 2 || connect_flags & OBD_CONNECT_SKIP_ORPHAN) { /* We never read this lastid; ask the osc */ struct obd_id_info lastid; - __u32 size = sizeof(lastid); + size = sizeof(lastid); lastid.idx = idx; lastid.data = &data[off]; - rc = obd_get_info(mds->mds_osc_exp, sizeof(KEY_LAST_ID), + rc = obd_get_info(lov_exp, sizeof(KEY_LAST_ID), KEY_LAST_ID, &size, &lastid, NULL); if (rc) GOTO(out, rc); @@ -528,7 +536,7 @@ int mds_lov_clear_orphans(struct mds_obd *mds, struct obd_uuid *ost_uuid) if (ost_uuid != NULL) oti.oti_ost_uuid = ost_uuid; - rc = obd_create(mds->mds_osc_exp, &oa, &empty_ea, &oti); + rc = obd_create(mds->mds_lov_exp, &oa, &empty_ea, &oti); RETURN(rc); } @@ -545,7 +553,7 @@ static int mds_lov_set_one_nextid(struct obd_device * obd, __u32 idx, obd_id *id info.idx = idx; info.data = id; - rc = obd_set_info_async(mds->mds_osc_exp, sizeof(KEY_NEXT_ID), + rc = obd_set_info_async(mds->mds_lov_exp, sizeof(KEY_NEXT_ID), KEY_NEXT_ID, sizeof(info), &info, NULL); if (rc) CERROR ("%s: mds_lov_set_nextid failed (%d)\n", @@ -568,7 +576,7 @@ static int mds_lov_update_desc(struct obd_device *obd, __u32 index, if (!ld) RETURN(-ENOMEM); - rc = obd_get_info(mds->mds_osc_exp, sizeof(KEY_LOVDESC), KEY_LOVDESC, + rc = obd_get_info(mds->mds_lov_exp, sizeof(KEY_LOVDESC), KEY_LOVDESC, &valsize, ld, NULL); if (rc) GOTO(out, rc); @@ -661,14 +669,14 @@ int mds_lov_connect(struct obd_device *obd, char * lov_name) int rc; ENTRY; - if (IS_ERR(mds->mds_osc_obd)) - RETURN(PTR_ERR(mds->mds_osc_obd)); + if (IS_ERR(mds->mds_lov_obd)) + RETURN(PTR_ERR(mds->mds_lov_obd)); - if (mds->mds_osc_obd) + if (mds->mds_lov_obd) RETURN(0); - mds->mds_osc_obd = class_name2obd(lov_name); - if (!mds->mds_osc_obd) { + mds->mds_lov_obd = class_name2obd(lov_name); + if (!mds->mds_lov_obd) { CERROR("MDS cannot locate LOV %s\n", lov_name); GOTO(error_exit, rc = -ENOTCONN); } @@ -684,7 +692,7 @@ int mds_lov_connect(struct obd_device *obd, char * lov_name) /* Deny new client connections until we are sure we have some OSTs */ obd->obd_no_conn = 1; - rc = obd_register_observer(mds->mds_osc_obd, obd); + rc = obd_register_observer(mds->mds_lov_obd, obd); if (rc) { CERROR("MDS cannot register as observer of LOV %s (%d)\n", lov_name, rc); @@ -693,7 +701,7 @@ int mds_lov_connect(struct obd_device *obd, char * lov_name) /* ask lov to generate OBD_NOTIFY_CREATE events for already registered * targets */ - obd_notify(obd->u.mds.mds_osc_obd, NULL, OBD_NOTIFY_CREATE, NULL); + obd_notify(obd->u.mds.mds_lov_obd, NULL, OBD_NOTIFY_CREATE, NULL); OBD_ALLOC(data, sizeof(*data)); if (data == NULL) @@ -707,7 +715,7 @@ int mds_lov_connect(struct obd_device *obd, char * lov_name) #endif data->ocd_version = LUSTRE_VERSION_CODE; /* NB: lov_connect() needs to fill in .ocd_index for each OST */ - rc = obd_connect(&conn, mds->mds_osc_obd, &obd->obd_uuid, data, &mds->mds_osc_exp); + rc = obd_connect(&conn, mds->mds_lov_obd, &obd->obd_uuid, data, &mds->mds_lov_exp); OBD_FREE(data, sizeof(*data)); if (rc) { CERROR("MDS cannot connect to LOV %s (%d)\n", lov_name, rc); @@ -720,8 +728,8 @@ int mds_lov_connect(struct obd_device *obd, char * lov_name) RETURN(rc); error_exit: - mds->mds_osc_exp = NULL; - mds->mds_osc_obd = ERR_PTR(rc); + mds->mds_lov_exp = NULL; + mds->mds_lov_obd = ERR_PTR(rc); RETURN(rc); } @@ -731,16 +739,16 @@ int mds_lov_disconnect(struct obd_device *obd) int rc = 0; ENTRY; - if (!IS_ERR(mds->mds_osc_obd) && mds->mds_osc_exp != NULL) { - obd_register_observer(mds->mds_osc_obd, NULL); + if (!IS_ERR(mds->mds_lov_obd) && mds->mds_lov_exp != NULL) { + obd_register_observer(mds->mds_lov_obd, NULL); /* The actual disconnect of the mds_lov will be called from * class_disconnect_exports from mds_lov_clean. So we have to * ensure that class_cleanup doesn't fail due to the extra ref * we're holding now. The mechanism to do that already exists - * the obd_force flag. We'll drop the final ref to the - * mds_osc_exp in mds_cleanup. */ - mds->mds_osc_obd->obd_force = 1; + * mds_lov_exp in mds_cleanup. */ + mds->mds_lov_obd->obd_force = 1; } RETURN(rc); @@ -918,7 +926,7 @@ int mds_iocontrol(unsigned int cmd, struct obd_export *exp, int len, rc = obd_llog_init(obd, obd, NULL); llog_ctxt_put(ctxt); - rc2 = obd_set_info_async(mds->mds_osc_exp, + rc2 = obd_set_info_async(mds->mds_lov_exp, sizeof(KEY_MDS_CONN), KEY_MDS_CONN, 0, NULL, NULL); if (!rc) @@ -1029,7 +1037,7 @@ static int __mds_lov_synchronize(void *data) GOTO(out, rc); } - rc = obd_set_info_async(mds->mds_osc_exp, sizeof(KEY_MDS_CONN), + rc = obd_set_info_async(mds->mds_lov_exp, sizeof(KEY_MDS_CONN), KEY_MDS_CONN, 0, uuid, NULL); if (rc != 0) GOTO(out, rc); @@ -1068,9 +1076,9 @@ out: /* Deactivate it for safety */ CERROR("%s sync failed %d, deactivating\n", obd_uuid2str(uuid), rc); - if (!obd->obd_stopping && mds->mds_osc_obd && - !mds->mds_osc_obd->obd_stopping && !watched->obd_stopping) - obd_notify(mds->mds_osc_obd, watched, + if (!obd->obd_stopping && mds->mds_lov_obd && + !mds->mds_lov_obd->obd_stopping && !watched->obd_stopping) + obd_notify(mds->mds_lov_obd, watched, OBD_NOTIFY_INACTIVE, NULL); } else { /* We've successfully synced at least 1 OST and are ready @@ -1287,11 +1295,11 @@ int mds_convert_lov_ea(struct obd_device *obd, struct inode *inode, inode->i_ino, inode->i_generation, le32_to_cpu(lmm->lmm_magic), LOV_MAGIC); - rc = obd_unpackmd(obd->u.mds.mds_osc_exp, &lsm, lmm, lmm_size); + rc = obd_unpackmd(obd->u.mds.mds_lov_exp, &lsm, lmm, lmm_size); if (rc < 0) GOTO(conv_end, rc); - rc = obd_packmd(obd->u.mds.mds_osc_exp, &lmm, lsm); + rc = obd_packmd(obd->u.mds.mds_lov_exp, &lmm, lsm); if (rc < 0) GOTO(conv_free, rc); lmm_size = rc; @@ -1309,7 +1317,7 @@ int mds_convert_lov_ea(struct obd_device *obd, struct inode *inode, rc = err ? err : lmm_size; GOTO(conv_free, rc); conv_free: - obd_free_memmd(obd->u.mds.mds_osc_exp, &lsm); + obd_free_memmd(obd->u.mds.mds_lov_exp, &lsm); conv_end: return rc; } diff --git a/lustre/mds/mds_open.c b/lustre/mds/mds_open.c index 7a25753..20269b6 100644 --- a/lustre/mds/mds_open.c +++ b/lustre/mds/mds_open.c @@ -409,7 +409,7 @@ static int mds_create_objects(struct ptlrpc_request *req, int offset, /* check if things like lfs setstripe are sending us the ea */ if (rec->ur_flags & MDS_OPEN_HAS_EA) { rc = obd_iocontrol(OBD_IOC_LOV_SETSTRIPE, - mds->mds_osc_exp, + mds->mds_lov_exp, 0, &oinfo.oi_md, rec->ur_eadata); if (rc) GOTO(out_oa, rc); @@ -425,13 +425,13 @@ static int mds_create_objects(struct ptlrpc_request *req, int offset, req->rq_export->exp_connect_flags); if (rc > 0) rc = obd_iocontrol(OBD_IOC_LOV_SETSTRIPE, - mds->mds_osc_exp, + mds->mds_lov_exp, 0, &oinfo.oi_md, lmm); OBD_FREE(lmm, lmm_sz); if (rc) GOTO(out_oa, rc); } - rc = obd_create(mds->mds_osc_exp, oinfo.oi_oa, + rc = obd_create(mds->mds_lov_exp, oinfo.oi_oa, &oinfo.oi_md, &oti); if (rc) { int level = D_ERROR; @@ -448,7 +448,7 @@ static int mds_create_objects(struct ptlrpc_request *req, int offset, GOTO(out_oa, rc); } } else { - rc = obd_iocontrol(OBD_IOC_LOV_SETEA, mds->mds_osc_exp, + rc = obd_iocontrol(OBD_IOC_LOV_SETEA, mds->mds_lov_exp, 0, &oinfo.oi_md, rec->ur_eadata); if (rc) { GOTO(out_oa, rc); @@ -468,7 +468,7 @@ static int mds_create_objects(struct ptlrpc_request *req, int offset, oinfo.oi_policy.l_extent.start = i_size_read(inode); oinfo.oi_policy.l_extent.end = OBD_OBJECT_EOF; - rc = obd_punch_rqset(mds->mds_osc_exp, &oinfo, &oti); + rc = obd_punch_rqset(mds->mds_lov_exp, &oinfo, &oti); if (rc) { CERROR("error setting attrs for inode %lu: rc %d\n", inode->i_ino, rc); @@ -486,7 +486,7 @@ static int mds_create_objects(struct ptlrpc_request *req, int offset, LASSERT(oinfo.oi_md && oinfo.oi_md->lsm_object_id); lmm = NULL; - rc = obd_packmd(mds->mds_osc_exp, &lmm, oinfo.oi_md); + rc = obd_packmd(mds->mds_lov_exp, &lmm, oinfo.oi_md); if (rc < 0) { CERROR("cannot pack lsm, err = %d\n", rc); GOTO(out_oa, rc); @@ -509,13 +509,13 @@ static int mds_create_objects(struct ptlrpc_request *req, int offset, *objid = lmm_buf; /* save for mds_lov_update_objid */ free_diskmd: - obd_free_diskmd(mds->mds_osc_exp, &lmm); + obd_free_diskmd(mds->mds_lov_exp, &lmm); out_oa: oti_free_cookies(&oti); OBDO_FREE(oinfo.oi_oa); out_ids: if (oinfo.oi_md) - obd_free_memmd(mds->mds_osc_exp, &oinfo.oi_md); + obd_free_memmd(mds->mds_lov_exp, &oinfo.oi_md); RETURN(rc); } diff --git a/lustre/mds/mds_reint.c b/lustre/mds/mds_reint.c index eca8297..4798f43 100644 --- a/lustre/mds/mds_reint.c +++ b/lustre/mds/mds_reint.c @@ -126,14 +126,14 @@ static void mds_cancel_cookies_cb(struct obd_device *obd, __u64 transno, CDEBUG(D_RPCTRACE, "cancelling %d cookies\n", (int)(mlcd->mlcd_cookielen / sizeof(*mlcd->mlcd_cookies))); - rc = obd_unpackmd(obd->u.mds.mds_osc_exp, &lsm, mlcd->mlcd_lmm, + rc = obd_unpackmd(obd->u.mds.mds_lov_exp, &lsm, mlcd->mlcd_lmm, mlcd->mlcd_eadatalen); if (rc < 0) { CERROR("bad LSM cancelling %d log cookies: rc %d\n", (int)(mlcd->mlcd_cookielen/sizeof(*mlcd->mlcd_cookies)), rc); } else { - rc = obd_checkmd(obd->u.mds.mds_osc_exp, obd->obd_self_export, + rc = obd_checkmd(obd->u.mds.mds_lov_exp, obd->obd_self_export, lsm); if (rc) CERROR("Can not revalidate lsm %p \n", lsm); @@ -609,13 +609,13 @@ int mds_osc_setattr_async(struct obd_device *obd, struct inode *inode, LASSERT(lmm); - rc = obd_unpackmd(mds->mds_osc_exp, &oinfo.oi_md, lmm, lmm_size); + rc = obd_unpackmd(mds->mds_lov_exp, &oinfo.oi_md, lmm, lmm_size); if (rc < 0) { CERROR("Error unpack md %p for inode %lu\n", lmm, inode->i_ino); GOTO(out, rc); } - rc = obd_checkmd(mds->mds_osc_exp, obd->obd_self_export, oinfo.oi_md); + rc = obd_checkmd(mds->mds_lov_exp, obd->obd_self_export, oinfo.oi_md); if (rc) { CERROR("Error revalidate lsm %p \n", oinfo.oi_md); GOTO(out, rc); @@ -637,13 +637,13 @@ int mds_osc_setattr_async(struct obd_device *obd, struct inode *inode, oinfo.oi_oa->o_valid |= OBD_MD_FLFID | OBD_MD_FLGENER; /* do async setattr from mds to ost not waiting for responses. */ - rc = obd_setattr_async(mds->mds_osc_exp, &oinfo, &oti, NULL); + rc = obd_setattr_async(mds->mds_lov_exp, &oinfo, &oti, NULL); if (rc) CDEBUG(D_INODE, "mds to ost setattr objid 0x"LPX64 " on ost error %d\n", oinfo.oi_md->lsm_object_id, rc); out: if (oinfo.oi_md) - obd_free_memmd(mds->mds_osc_exp, &oinfo.oi_md); + obd_free_memmd(mds->mds_lov_exp, &oinfo.oi_md); OBDO_FREE(oinfo.oi_oa); RETURN(rc); } @@ -814,12 +814,12 @@ static int mds_reint_setattr(struct mds_update_record *rec, int offset, GOTO(cleanup, rc); } else { rc = obd_iocontrol(OBD_IOC_LOV_SETSTRIPE, - mds->mds_osc_exp, 0, + mds->mds_lov_exp, 0, &lsm, rec->ur_eadata); if (rc) GOTO(cleanup, rc); - obd_free_memmd(mds->mds_osc_exp, &lsm); + obd_free_memmd(mds->mds_lov_exp, &lsm); rc = fsfilt_set_md(obd, inode, handle, rec->ur_eadata, rec->ur_eadatalen, "lov"); @@ -839,7 +839,7 @@ static int mds_reint_setattr(struct mds_update_record *rec, int offset, if (ia_valid & (ATTR_ATIME | ATTR_ATIME_SET)) body->valid |= OBD_MD_FLATIME; - if (rc == 0 && rec->ur_cookielen && !IS_ERR(mds->mds_osc_obd)) { + if (rc == 0 && rec->ur_cookielen && !IS_ERR(mds->mds_lov_obd)) { OBD_ALLOC(mlcd, sizeof(*mlcd) + rec->ur_cookielen + rec->ur_eadatalen); if (mlcd) { diff --git a/lustre/mds/mds_unlink_open.c b/lustre/mds/mds_unlink_open.c index 0e6d15a..e798eab 100644 --- a/lustre/mds/mds_unlink_open.c +++ b/lustre/mds/mds_unlink_open.c @@ -75,7 +75,7 @@ int mds_osc_destroy_orphan(struct obd_device *obd, if (lmm_size == 0) RETURN(0); - rc = obd_unpackmd(mds->mds_osc_exp, &lsm, lmm, lmm_size); + rc = obd_unpackmd(mds->mds_lov_exp, &lsm, lmm, lmm_size); if (rc < 0) { CERROR("Error unpack md %p\n", lmm); RETURN(rc); @@ -84,7 +84,7 @@ int mds_osc_destroy_orphan(struct obd_device *obd, rc = 0; } - rc = obd_checkmd(mds->mds_osc_exp, obd->obd_self_export, lsm); + rc = obd_checkmd(mds->mds_lov_exp, obd->obd_self_export, lsm); if (rc) GOTO(out_free_memmd, rc); @@ -100,13 +100,13 @@ int mds_osc_destroy_orphan(struct obd_device *obd, oa->o_valid |= OBD_MD_FLCOOKIE; oti.oti_logcookies = logcookies; } - rc = obd_destroy(mds->mds_osc_exp, oa, lsm, &oti, obd->obd_self_export); + rc = obd_destroy(mds->mds_lov_exp, oa, lsm, &oti, obd->obd_self_export); OBDO_FREE(oa); if (rc) CDEBUG(D_INODE, "destroy orphan objid 0x"LPX64" on ost error " "%d\n", lsm->lsm_object_id, rc); out_free_memmd: - obd_free_memmd(mds->mds_osc_exp, &lsm); + obd_free_memmd(mds->mds_lov_exp, &lsm); RETURN(rc); } @@ -122,7 +122,7 @@ static int mds_unlink_orphan(struct obd_device *obd, struct dentry *dchild, int rc, err; ENTRY; - LASSERT(mds->mds_osc_obd != NULL); + LASSERT(mds->mds_lov_obd != NULL); /* We don't need to do any of these other things for orhpan dirs, * especially not mds_get_md (may get a default LOV EA, bug 4554) */ diff --git a/lustre/osc/osc_create.c b/lustre/osc/osc_create.c index 30b0736..7d7286d 100644 --- a/lustre/osc/osc_create.c +++ b/lustre/osc/osc_create.c @@ -579,8 +579,7 @@ int osc_create(struct obd_export *exp, struct obdo *oa, cfs_waitq_signal(&oscc->oscc_waitq); spin_unlock(&oscc->oscc_lock); - if (rc < 0) - RETURN(rc); + RETURN(rc); } lsm = *ea; diff --git a/lustre/quota/quota_master.c b/lustre/quota/quota_master.c index b349363..912772f 100644 --- a/lustre/quota/quota_master.c +++ b/lustre/quota/quota_master.c @@ -322,7 +322,7 @@ int dqacq_adjust_qunit_sz(struct obd_device *obd, qid_t id, int type, /* only when block qunit is reduced, boardcast to osts */ if ((adjust_res & LQS_BLK_DECREASE) && QAQ_IS_ADJBLK(oqaq)) - rc = obd_quota_adjust_qunit(mds->mds_osc_exp, oqaq, qctxt); + rc = obd_quota_adjust_qunit(mds->mds_lov_exp, oqaq, qctxt); out: lustre_dqput(dquot); @@ -689,7 +689,7 @@ int mds_quota_finvalidate(struct obd_device *obd, struct obd_quotactl *oqctl) oqctl->qc_cmd = Q_FINVALIDATE; rc = fsfilt_quotactl(obd, obd->u.obt.obt_sb, oqctl); if (!rc) - rc = obd_quotactl(mds->mds_osc_exp, oqctl); + rc = obd_quotactl(mds->mds_lov_exp, oqctl); up(&mds->mds_qonoff_sem); pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); @@ -939,7 +939,7 @@ int mds_quota_on(struct obd_device *obd, struct obd_quotactl *oqctl) else GOTO(out, rc); - rc = obd_quotactl(mds->mds_osc_exp, oqctl); + rc = obd_quotactl(mds->mds_lov_exp, oqctl); out: pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); @@ -972,7 +972,7 @@ int mds_quota_off(struct obd_device *obd, struct obd_quotactl *oqctl) push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); mds_admin_quota_off(obd, oqctl); - rc = obd_quotactl(mds->mds_osc_exp, oqctl); + rc = obd_quotactl(mds->mds_lov_exp, oqctl); rc2 = fsfilt_quotactl(obd, obd->u.obt.obt_sb, oqctl); if (!rc2) obt->obt_qctxt.lqc_flags &= ~UGQUOTA2LQC(oqctl->qc_type); @@ -1278,7 +1278,7 @@ static int mds_init_slave_blimits(struct obd_device *obd, gid = oqctl->qc_id; /* initialize all slave's limit */ - rc = obd_quotactl(mds->mds_osc_exp, ioqc); + rc = obd_quotactl(mds->mds_lov_exp, ioqc); rc = qctxt_adjust_qunit(obd, &obd->u.obt.obt_qctxt, uid, gid, 1, 0, NULL); @@ -1310,7 +1310,7 @@ static void adjust_lqs(struct obd_device *obd, struct quota_adjust_qunit *qaq) /* adjust remote lqs */ if (QAQ_IS_ADJBLK(qaq)) { - rc = obd_quota_adjust_qunit(obd->u.mds.mds_osc_exp, qaq, qctxt); + rc = obd_quota_adjust_qunit(obd->u.mds.mds_lov_exp, qaq, qctxt); if (rc < 0) CERROR("adjust slaves' qunit size failed!(rc=%d)\n", rc); @@ -1321,7 +1321,7 @@ int mds_set_dqblk(struct obd_device *obd, struct obd_quotactl *oqctl) { struct mds_obd *mds = &obd->u.mds; struct lustre_quota_ctxt *qctxt = &mds->mds_obt.obt_qctxt; - struct obd_device *lov_obd = class_exp2obd(mds->mds_osc_exp); + struct obd_device *lov_obd = class_exp2obd(mds->mds_lov_exp); struct lov_obd *lov = &lov_obd->u.lov; struct quota_adjust_qunit *oqaq = NULL; struct lustre_quota_info *qinfo = &mds->mds_quota_info; @@ -1504,7 +1504,7 @@ static int mds_get_space(struct obd_device *obd, struct obd_quotactl *oqctl) soqc->qc_id = oqctl->qc_id; soqc->qc_type = oqctl->qc_type; - rc = obd_quotactl(obd->u.mds.mds_osc_exp, soqc); + rc = obd_quotactl(obd->u.mds.mds_lov_exp, soqc); oqctl->qc_dqblk.dqb_curspace = soqc->qc_dqblk.dqb_curspace; @@ -1626,7 +1626,7 @@ dquot_recovery(struct obd_device *obd, unsigned int id, unsigned short type) qctl->qc_type = type; qctl->qc_id = id; qctl->qc_stat = QUOTA_RECOVERING; - rc = obd_quotactl(obd->u.mds.mds_osc_exp, qctl); + rc = obd_quotactl(obd->u.mds.mds_lov_exp, qctl); if (rc) GOTO(out, rc); total_limits = qctl->qc_dqblk.dqb_bhardlimit; -- 1.8.3.1