const struct lu_attr *pattr, const struct lu_name *lname,
struct lu_fid* fid, int mask)
{
- const char *name = lname->ln_name;
- const struct dt_key *key = (const struct dt_key *)name;
- struct mdd_object *mdd_obj = md2mdd_obj(pobj);
- struct mdd_device *m = mdo2mdd(pobj);
- struct dt_object *dir = mdd_object_child(mdd_obj);
- int rc;
+ const char *name = lname->ln_name;
+ const struct dt_key *key = (const struct dt_key *)name;
+ struct mdd_object *mdd_obj = md2mdd_obj(pobj);
+ struct dt_object *dir = mdd_object_child(mdd_obj);
+ int rc;
+
ENTRY;
if (unlikely(mdd_is_dead_obj(mdd_obj)))
RETURN(-ESTALE);
if (mdd_object_remote(mdd_obj)) {
- CDEBUG(D_INFO, "%s: Object "DFID" locates on remote server\n",
- mdd2obd_dev(m)->obd_name, PFID(mdo2fid(mdd_obj)));
+ CDEBUG(D_INFO, "%s: Object "DFID" located on remote server\n",
+ mdd_obj_dev_name(mdd_obj),
+ PFID(mdd_object_fid(mdd_obj)));
}
rc = mdd_permission_internal_locked(env, mdd_obj, pattr, mask,
struct lu_fid *pfid;
int rc;
- LASSERT(!lu_fid_eq(mdo2fid(mo), tfid));
+ LASSERT(!lu_fid_eq(mdd_object_fid(mo), tfid));
pfid = &mdd_env_info(env)->mti_fid;
- if (mdd_is_root(mdd, mdo2fid(mo)))
+ if (mdd_is_root(mdd, mdd_object_fid(mo)))
return 0;
if (mdd_is_root(mdd, tfid))
/* additional check the rename case */
if (cattr) {
if (S_ISDIR(cattr->la_mode)) {
- struct mdd_device *mdd = mdo2mdd(&tobj->mod_obj);
-
if (!S_ISDIR(tattr->la_mode))
RETURN(-ENOTDIR);
- if (lu_fid_eq(mdo2fid(tobj), &mdd->mdd_root_fid))
+ if (mdd_is_root(mdo2mdd(&tobj->mod_obj),
+ mdd_object_fid(tobj)))
RETURN(-EBUSY);
} else if (S_ISDIR(tattr->la_mode))
RETURN(-EISDIR);
mdd_changelog_rec_ext_jobid(&rec->cr, uc->uc_jobid);
if (likely(target != NULL)) {
- rec->cr.cr_tfid = *mdo2fid(target);
+ rec->cr.cr_tfid = *mdd_object_fid(target);
target->mod_cltime = ktime_get();
} else {
fid_zero(&rec->cr.cr_tfid);
struct lu_attr *la,
struct linkea_data *data)
{
- struct lu_fid tfid = *mdo2fid(c);
+ struct lu_fid tfid = *mdd_object_fid(c);
int rc;
if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_DANGLING3))
/* Note: even this function will change ldata, but it comes from
* thread_info, which is completely temporary and only seen in
* this function, so we do not need reset ldata once it fails.*/
- rc = mdd_linkea_prepare(env, mdd_sobj, NULL, NULL, mdo2fid(mdd_tobj),
- lname, 0, 0, ldata);
+ rc = mdd_linkea_prepare(env, mdd_sobj, NULL, NULL,
+ mdd_object_fid(mdd_tobj), lname, 0, 0, ldata);
if (rc != 0)
GOTO(stop, rc);
GOTO(out_unlock, rc);
}
- *tfid = *mdo2fid(mdd_sobj);
+ *tfid = *mdd_object_fid(mdd_sobj);
if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_DANGLING3))
tfid->f_oid = cfs_fail_val;
if (rc == 0)
/* Note: The failure of links_add should not cause the
* link failure, so do not check return value. */
- mdd_links_add(env, mdd_sobj, mdo2fid(mdd_tobj),
+ mdd_links_add(env, mdd_sobj, mdd_object_fid(mdd_tobj),
lname, handle, ldata, 0);
EXIT;
mdd_write_unlock(env, mdd_sobj);
if (rc == 0)
rc = mdd_changelog_ns_store(env, mdd, CL_HARDLINK, 0, mdd_sobj,
- mdo2fid(mdd_tobj), NULL, NULL,
- lname, NULL, handle);
+ mdd_object_fid(mdd_tobj), NULL,
+ NULL, lname, NULL, handle);
stop:
rc = mdd_trans_stop(env, mdd, rc, handle);
if (is_vmalloc_addr(ldata->ld_buf))
/* caller should take a lock before calling */
int mdd_finish_unlink(const struct lu_env *env,
struct mdd_object *obj, struct md_attr *ma,
- const struct mdd_object *pobj,
+ struct mdd_object *pobj,
const struct lu_name *lname,
struct thandle *th)
{
}
} else if (!is_dir) {
/* old files may not have link ea; ignore errors */
- mdd_links_del(env, obj, mdo2fid(pobj), lname, th);
+ mdd_links_del(env, obj, mdd_object_fid(pobj), lname, th);
}
RETURN(rc);
rc = mdo_ref_del(env, mdd_cobj, handle);
if (rc != 0) {
__mdd_index_insert_only(env, mdd_pobj,
- mdo2fid(mdd_cobj),
+ mdd_object_fid(mdd_cobj),
mdd_object_type(mdd_cobj),
name, handle);
GOTO(cleanup, rc);
rc = mdd_changelog_ns_store(env, mdd,
is_dir ? CL_RMDIR : CL_UNLINK, cl_flags,
- mdd_cobj, mdo2fid(mdd_pobj), NULL, NULL, lname, NULL,
- handle);
+ mdd_cobj, mdd_object_fid(mdd_pobj), NULL, NULL,
+ lname, NULL, handle);
}
stop:
if (!S_ISDIR(attr->la_mode))
RETURN(0);
- rc = mdo_declare_index_insert(env, child, mdo2fid(child), S_IFDIR,
- dot, handle);
+ rc = mdo_declare_index_insert(env, child, mdd_object_fid(child),
+ S_IFDIR, dot, handle);
if (rc != 0)
RETURN(rc);
if (rc != 0)
RETURN(rc);
- rc = mdo_declare_index_insert(env, child, mdo2fid(parent), S_IFDIR,
- dotdot, handle);
+ rc = mdo_declare_index_insert(env, child, mdd_object_fid(parent),
+ S_IFDIR, dotdot, handle);
RETURN(rc);
}
ENTRY;
if (S_ISDIR(attr->la_mode)) {
- /* Add "." and ".." for newly created dir */
- mdo_ref_add(env, child, handle);
- rc = __mdd_index_insert_only(env, child, mdo2fid(child),
+ /* Add "." and ".." for newly created dir */
+ mdo_ref_add(env, child, handle);
+ rc = __mdd_index_insert_only(env, child, mdd_object_fid(child),
S_IFDIR, dot, handle);
if (rc == 0)
rc = __mdd_index_insert_only(env, child, pfid, S_IFDIR,
struct lu_attr *la = &mdd_env_info(env)->mti_la_for_fix;
enum changelog_rec_type type;
- rc = mdo_declare_index_insert(env, p, mdo2fid(c), attr->la_mode,
- name->ln_name, handle);
+ rc = mdo_declare_index_insert(env, p, mdd_object_fid(c),
+ attr->la_mode, name->ln_name,
+ handle);
if (rc != 0)
return rc;
* created in declare phase, they also needs to be added to master
* object as sub-directory entry. So it has to initialize the master
* object, then set dir striped EA.(in mdo_xattr_set) */
- rc = mdd_object_initialize(env, mdo2fid(pobj), son, attr, handle);
+ rc = mdd_object_initialize(env, mdd_object_fid(pobj), son, attr,
+ handle);
if (rc != 0)
GOTO(err_destroy, rc);
rc = mdd_orphan_insert(env, son, handle);
GOTO(out_volatile, rc);
} else {
- rc = __mdd_index_insert(env, mdd_pobj, mdo2fid(son),
- attr->la_mode, name, handle);
+ rc = __mdd_index_insert(env, mdd_pobj, mdd_object_fid(son),
+ attr->la_mode, name, handle);
if (rc != 0)
GOTO(err_created, rc);
- mdd_links_add(env, son, mdo2fid(mdd_pobj), lname, handle,
- ldata, 1);
+ mdd_links_add(env, son, mdd_object_fid(mdd_pobj), lname,
+ handle, ldata, 1);
/* update parent directory mtime/ctime */
*la = *attr;
mdd_write_unlock(env, son);
}
- if (rc == 0 && fid_is_namespace_visible(mdo2fid(son)) &&
+ if (rc == 0 && fid_is_namespace_visible(mdd_object_fid(son)) &&
likely((spec->sp_cr_flags & MDS_OPEN_VOLATILE) == 0))
rc = mdd_changelog_ns_store(env, mdd,
S_ISDIR(attr->la_mode) ? CL_MKDIR :
S_ISREG(attr->la_mode) ? CL_CREATE :
S_ISLNK(attr->la_mode) ? CL_SOFTLINK : CL_MKNOD,
- 0, son, mdo2fid(mdd_pobj), NULL, NULL, lname,
- NULL, handle);
+ 0, son, mdd_object_fid(mdd_pobj), NULL, NULL,
+ lname, NULL, handle);
out_stop:
rc2 = mdd_trans_stop(env, mdd, rc, handle);
if (rc == 0) {
};
static int mdd_rename_order(const struct lu_env *env,
- struct mdd_device *mdd,
- struct mdd_object *src_pobj,
+ struct mdd_device *mdd,
+ struct mdd_object *src_pobj,
const struct lu_attr *pattr,
- struct mdd_object *tgt_pobj)
+ struct mdd_object *tgt_pobj)
{
- /* order of locking, 1 - tgt-src, 0 - src-tgt*/
- int rc;
- ENTRY;
-
- if (src_pobj == tgt_pobj)
- RETURN(MDD_RN_SAME);
+ /* order of locking, 1 - tgt-src, 0 - src-tgt*/
+ int rc;
- /* compared the parent child relationship of src_p&tgt_p */
- if (lu_fid_eq(&mdd->mdd_root_fid, mdo2fid(src_pobj))){
- rc = MDD_RN_SRCTGT;
- } else if (lu_fid_eq(&mdd->mdd_root_fid, mdo2fid(tgt_pobj))) {
- rc = MDD_RN_TGTSRC;
- } else {
+ ENTRY;
+ if (src_pobj == tgt_pobj)
+ RETURN(MDD_RN_SAME);
+
+ /* compared the parent child relationship of src_p & tgt_p */
+ if (lu_fid_eq(&mdd->mdd_root_fid, mdd_object_fid(src_pobj))) {
+ rc = MDD_RN_SRCTGT;
+ } else if (lu_fid_eq(&mdd->mdd_root_fid, mdd_object_fid(tgt_pobj))) {
+ rc = MDD_RN_TGTSRC;
+ } else {
rc = mdd_is_parent(env, mdd, src_pobj, pattr,
- mdo2fid(tgt_pobj));
- if (rc == -EREMOTE)
- rc = 0;
-
- if (rc == 1)
- rc = MDD_RN_TGTSRC;
- else if (rc == 0)
- rc = MDD_RN_SRCTGT;
- }
+ mdd_object_fid(tgt_pobj));
+ if (rc == -EREMOTE)
+ rc = 0;
- RETURN(rc);
+ if (rc == 1)
+ rc = MDD_RN_TGTSRC;
+ else if (rc == 0)
+ rc = MDD_RN_SRCTGT;
+ }
+
+ RETURN(rc);
}
/* has not mdd_write{read}_lock on any obj yet. */
struct linkea_data *ldata,
struct thandle *handle)
{
- struct lu_attr *la = &mdd_env_info(env)->mti_la_for_fix;
+ struct lu_attr *la = &mdd_env_info(env)->mti_la_for_fix;
int rc;
LASSERT(ma->ma_attr.la_valid & LA_CTIME);
la->la_ctime = la->la_mtime = ma->ma_attr.la_ctime;
- LASSERT(mdd_spobj);
- LASSERT(mdd_tpobj);
- LASSERT(mdd_sobj);
+ LASSERT(mdd_spobj);
+ LASSERT(mdd_tpobj);
+ LASSERT(mdd_sobj);
- /* name from source dir */
- rc = mdo_declare_index_delete(env, mdd_spobj, sname->ln_name, handle);
- if (rc)
- return rc;
+ /* name from source dir */
+ rc = mdo_declare_index_delete(env, mdd_spobj, sname->ln_name, handle);
+ if (rc)
+ return rc;
- /* .. from source child */
- if (S_ISDIR(mdd_object_type(mdd_sobj))) {
- /* source child can be directory,
- * counted by source dir's nlink */
- rc = mdo_declare_ref_del(env, mdd_spobj, handle);
- if (rc)
- return rc;
+ /* .. from source child */
+ if (S_ISDIR(mdd_object_type(mdd_sobj))) {
+ /* source child can be directory, count by source dir's nlink */
+ rc = mdo_declare_ref_del(env, mdd_spobj, handle);
+ if (rc)
+ return rc;
if (mdd_spobj != mdd_tpobj) {
rc = mdo_declare_index_delete(env, mdd_sobj, dotdot,
handle);
return rc;
rc = mdo_declare_index_insert(env, mdd_sobj,
- mdo2fid(mdd_tpobj),
+ mdd_object_fid(mdd_tpobj),
S_IFDIR, dotdot, handle);
if (rc != 0)
return rc;
return rc;
/* new name */
- rc = mdo_declare_index_insert(env, mdd_tpobj, mdo2fid(mdd_sobj),
+ rc = mdo_declare_index_insert(env, mdd_tpobj, mdd_object_fid(mdd_sobj),
mdd_object_type(mdd_sobj),
tname->ln_name, handle);
if (rc != 0)
struct lu_attr *tpattr = MDD_ENV_VAR(env, tpattr);
struct thandle *handle;
struct linkea_data *ldata = &mdd_env_info(env)->mti_link_data;
- const struct lu_fid *tpobj_fid = mdo2fid(mdd_tpobj);
- const struct lu_fid *spobj_fid = mdo2fid(mdd_spobj);
+ const struct lu_fid *tpobj_fid = mdd_object_fid(mdd_tpobj);
+ const struct lu_fid *spobj_fid = mdd_object_fid(mdd_spobj);
bool is_dir;
bool tobj_ref = 0;
bool tobj_locked = 0;
/* Update the linkEA for the source object */
mdd_write_lock(env, mdd_sobj, DT_SRC_CHILD);
- rc = mdd_links_rename(env, mdd_sobj, mdo2fid(mdd_spobj), lsname,
- mdo2fid(mdd_tpobj), ltname, handle, ldata,
- 0, 0);
+ rc = mdd_links_rename(env, mdd_sobj, mdd_object_fid(mdd_spobj),
+ lsname, mdd_object_fid(mdd_tpobj), ltname,
+ handle, ldata, 0, 0);
if (rc == -ENOENT)
/* Old files might not have EA entry */
- mdd_links_add(env, mdd_sobj, mdo2fid(mdd_spobj),
+ mdd_links_add(env, mdd_sobj, mdd_object_fid(mdd_spobj),
lsname, handle, NULL, 0);
mdd_write_unlock(env, mdd_sobj);
/* We don't fail the transaction if the link ea can't be
}
rc2 = __mdd_index_insert(env, mdd_tpobj,
- mdo2fid(mdd_tobj),
- mdd_object_type(mdd_tobj),
- tname, handle);
+ mdd_object_fid(mdd_tobj),
+ mdd_object_type(mdd_tobj),
+ tname, handle);
if (rc2 != 0)
CWARN("tp obj fix error: rc = %d\n", rc2);
}
mdd_read_lock(env, sobj, DT_SRC_CHILD);
if (sobj->mod_count > 0) {
CDEBUG(D_INFO, "%s: "DFID" is opened, count %d\n",
- mdd2obd_dev(mdd)->obd_name, PFID(mdo2fid(sobj)),
+ mdd_obj_dev_name(sobj),
+ PFID(mdd_object_fid(sobj)),
sobj->mod_count);
mdd_read_unlock(env, sobj);
RETURN(-EBUSY);
rc = mdo_declare_index_delete(env, pobj, lname->ln_name, handle);
if (!rc)
- rc = mdo_declare_index_insert(env, pobj, mdo2fid(tobj),
+ rc = mdo_declare_index_insert(env, pobj, mdd_object_fid(tobj),
mdd_object_type(sobj),
lname->ln_name, handle);
mdd_object_put(env, pobj);
RETURN(0);
CDEBUG(D_INFO, "update "DFID"/"DNAME":"DFID"\n",
- PFID(fid), PNAME(lname), PFID(mdo2fid(tobj)));
+ PFID(fid), PNAME(lname), PFID(mdd_object_fid(tobj)));
pobj = mdd_object_find(env, mdd, fid);
if (IS_ERR(pobj)) {
mdd_write_lock(env, pobj, DT_TGT_PARENT);
rc = __mdd_index_delete_only(env, pobj, lname->ln_name, handle);
if (!rc)
- rc = __mdd_index_insert_only(env, pobj, mdo2fid(tobj),
+ rc = __mdd_index_insert_only(env, pobj, mdd_object_fid(tobj),
mdd_object_type(sobj),
lname->ln_name, handle);
mdd_write_unlock(env, pobj);
ENTRY;
memset(ldata, 0, sizeof(*ldata));
- rc = mdd_linkea_prepare(env, sobj, mdo2fid(spobj), lname,
- mdo2fid(tpobj), lname, 1, 0, ldata);
+ rc = mdd_linkea_prepare(env, sobj, mdd_object_fid(spobj), lname,
+ mdd_object_fid(tpobj), lname, 1, 0, ldata);
if (rc)
RETURN(rc);
if (unlikely(ldata->ld_leh->leh_overflow_time))
RETURN(-EOVERFLOW);
- rc = mdd_fld_lookup(env, mdd, mdo2fid(sobj), &source_mdt_index);
+ rc = mdd_fld_lookup(env, mdd, mdd_object_fid(sobj), &source_mdt_index);
if (rc)
RETURN(rc);
- rc = mdd_iterate_linkea(env, sobj, NULL, lname, mdo2fid(tpobj), ldata,
- &source_mdt_index, NULL,
+ rc = mdd_iterate_linkea(env, sobj, NULL, lname, mdd_object_fid(tpobj),
+ ldata, &source_mdt_index, NULL,
mdd_is_link_on_source_mdt);
RETURN(rc);
}
memset(lmv, 0, sizeof(*lmv));
lmv->lmv_magic = cpu_to_le32(LMV_MAGIC_V1);
lmv->lmv_stripe_count = cpu_to_le32(1);
- fid_le_to_cpu(&lmv->lmv_stripe_fids[0], mdo2fid(sobj));
+ fid_le_to_cpu(&lmv->lmv_stripe_fids[0],
+ mdd_object_fid(sobj));
sbuf->lb_buf = lmv;
sbuf->lb_len = lmv_mds_md_size(1, LMV_MAGIC_V1);
handle->th_complex = 1;
/* target may be remote, update PFID via sobj. */
- fid_buf.lb_buf = (void *)mdo2fid(tobj);
+ fid_buf.lb_buf = (void *)mdd_object_fid(tobj);
fid_buf.lb_len = sizeof(struct lu_fid);
rc = mdo_declare_xattr_set(env, sobj, &fid_buf, XATTR_NAME_FID,
0, handle);
}
if (!S_ISDIR(attr->la_mode)) {
- rc = mdd_iterate_linkea(env, sobj, tobj, lname, mdo2fid(tpobj),
- ldata, NULL, handle,
- mdd_declare_update_link);
+ rc = mdd_iterate_linkea(env, sobj, tobj, lname,
+ mdd_object_fid(tpobj), ldata, NULL,
+ handle, mdd_declare_update_link);
if (rc)
return rc;
struct lu_buf fid_buf;
/* target may be remote, update PFID via sobj. */
- fid_buf.lb_buf = (void *)mdo2fid(tobj);
+ fid_buf.lb_buf = (void *)mdd_object_fid(tobj);
fid_buf.lb_len = sizeof(struct lu_fid);
rc = mdo_xattr_set(env, sobj, &fid_buf, XATTR_NAME_FID, 0,
handle);
}
if (!S_ISDIR(attr->la_mode))
- rc = mdd_iterate_linkea(env, sobj, tobj, lname, mdo2fid(tpobj),
- ldata, NULL, handle, mdd_update_link);
+ rc = mdd_iterate_linkea(env, sobj, tobj, lname,
+ mdd_object_fid(tpobj), ldata,
+ NULL, handle, mdd_update_link);
RETURN(rc);
}
struct thandle *handle)
{
struct mdd_thread_info *info = mdd_env_info(env);
- const struct lu_fid *fid = mdo2fid(do_create ? tobj : sobj);
+ const struct lu_fid *fid = mdd_object_fid(do_create ? tobj : sobj);
struct lu_attr *la = &info->mti_la_for_fix;
int rc;
struct thandle *handle)
{
struct mdd_thread_info *info = mdd_env_info(env);
- const struct lu_fid *fid = mdo2fid(do_create ? tobj : sobj);
+ const struct lu_fid *fid = mdd_object_fid(do_create ? tobj : sobj);
struct lu_attr *la = &info->mti_la_for_fix;
int rc;
ENTRY;
CDEBUG(D_INFO, "update %s "DFID"/"DFID" to "DFID"/"DFID"\n",
- lname->ln_name, PFID(mdo2fid(spobj)),
- PFID(mdo2fid(sobj)), PFID(mdo2fid(tpobj)),
+ lname->ln_name, PFID(mdd_object_fid(spobj)),
+ PFID(mdd_object_fid(sobj)), PFID(mdd_object_fid(tpobj)),
PFID(fid));
rc = __mdd_index_delete(env, spobj, lname->ln_name,
if (rc <= 0) {
rc = rc ?: -EFAULT;
CERROR("%s: "DFID" readlink failed: rc = %d\n",
- mdd2obd_dev(mdd)->obd_name,
- PFID(mdo2fid(sobj)), rc);
+ mdd_obj_dev_name(sobj),
+ PFID(mdd_object_fid(sobj)), rc);
GOTO(out, rc);
}
spec->u.sp_symname = sbuf.lb_buf;
GOTO(stop_trans, rc);
rc = mdd_changelog_ns_store(env, mdd, CL_MIGRATE, 0, tobj,
- mdo2fid(spobj), mdo2fid(sobj),
- mdo2fid(tpobj), lname, lname, handle);
+ mdd_object_fid(spobj), mdd_object_fid(sobj),
+ mdd_object_fid(tpobj), lname, lname,
+ handle);
if (rc)
GOTO(stop_trans, rc);
return mdo_declare_xattr_set(env, obj, lmv_buf,
XATTR_NAME_LMV".set", 0, handle);
- rc = mdo_declare_index_insert(env, stripe, mdo2fid(pobj), S_IFDIR,
- dotdot, handle);
+ rc = mdo_declare_index_insert(env, stripe, mdd_object_fid(pobj),
+ S_IFDIR, dotdot, handle);
if (rc)
return rc;
if (rc)
return rc;
- rc = mdo_declare_index_insert(env, pobj, mdo2fid(stripe), attr->la_mode,
- lname->ln_name, handle);
+ rc = mdo_declare_index_insert(env, pobj, mdd_object_fid(stripe),
+ attr->la_mode, lname->ln_name, handle);
if (rc)
return rc;
mdd_write_lock(env, obj, DT_SRC_CHILD);
/* insert dotdot to stripe which points to parent */
- rc = __mdd_index_insert_only(env, stripe, mdo2fid(pobj), S_IFDIR,
- dotdot, handle);
+ rc = __mdd_index_insert_only(env, stripe, mdd_object_fid(pobj),
+ S_IFDIR, dotdot, handle);
if (rc)
GOTO(out, rc);
GOTO(out, rc);
/* insert stripe to parent with dir name */
- rc = __mdd_index_insert_only(env, pobj, mdo2fid(stripe), attr->la_mode,
- lname->ln_name, handle);
+ rc = __mdd_index_insert_only(env, pobj, mdd_object_fid(stripe),
+ attr->la_mode, lname->ln_name, handle);
if (rc)
GOTO(out, rc);
struct thandle *handle;
int rc2;
- LASSERT(mdo2fid(mdd_obj) != NULL);
+ LASSERT(mdd_object_fid(mdd_obj) != NULL);
handle = mdd_trans_create(env, mdd);
if (IS_ERR(handle))
GOTO(stop, rc2);
rc2 = mdd_changelog_data_store_by_fid(env, mdd, CL_GETXATTR, 0,
- mdo2fid(mdd_obj), name,
- handle);
+ mdd_object_fid(mdd_obj),
+ name, handle);
stop:
rc2 = mdd_trans_stop(env, mdd, rc2, handle);
}
rc = mdd_changelog_data_store_by_fid(env, mdd, type, clf_flags,
- mdo2fid(mdd_obj), NULL, handle);
+ mdd_object_fid(mdd_obj),
+ NULL, handle);
if (rc == 0)
mdd_obj->mod_cltime = ktime_get();
}
rc = mdd_changelog_data_store_by_fid(env, mdd, type, clf_flags,
- mdo2fid(mdd_obj), xattr_name,
- handle);
+ mdd_object_fid(mdd_obj),
+ xattr_name, handle);
if (rc == 0)
mdd_obj->mod_cltime = ktime_get();
/* no need to setattr anymore */
if (la_copy->la_valid == 0) {
CDEBUG(D_INODE,
- "%s: no valid attribute on "DFID", previous valid is %#llx\n",
- mdd2obd_dev(mdd)->obd_name,
- PFID(mdo2fid(mdd_obj)), la->la_valid);
+ "%s: no valid attribute on "DFID", previous was %#llx\n",
+ mdd_obj_dev_name(mdd_obj),
+ PFID(mdd_object_fid(mdd_obj)), la->la_valid);
RETURN(0);
}
int rc;
ENTRY;
- rc = lu_fid_cmp(mdo2fid(obj), mdo2fid(vic));
+ rc = lu_fid_cmp(mdd_object_fid(obj), mdd_object_fid(vic));
if (rc == 0) /* same fid */
RETURN(-EPERM);
int rc2 = mdo_xattr_set(env, obj, buf, XATTR_NAME_LOV,
LU_XATTR_REPLACE, handle);
if (rc2)
- CERROR("%s: failed to rollback of layout of: "DFID
- ": %d, file state unknown\n",
- mdd_obj_dev_name(obj), PFID(mdo2fid(obj)), rc2);
+ CERROR("%s: failed rollback of "DFID" layout: file state unknown: rc = %d\n",
+ mdd_obj_dev_name(obj),
+ PFID(mdd_object_fid(obj)), rc2);
}
out:
ENTRY;
- rc = lu_fid_cmp(mdo2fid(obj), mdo2fid(vic));
+ rc = lu_fid_cmp(mdd_object_fid(obj), mdd_object_fid(vic));
if (rc == 0) /* same fid */
RETURN(-EPERM);
int rc2 = mdo_xattr_set(env, obj, buf_save, XATTR_NAME_LOV,
LU_XATTR_REPLACE, handle);
if (rc2)
- CERROR("%s: failed to rollback of layout of: "DFID
- ": %d, file state unkonwn.\n",
- mdd_obj_dev_name(obj), PFID(mdo2fid(obj)), rc2);
+ CERROR("%s: failed rollback "DFID" layout: file state unkonwn: rc = %d\n",
+ mdd_obj_dev_name(obj),
+ PFID(mdd_object_fid(obj)), rc2);
}
out:
rc = mdd_trans_stop(env, mdd, rc, handle);
const struct lu_attr *attr2,
__u64 flags)
{
- const struct lu_fid *fid1, *fid2;
+ const struct lu_fid *fid1, *fid2;
ENTRY;
- fid1 = mdo2fid(o1);
- fid2 = mdo2fid(o2);
+ fid1 = mdd_object_fid(o1);
+ fid2 = mdd_object_fid(o2);
if (!fid_is_norm(fid1) &&
(!fid_is_igif(fid1) || IS_ERR(mdd_links_get(env, o1))))
out:
/* Ignore failure but report the error */
if (rc)
- CERROR("%s: "DFID" can't truncate DOM inode data, rc = %d\n",
- mdd_obj_dev_name(mo), PFID(mdo2fid(mo)), rc);
+ CERROR("%s: can't truncate DOM inode "DFID" data: rc = %d\n",
+ mdd_obj_dev_name(mo), PFID(mdd_object_fid(mo)), rc);
return rc;
}
/* we have to sort the 2 obj, so locking will always
* be in the same order, even in case of 2 concurrent swaps */
- rc = lu_fid_cmp(mdo2fid(fst_o), mdo2fid(snd_o));
+ rc = lu_fid_cmp(mdd_object_fid(fst_o), mdd_object_fid(snd_o));
if (rc == 0) /* same fid ? */
RETURN(-EPERM);
if (domsize_vlt > 0 && domsize_dom == 0) {
rc = -EOPNOTSUPP;
- CDEBUG(D_LAYOUT, "cannot swap layout for "DFID": OST to DOM "
- "migration is not supported: rc = %d\n",
- PFID(mdo2fid(snd_o)), rc);
+ CDEBUG(D_LAYOUT,
+ "%s: cannot swap "DFID" layout: OST to DOM migration not supported: rc = %d\n",
+ mdd_obj_dev_name(snd_o),
+ PFID(mdd_object_fid(snd_o)), rc);
GOTO(stop, rc);
} else if (domsize_vlt > 0 && domsize_dom != domsize_vlt) {
rc = -EOPNOTSUPP;
- CDEBUG(D_LAYOUT, "cannot swap layout for "DFID": new layout "
- "must have the same DoM component size: rc = %d\n",
- PFID(mdo2fid(fst_o)), rc);
+ CDEBUG(D_LAYOUT,
+ "%s: cannot swap "DFID" layout: new layout must have same DoM component size: rc = %d\n",
+ mdd_obj_dev_name(fst_o),
+ PFID(mdd_object_fid(fst_o)), rc);
GOTO(stop, rc);
} else if (domsize_vlt > 0) {
/* Migration with the same DOM component size, no need to
rc2 = mdd_xattr_hsm_replace(env, fst_o, fst_hsm_buf,
handle);
if (rc2 < 0)
- CERROR("%s: restore "DFID" HSM error: %d/%d\n",
+ CERROR("%s: HSM error restoring "DFID": rc = %d/%d\n",
mdd_obj_dev_name(fst_o),
- PFID(mdo2fid(fst_o)), rc, rc2);
+ PFID(mdd_object_fid(fst_o)), rc, rc2);
GOTO(stop, rc);
}
}
do_lbug:
if (rc2 < 0) {
/* very bad day */
- CERROR("%s: unable to roll back layout swap. FIDs: "
- DFID" and "DFID "error: %d/%d, steps: %d\n",
+ CERROR("%s: unable to roll back layout swap of "DFID" and "DFID", steps: %d: rc = %d/%d\n",
mdd_obj_dev_name(fst_o),
- PFID(mdo2fid(snd_o)), PFID(mdo2fid(fst_o)),
+ PFID(mdd_object_fid(snd_o)),
+ PFID(mdd_object_fid(fst_o)),
rc, rc2, steps);
/* a solution to avoid journal commit is to panic,
* but it has strong consequences so we use LBUG to
}
/* FYI, only the bottom 32 bits of open_flags are recorded */
- mdd_changelog(env, type, open_flags, md_dev, mdo2fid(mdd_obj));
+ mdd_changelog(env, type, open_flags, md_dev, mdd_object_fid(mdd_obj));
EXIT;
out: