* GPL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
/*
RETURN(rc);
}
-/*
- * XXX: this is for create lsm object id, which should identify the lsm object
- * unique in the whole mds, as I see. But it seems, we still not need it
- * now. Right? So just borrow the cl_fid_build_ino().
- */
-static obd_id mdd_lov_create_id(const struct lu_fid *fid)
-{
- return fid_flatten(fid);
-}
-
int mdd_lov_objid_prepare(struct mdd_device *mdd, struct lov_mds_md *lmm)
{
/* copy mds_lov code is using wrong layer */
oa->o_uid = 0; /* must have 0 uid / gid on OST */
oa->o_gid = 0;
- oa->o_gr = mdt_to_obd_objgrp(lu_site2md(site)->ms_node_id);
+ oa->o_seq = mdt_to_obd_objseq(lu_site2md(site)->ms_node_id);
oa->o_mode = S_IFREG | 0600;
- oa->o_id = mdd_lov_create_id(mdd_object_fid(child));
+ oa->o_id = fid_ver_oid(mdd_object_fid(child));
oa->o_valid = OBD_MD_FLID | OBD_MD_FLTYPE | OBD_MD_FLFLAGS |
OBD_MD_FLMODE | OBD_MD_FLUID | OBD_MD_FLGID | OBD_MD_FLGROUP;
oa->o_size = 0;
0, &lsm, (void*)eadata);
if (rc)
GOTO(out_oti, rc);
- lsm->lsm_object_id = oa->o_id;
- lsm->lsm_object_gr = oa->o_gr;
} else if (parent != NULL) {
/* get lov ea from parent and set to lov */
struct lov_mds_md *_lmm;
}
GOTO(out_oti, rc);
}
- LASSERT_MDS_GROUP(lsm->lsm_object_gr);
+ LASSERT_SEQ_IS_MDT(lsm->lsm_object_seq);
} else {
LASSERT(eadata != NULL);
rc = obd_iocontrol(OBD_IOC_LOV_SETEA, lov_exp, 0, &lsm,
(void*)eadata);
if (rc)
GOTO(out_oti, rc);
- lsm->lsm_object_id = oa->o_id;
- lsm->lsm_object_gr = oa->o_gr;
+
}
+ lsm->lsm_object_id = fid_ver_oid(mdd_object_fid(child));
+ lsm->lsm_object_seq = fid_seq(mdd_object_fid(child));
/*
* Sometimes, we may truncate some object(without lsm) then open it
* (with write flags), so creating lsm above. The Nonzero(truncated)
* filter_fid, but can not see what is the usages. So just pack
* o_seq o_ver here, maybe fix it after this cycle.
*/
- oa->o_fid = fid_seq(mdd_object_fid(child));
- oa->o_generation = fid_oid(mdd_object_fid(child));
- oa->o_valid |= OBD_MD_FLFID | OBD_MD_FLGENER;
+ obdo_from_inode(oa, NULL,
+ (struct lu_fid *)mdd_object_fid(child), 0);
oinfo->oi_oa = oa;
oinfo->oi_md = lsm;
oinfo->oi_capa = NULL;
GOTO(out_oti, rc);
}
}
-
/* blksize should be changed after create data object */
la->la_valid |= LA_BLKSIZE;
la->la_blksize = oa->o_blksize;
}
oa->o_id = lsm->lsm_object_id;
- oa->o_gr = mdt_to_obd_objgrp(lu_site2md(site)->ms_node_id);
+ oa->o_seq = mdt_to_obd_objseq(lu_site2md(site)->ms_node_id);
oa->o_mode = la->la_mode & S_IFMT;
oa->o_valid = OBD_MD_FLID | OBD_MD_FLTYPE | OBD_MD_FLGROUP;
oti->oti_logcookies = logcookies;
}
- CDEBUG(D_INFO, "destroying OSS object %d/%d\n",
- (int)oa->o_id, (int)oa->o_gr);
+ CDEBUG(D_INFO, "destroying OSS object "LPU64":"LPU64"\n", oa->o_seq,
+ oa->o_id);
rc = obd_destroy(lov_exp, oa, lsm, oti, NULL, NULL);
static int mdd_osc_setattr_async(struct obd_device *obd, __u32 uid, __u32 gid,
struct lov_mds_md *lmm, int lmm_size,
- struct llog_cookie *logcookies, __u64 id, __u32 gen,
+ struct llog_cookie *logcookies, const struct lu_fid *parent,
struct obd_capa *oc)
{
struct mds_obd *mds = &obd->u.mds;
rc = obd_unpackmd(mds->mds_lov_exp, &oinfo.oi_md, lmm, lmm_size);
if (rc < 0) {
- CERROR("Error unpack md %p for inode "LPU64"\n", lmm, id);
+ CERROR("Error unpack md %p for obj "DFID"\n", lmm,
+ PFID(parent));
GOTO(out, rc);
}
oinfo.oi_oa->o_uid = uid;
oinfo.oi_oa->o_gid = gid;
oinfo.oi_oa->o_id = oinfo.oi_md->lsm_object_id;
- oinfo.oi_oa->o_gr = oinfo.oi_md->lsm_object_gr;
+ oinfo.oi_oa->o_seq = oinfo.oi_md->lsm_object_seq;
oinfo.oi_oa->o_valid |= OBD_MD_FLID | OBD_MD_FLGROUP |
OBD_MD_FLUID | OBD_MD_FLGID;
if (logcookies) {
oti.oti_logcookies = logcookies;
}
- oinfo.oi_oa->o_fid = id;
- oinfo.oi_oa->o_generation = gen;
- oinfo.oi_oa->o_valid |= OBD_MD_FLFID | OBD_MD_FLGENER;
+ obdo_from_inode(oinfo.oi_oa, NULL, (struct lu_fid *)parent, 0);
oinfo.oi_capa = oc;
/* do async setattr from mds to ost not waiting for responses. */
RETURN(rc);
rc = mdd_osc_setattr_async(obd, tmp_la->la_uid, tmp_la->la_gid, lmm,
- lmm_size, logcookies, fid_seq(fid),
- fid_oid(fid), NULL);
+ lmm_size, logcookies, fid, NULL);
RETURN(rc);
}