From: yury Date: Fri, 14 Apr 2006 17:42:03 +0000 (+0000) Subject: - more changes in lmv X-Git-Tag: v1_8_0_110~486^2~2008 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=3e0b18b44816cfb11c534a219caaf60a745de9ea;p=fs%2Flustre-release.git - more changes in lmv --- diff --git a/lustre/lmv/lmv_intent.c b/lustre/lmv/lmv_intent.c index 2d78fb1..93152ae 100644 --- a/lustre/lmv/lmv_intent.c +++ b/lustre/lmv/lmv_intent.c @@ -150,12 +150,12 @@ repeat: if (obj) { /* directory is already splitted, so we have to forward * request to the right MDS */ - mds = raw_name2idx(obj->hashtype, obj->objcount, + mds = raw_name2idx(obj->lo_hashtype, obj->lo_objcount, (char *)name, len); CDEBUG(D_OTHER, "forward to MDS #%u ("DFID3")\n", mds, PFID3(&rpid)); - rpid = obj->objs[mds].lo_fid; + rpid = obj->lo_objs[mds].li_fid; lmv_put_obj(obj); } @@ -264,7 +264,7 @@ int lmv_intent_getattr(struct obd_export *exp, struct lu_fid *pid, /* in fact, we need not this with current intent_lock(), * but it may change some day */ if (!lu_fid_eq(pid, cid)){ - rpid = obj->objs[mds].lo_fid; + rpid = obj->lo_objs[mds].li_fid; mds = lmv_fld_lookup(obd, &rpid); } lmv_put_obj(obj); @@ -277,9 +277,9 @@ int lmv_intent_getattr(struct obd_export *exp, struct lu_fid *pid, obj = lmv_grab_obj(obd, pid); if (obj && len) { /* directory is already splitted. calculate mds */ - mds = raw_name2idx(obj->hashtype, obj->objcount, + mds = raw_name2idx(obj->lo_hashtype, obj->lo_objcount, (char *)name, len); - rpid = obj->objs[mds].lo_fid; + rpid = obj->lo_objs[mds].li_fid; mds = lmv_fld_lookup(obd, &rpid); lmv_put_obj(obj); @@ -363,7 +363,7 @@ int lmv_intent_getattr(struct obd_export *exp, struct lu_fid *pid, void lmv_update_body_from_obj(struct mdt_body *body, struct lmv_inode *obj) { /* update size */ - body->size += obj->size; + body->size += obj->lo_size; } int lmv_lookup_slaves(struct obd_export *exp, struct ptlrpc_request **reqp) @@ -403,8 +403,8 @@ int lmv_lookup_slaves(struct obd_export *exp, struct ptlrpc_request **reqp) lmv_lock_obj(obj); - for (i = 0; i < obj->objcount; i++) { - struct lu_fid fid = obj->objs[i].lo_fid; + for (i = 0; i < obj->lo_objcount; i++) { + struct lu_fid fid = obj->lo_objs[i].li_fid; struct ptlrpc_request *req = NULL; struct lookup_intent it; int mds; @@ -413,7 +413,7 @@ int lmv_lookup_slaves(struct obd_export *exp, struct ptlrpc_request **reqp) /* skip master obj */ continue; - CDEBUG(D_OTHER, "lookup slave "DFID3"\n", PFID3(&id)); + CDEBUG(D_OTHER, "lookup slave "DFID3"\n", PFID3(&fid)); /* is obj valid? */ memset(&it, 0, sizeof(it)); @@ -423,8 +423,8 @@ int lmv_lookup_slaves(struct obd_export *exp, struct ptlrpc_request **reqp) GOTO(cleanup, rc = -ENOMEM); mds = lmv_fld_lookup(obd, &fid); - rc = md_intent_lock(lmv->tgts[mds].ltd_exp, &id, - NULL, 0, NULL, 0, &id, &it, 0, &req, + rc = md_intent_lock(lmv->tgts[mds].ltd_exp, &fid, + NULL, 0, NULL, 0, &fid, &it, 0, &req, lmv_dirobj_blocking_ast); lockh = (struct lustre_handle *)&LUSTRE_IT(&it)->it_lock_handle; @@ -448,17 +448,17 @@ int lmv_lookup_slaves(struct obd_export *exp, struct ptlrpc_request **reqp) body2 = lustre_msg_buf(req->rq_repmsg, 1, sizeof(*body2)); LASSERT(body2); - obj->objs[i].size = body2->size; + obj->lo_objs[i].li_size = body2->size; CDEBUG(D_OTHER, "fresh: %lu\n", - (unsigned long)obj->objs[i].size); + (unsigned long)obj->lo_objs[i].li_size); LDLM_LOCK_PUT(lock); if (req) ptlrpc_req_finished(req); release_lock: - lmv_update_body_from_obj(body, obj->objs + i); + lmv_update_body_from_obj(body, obj->lo_objs + i); if (LUSTRE_IT(&it)->it_lock_mode) ldlm_lock_decref(lockh, LUSTRE_IT(&it)->it_lock_mode); @@ -488,22 +488,22 @@ int lmv_intent_lookup(struct obd_export *exp, struct lu_fid *pid, ENTRY; /* - * IT_LOOKUP is intended to produce name -> id resolving (let's call + * IT_LOOKUP is intended to produce name -> fid resolving (let's call * this lookup below) or to confirm requested resolving is still valid * (let's call this revalidation) cid != NULL specifies revalidation. */ if (cid) { /* * this is revalidation: we have to check is LOOKUP lock still - * valid for given id. Very important part is that we have to + * valid for given fid. Very important part is that we have to * choose right mds because namespace is per mds. */ rpid = *pid; obj = lmv_grab_obj(obd, pid); if (obj) { - mds = raw_name2idx(obj->hashtype, obj->objcount, + mds = raw_name2idx(obj->lo_hashtype, obj->lo_objcount, (char *)name, len); - rpid = obj->objs[mds].lo_fid; + rpid = obj->lo_objs[mds].li_fid; lmv_put_obj(obj); } mds = lmv_fld_lookup(obd, &rpid); @@ -524,9 +524,9 @@ repeat: if (obj) { if (len) { /* directory is already splitted. calculate mds */ - mds = raw_name2idx(obj->hashtype, obj->objcount, + mds = raw_name2idx(obj->lo_hashtype, obj->lo_objcount, (char *)name, len); - rpid = obj->objs[mds].lo_fid; + rpid = obj->lo_objs[mds].li_fid; mds = lmv_fld_lookup(obd, &rpid); } lmv_put_obj(obj); @@ -660,8 +660,8 @@ int lmv_revalidate_slaves(struct obd_export *exp, struct ptlrpc_request **reqp, lmv_lock_obj(obj); - for (i = 0; i < obj->objcount; i++) { - struct lu_fid fid = obj->objs[i].lo_fid; + for (i = 0; i < obj->lo_objcount; i++) { + struct lu_fid fid = obj->lo_objs[i].li_fid; struct lustre_handle *lockh = NULL; struct ptlrpc_request *req = NULL; ldlm_blocking_callback cb; @@ -669,7 +669,7 @@ int lmv_revalidate_slaves(struct obd_export *exp, struct ptlrpc_request **reqp, int master = 0; CDEBUG(D_OTHER, "revalidate subobj "DFID3"\n", - PFID3(&id)); + PFID3(&fid)); memset(&it, 0, sizeof(it)); it.it_op = IT_GETATTR; @@ -705,7 +705,7 @@ int lmv_revalidate_slaves(struct obd_export *exp, struct ptlrpc_request **reqp, /* is obj valid? */ mds = lmv_fld_lookup(obd, &fid); rc = md_intent_lock(lmv->tgts[mds].ltd_exp, - &id, NULL, 0, NULL, 0, &id, &it, 0, + &fid, NULL, 0, NULL, 0, &fid, &it, 0, &req, cb); lockh = (struct lustre_handle *) &LUSTRE_IT(&it)->it_lock_handle; if (rc > 0 && req == NULL) { @@ -748,15 +748,15 @@ int lmv_revalidate_slaves(struct obd_export *exp, struct ptlrpc_request **reqp, LASSERT(body); update: - obj->objs[i].size = body->size; + obj->lo_objs[i].li_size = body->size; CDEBUG(D_OTHER, "fresh: %lu\n", - (unsigned long)obj->objs[i].size); + (unsigned long)obj->lo_objs[i].li_size); if (req) ptlrpc_req_finished(req); release_lock: - size += obj->objs[i].size; + size += obj->lo_objs[i].li_size; if (LUSTRE_IT(&it)->it_lock_mode) ldlm_lock_decref(lockh, LUSTRE_IT(&it)->it_lock_mode); diff --git a/lustre/lmv/lmv_internal.h b/lustre/lmv/lmv_internal.h index c90d8e7..3689900 100644 --- a/lustre/lmv/lmv_internal.h +++ b/lustre/lmv/lmv_internal.h @@ -59,14 +59,14 @@ static inline void lmv_lock_obj(struct lmv_obj *obj) { LASSERT(obj); - down(&obj->guard); + down(&obj->lo_guard); } static inline void lmv_unlock_obj(struct lmv_obj *obj) { LASSERT(obj); - up(&obj->guard); + up(&obj->lo_guard); } void lmv_add_obj(struct lmv_obj *obj); diff --git a/lustre/lmv/lmv_obd.c b/lustre/lmv/lmv_obd.c index 4f192a9..3d495aa 100644 --- a/lustre/lmv/lmv_obd.c +++ b/lustre/lmv/lmv_obd.c @@ -853,7 +853,7 @@ static int lmv_getattr(struct obd_export *exp, struct lu_fid *fid, lmv_lock_obj(obj); - for (i = 0; i < obj->objcount; i++) { + for (i = 0; i < obj->lo_objcount; i++) { if (lmv->tgts[i].ltd_exp == NULL) { CWARN("%s: NULL export for %d\n", @@ -862,10 +862,10 @@ static int lmv_getattr(struct obd_export *exp, struct lu_fid *fid, } /* skip master obj. */ - if (lu_fid_eq(&obj->lo_fid, &obj->objs[i].lo_fid)) + if (lu_fid_eq(&obj->lo_fid, &obj->lo_objs[i].li_fid)) continue; - body->size += obj->objs[i].size; + body->size += obj->lo_objs[i].li_size; } lmv_unlock_obj(obj); @@ -951,8 +951,8 @@ static int lmv_change_cbdata_name(struct obd_export *exp, obj = lmv_grab_obj(obd, pid); if (obj) { /* directory is splitted. look for right mds for this name. */ - mds = raw_name2idx(obj->hashtype, obj->objcount, name, len); - rcid = obj->objs[mds].lo_fid; + mds = raw_name2idx(obj->lo_hashtype, obj->lo_objcount, name, len); + rcid = obj->lo_objs[mds].li_fid; mds = lmv_fld_lookup(obd, &rcid); lmv_put_obj(obj); } @@ -1015,10 +1015,10 @@ int lmv_get_mea_and_update_object(struct obd_export *exp, valid = OBD_MD_FLEASIZE | OBD_MD_FLDIREA | OBD_MD_MEA; - /* time to update mea of parent id */ + /* time to update mea of parent fid */ i = lmv_fld_lookup(obd, fid); - rc = md_getattr(lmv->tgts[i].ltd_exp, - id, valid, NULL, NULL, 0, mealen, NULL, &req); + rc = md_getattr(lmv->tgts[i].ltd_exp, fid, valid, NULL, + NULL, 0, mealen, NULL, &req); if (rc) { CERROR("md_getattr() failed, error %d\n", rc); GOTO(cleanup, rc); @@ -1069,9 +1069,9 @@ repeat: LASSERT(++loop <= 2); obj = lmv_grab_obj(obd, &op_data->fid1); if (obj) { - mds = raw_name2idx(obj->hashtype, obj->objcount, + mds = raw_name2idx(obj->lo_hashtype, obj->lo_objcount, op_data->name, op_data->namelen); - op_data->fid1 = obj->objs[mds].lo_fid; + op_data->fid1 = obj->lo_objs[mds].li_fid; lmv_put_obj(obj); } @@ -1260,9 +1260,9 @@ lmv_enqueue(struct obd_export *exp, int lock_type, if (obj) { /* directory is splitted. look for right mds for this * name */ - mds = raw_name2idx(obj->hashtype, obj->objcount, + mds = raw_name2idx(obj->lo_hashtype, obj->lo_objcount, (char *)data->name, data->namelen); - data->fid1 = obj->objs[mds].lo_fid; + data->fid1 = obj->lo_objs[mds].li_fid; lmv_put_obj(obj); } } @@ -1303,9 +1303,9 @@ repeat: obj = lmv_grab_obj(obd, fid); if (obj) { /* directory is splitted. look for right mds for this name */ - mds = raw_name2idx(obj->hashtype, obj->objcount, + mds = raw_name2idx(obj->lo_hashtype, obj->lo_objcount, filename, namelen - 1); - rid = obj->objs[mds].lo_fid; + rid = obj->lo_objs[mds].li_fid; lmv_put_obj(obj); } @@ -1318,11 +1318,6 @@ repeat: valid == OBD_MD_FLID ? valid : valid | OBD_MD_FID, ea_size, request); if (rc == 0) { - /* - * this could be cross-node reference. in this case all we have - * right now is lustre_id triple. we'd like to find other - * attributes. - */ body = lustre_msg_buf((*request)->rq_repmsg, 0, sizeof(*body)); LASSERT(body != NULL); LASSERT((body->valid & OBD_MD_FID) != 0 @@ -1353,7 +1348,7 @@ repeat: } /* - * llite passes id of an target inode in data->fid1 and id of directory in + * llite passes fid of an target inode in data->fid1 and id of directory in * data->fid2 */ static int lmv_link(struct obd_export *exp, struct mdc_op_data *data, @@ -1373,9 +1368,9 @@ static int lmv_link(struct obd_export *exp, struct mdc_op_data *data, /* usual link request */ obj = lmv_grab_obj(obd, &data->fid2); if (obj) { - rc = raw_name2idx(obj->hashtype, obj->objcount, + rc = raw_name2idx(obj->lo_hashtype, obj->lo_objcount, data->name, data->namelen); - data->fid2 = obj->objs[rc].lo_fid; + data->fid2 = obj->lo_objs[rc].li_fid; lmv_put_obj(obj); } @@ -1385,9 +1380,9 @@ static int lmv_link(struct obd_export *exp, struct mdc_op_data *data, PFID3(&data->fid2), data->namelen, data->name, PFID3(&data->fid1)); } else { - mds = id_group(&data->fid1); + mds = lmv_fld_lookup(obd, &data->fid1); - /* request from MDS to acquire i_links for inode by id1 */ + /* request from MDS to acquire i_links for inode by fid1 */ CDEBUG(D_OTHER, "inc i_nlinks for "DFID3"\n", PFID3(&data->fid1)); } @@ -1435,9 +1430,9 @@ static int lmv_rename(struct obd_export *exp, struct mdc_op_data *data, */ obj = lmv_grab_obj(obd, &data->fid2); if (obj) { - mds = raw_name2idx(obj->hashtype, obj->objcount, + mds = raw_name2idx(obj->lo_hashtype, obj->lo_objcount, (char *)new, newlen); - data->fid2 = obj->objs[mds].lo_fid; + data->fid2 = obj->lo_objs[mds].li_fid; CDEBUG(D_OTHER, "forward to MDS #%u ("DFID3")\n", mds, PFID3(&data->fid2)); lmv_put_obj(obj); @@ -1451,9 +1446,9 @@ static int lmv_rename(struct obd_export *exp, struct mdc_op_data *data, * directory is already splitted, so we have to forward request * to the right MDS. */ - mds = raw_name2idx(obj->hashtype, obj->objcount, + mds = raw_name2idx(obj->lo_hashtype, obj->lo_objcount, (char *)old, oldlen); - data->fid1 = obj->objs[mds].lo_fid; + data->fid1 = obj->lo_objs[mds].li_fid; CDEBUG(D_OTHER, "forward to MDS #%u ("DFID3")\n", mds, PFID3(&data->fid1)); lmv_put_obj(obj); @@ -1465,10 +1460,10 @@ static int lmv_rename(struct obd_export *exp, struct mdc_op_data *data, * directory is already splitted, so we have to forward request * to the right MDS. */ - mds = raw_name2idx(obj->hashtype, obj->objcount, + mds = raw_name2idx(obj->lo_hashtype, obj->lo_objcount, (char *)new, newlen); - data->fid2 = obj->objs[mds].lo_fid; + data->fid2 = obj->lo_objs[mds].li_fid; CDEBUG(D_OTHER, "forward to MDS #%u ("DFID3")\n", mds, PFID3(&data->fid2)); lmv_put_obj(obj); @@ -1511,15 +1506,15 @@ static int lmv_setattr(struct obd_export *exp, struct mdc_op_data *data, PFID3(&data->fid1), iattr->ia_valid, obj ? ", splitted" : ""); if (obj) { - for (i = 0; i < obj->objcount; i++) { - data->fid1 = obj->objs[i].lo_fid; + for (i = 0; i < obj->lo_objcount; i++) { + data->fid1 = obj->lo_objs[i].li_fid; mds = lmv_fld_lookup(obd, &data->fid1); rc = md_setattr(lmv->tgts[mds].ltd_exp, data, iattr, ea, ealen, ea2, ea2len, ea3, ea3len, &req); - if (lu_fid_eq(&obj->lo_fid, &obj->objs[i].lo_fid)) { + if (lu_fid_eq(&obj->lo_fid, &obj->lo_objs[i].li_fid)) { /* * this is master object and this request should * be returned back to llite. @@ -1647,12 +1642,12 @@ static int lmv_readpage(struct obd_export *exp, struct lu_fid *fid, lmv_lock_obj(obj); /* find dirobj containing page with requested offset. */ - for (i = 0; i < obj->objcount; i++) { - if (offset < obj->objs[i].size) + for (i = 0; i < obj->lo_objcount; i++) { + if (offset < obj->lo_objs[i].li_size) break; - offset -= obj->objs[i].size; + offset -= obj->lo_objs[i].li_size; } - rid = obj->objs[i].lo_fid; + rid = obj->lo_objs[i].li_fid; lmv_unlock_obj(obj); lmv_put_obj(obj); @@ -1721,7 +1716,7 @@ static int lmv_delete_inode(struct obd_export *exp, struct lu_fid *fid) LASSERT(exp && fid); if (lmv_delete_obj(exp, fid)) { CDEBUG(D_OTHER, "lmv object "DFID3" is destroyed.\n", - PFID3(id)); + PFID3(fid)); } RETURN(0); } @@ -1749,9 +1744,9 @@ static int lmv_unlink(struct obd_export *exp, struct mdc_op_data *data, obj = lmv_grab_obj(obd, &data->fid1); if (obj) { - i = raw_name2idx(obj->hashtype, obj->objcount, + i = raw_name2idx(obj->lo_hashtype, obj->lo_objcount, data->name, data->namelen); - data->fid1 = obj->objs[i].lo_fid; + data->fid1 = obj->lo_objs[i].li_fid; lmv_put_obj(obj); } CDEBUG(D_OTHER, "unlink '%*s' in "DFID3" -> %u\n", @@ -1856,7 +1851,7 @@ int lmv_obd_create(struct obd_export *exp, struct obdo *oa, LASSERT(oa->o_id != 0); LASSERT(oa->o_fid != 0); - /* save "master" object id */ + /* save "master" object fid */ obdo2id(&mid, oa); mea = (struct mea *)*ea; diff --git a/lustre/lmv/lmv_objmgr.c b/lustre/lmv/lmv_objmgr.c index 23ace7a..9be9d43 100644 --- a/lustre/lmv/lmv_objmgr.c +++ b/lustre/lmv/lmv_objmgr.c @@ -52,7 +52,7 @@ extern atomic_t obj_cache_count; static LIST_HEAD(obj_list); static spinlock_t obj_list_lock = SPIN_LOCK_UNLOCKED; -/* creates new obj on passed @id and @mea. */ +/* creates new obj on passed @fid and @mea. */ struct lmv_obj * lmv_alloc_obj(struct obd_device *obd, struct lu_fid *fid, @@ -74,29 +74,29 @@ lmv_alloc_obj(struct obd_device *obd, atomic_inc(&obj_cache_count); obj->lo_fid = *fid; - obj->obd = obd; - obj->state = 0; - obj->hashtype = mea->mea_magic; + obj->lo_obd = obd; + obj->lo_state = 0; + obj->lo_hashtype = mea->mea_magic; - init_MUTEX(&obj->guard); - atomic_set(&obj->count, 0); - obj->objcount = mea->mea_count; + init_MUTEX(&obj->lo_guard); + atomic_set(&obj->lo_count, 0); + obj->lo_objcount = mea->mea_count; obj_size = sizeof(struct lmv_inode) * lmv->desc.ld_tgt_count; - OBD_ALLOC(obj->objs, obj_size); - if (!obj->objs) + OBD_ALLOC(obj->lo_objs, obj_size); + if (!obj->lo_objs) goto err_obj; - memset(obj->objs, 0, obj_size); + memset(obj->lo_objs, 0, obj_size); /* put all ids in */ for (i = 0; i < mea->mea_count; i++) { CDEBUG(D_OTHER, "subobj "DFID3"\n", PFID3(&mea->mea_ids[i])); - obj->objs[i].id = mea->mea_ids[i]; - LASSERT(fid_num(&obj->objs[i].lo_fid)); + obj->lo_objs[i].li_fid = mea->mea_ids[i]; + LASSERT(fid_num(&obj->lo_objs[i].li_fid)); } return obj; @@ -110,15 +110,15 @@ err_obj: void lmv_free_obj(struct lmv_obj *obj) { + struct lmv_obd *lmv = &obj->lo_obd->u.lmv; unsigned int obj_size; - struct lmv_obd *lmv = &obj->obd->u.lmv; - LASSERT(!atomic_read(&obj->count)); + LASSERT(!atomic_read(&obj->lo_count)); obj_size = sizeof(struct lmv_inode) * lmv->desc.ld_tgt_count; - OBD_FREE(obj->objs, obj_size); + OBD_FREE(obj->lo_objs, obj_size); OBD_SLAB_FREE(obj, obj_cache, sizeof(*obj)); atomic_dec(&obj_cache_count); } @@ -126,8 +126,8 @@ lmv_free_obj(struct lmv_obj *obj) static void __add_obj(struct lmv_obj *obj) { - atomic_inc(&obj->count); - list_add(&obj->list, &obj_list); + atomic_inc(&obj->lo_count); + list_add(&obj->lo_list, &obj_list); } void @@ -141,7 +141,7 @@ lmv_add_obj(struct lmv_obj *obj) static void __del_obj(struct lmv_obj *obj) { - list_del(&obj->list); + list_del(&obj->lo_list); lmv_free_obj(obj); } @@ -157,7 +157,7 @@ static struct lmv_obj * __get_obj(struct lmv_obj *obj) { LASSERT(obj != NULL); - atomic_inc(&obj->count); + atomic_inc(&obj->lo_count); return obj; } @@ -175,10 +175,10 @@ __put_obj(struct lmv_obj *obj) { LASSERT(obj); - if (atomic_dec_and_test(&obj->count)) { + if (atomic_dec_and_test(&obj->lo_count)) { struct lu_fid *fid = &obj->lo_fid; CDEBUG(D_OTHER, "last reference to "DFID3" - " - "destroying\n", PFID3(id)); + "destroying\n", PFID3(fid)); __del_obj(obj); } } @@ -198,11 +198,11 @@ __grab_obj(struct obd_device *obd, struct lu_fid *fid) struct list_head *cur; list_for_each(cur, &obj_list) { - obj = list_entry(cur, struct lmv_obj, list); + obj = list_entry(cur, struct lmv_obj, lo_list); /* check if object is in progress of destroying. If so - skip * it. */ - if (obj->state & O_FREEING) + if (obj->lo_state & O_FREEING) continue; /* @@ -212,7 +212,7 @@ __grab_obj(struct obd_device *obd, struct lu_fid *fid) * and mds runs on the same host. May be it is good idea to have * objects list assosiated with obd. */ - if (obj->obd != obd) + if (obj->lo_obd != obd) continue; /* check if this is what we're looking for. */ @@ -236,7 +236,7 @@ lmv_grab_obj(struct obd_device *obd, struct lu_fid *fid) RETURN(obj); } -/* looks in objects list for an object that matches passed @id. If it is not +/* looks in objects list for an object that matches passed @fid. If it is not * found -- creates it using passed @mea and puts onto list. */ static struct lmv_obj * __create_obj(struct obd_device *obd, struct lu_fid *fid, struct mea *mea) @@ -244,19 +244,19 @@ __create_obj(struct obd_device *obd, struct lu_fid *fid, struct mea *mea) struct lmv_obj *new, *obj; ENTRY; - obj = lmv_grab_obj(obd, id); + obj = lmv_grab_obj(obd, fid); if (obj) RETURN(obj); /* no such object yet, allocate and initialize it. */ - new = lmv_alloc_obj(obd, id, mea); + new = lmv_alloc_obj(obd, fid, mea); if (!new) RETURN(NULL); /* check if someone create it already while we were dealing with * allocating @obj. */ spin_lock(&obj_list_lock); - obj = __grab_obj(obd, id); + obj = __grab_obj(obd, fid); if (obj) { /* someone created it already - put @obj and getting out. */ lmv_free_obj(new); @@ -270,13 +270,13 @@ __create_obj(struct obd_device *obd, struct lu_fid *fid, struct mea *mea) spin_unlock(&obj_list_lock); CDEBUG(D_OTHER, "new obj in lmv cache: "DFID3"\n", - PFID3(id)); + PFID3(fid)); RETURN(new); } -/* creates object from passed @id and @mea. If @mea is NULL, it will be +/* creates object from passed @fid and @mea. If @mea is NULL, it will be * obtained from correct MDT and used for constructing the object. */ struct lmv_obj * lmv_create_obj(struct obd_export *exp, struct lu_fid *fid, struct mea *mea) @@ -290,7 +290,7 @@ lmv_create_obj(struct obd_export *exp, struct lu_fid *fid, struct mea *mea) ENTRY; CDEBUG(D_OTHER, "get mea for "DFID3" and create lmv obj\n", - PFID3(id)); + PFID3(fid)); md.mea = NULL; @@ -300,7 +300,7 @@ lmv_create_obj(struct obd_export *exp, struct lu_fid *fid, struct mea *mea) CDEBUG(D_OTHER, "mea isn't passed in, get it now\n"); mealen = MEA_SIZE_LMV(lmv); - /* time to update mea of parent id */ + /* time to update mea of parent fid */ md.mea = NULL; valid = OBD_MD_FLEASIZE | OBD_MD_FLDIREA | OBD_MD_MEA; @@ -326,10 +326,10 @@ lmv_create_obj(struct obd_export *exp, struct lu_fid *fid, struct mea *mea) } /* got mea, now create obj for it. */ - obj = __create_obj(obd, id, mea); + obj = __create_obj(obd, fid, mea); if (!obj) { CERROR("Can't create new object "DFID3"\n", - PFID3(id)); + PFID3(fid)); GOTO(cleanup, obj = ERR_PTR(-ENOMEM)); } @@ -344,7 +344,7 @@ cleanup: } /* - * looks for object with @id and orders to destroy it. It is possible the object + * looks for object with @fid and orders to destroy it. It is possible the object * will not be destroyed right now, because it is still using by someone. In * this case it will be marked as "freeing" and will not be accessible anymore * for subsequent callers of lmv_grab_obj(). @@ -358,9 +358,9 @@ lmv_delete_obj(struct obd_export *exp, struct lu_fid *fid) ENTRY; spin_lock(&obj_list_lock); - obj = __grab_obj(obd, id); + obj = __grab_obj(obd, fid); if (obj) { - obj->state |= O_FREEING; + obj->lo_state |= O_FREEING; __put_obj(obj); __put_obj(obj); rc = 1; @@ -394,15 +394,15 @@ lmv_cleanup_mgr(struct obd_device *obd) spin_lock(&obj_list_lock); list_for_each_safe(cur, tmp, &obj_list) { - obj = list_entry(cur, struct lmv_obj, list); + obj = list_entry(cur, struct lmv_obj, lo_list); - if (obj->obd != obd) + if (obj->lo_obd != obd) continue; - obj->state |= O_FREEING; - if (atomic_read(&obj->count) > 1) { + obj->lo_state |= O_FREEING; + if (atomic_read(&obj->lo_count) > 1) { CERROR("obj "DFID3" has count > 1 (%d)\n", - PFID3(&obj->lo_fid), atomic_read(&obj->count)); + PFID3(&obj->lo_fid), atomic_read(&obj->lo_count)); } __put_obj(obj); }