}
static int mdd_link(const struct lu_context *ctxt, struct md_object *tgt_obj,
- struct md_object *src_obj, const char *name)
+ struct md_object *src_obj, const char *name,
+ struct md_attr *ma)
{
struct mdd_object *mdd_tobj = md2mdd_obj(tgt_obj);
struct mdd_object *mdd_sobj = md2mdd_obj(src_obj);
struct mdd_device *mdd = mdo2mdd(src_obj);
+ struct lu_attr *la_copy = &mdd_ctx_info(ctxt)->mti_la_for_fix;
struct thandle *handle;
int rc;
ENTRY;
if (rc == 0)
__mdd_ref_add(ctxt, mdd_sobj, handle);
+ *la_copy = ma->ma_attr;
+ la_copy->la_valid = LA_CTIME;
+ rc = mdd_attr_set_internal(ctxt, mdd_sobj, la_copy, handle);
+ if (rc)
+ GOTO(out, rc);
+
+ la_copy->la_valid = LA_CTIME | LA_MTIME;
+ rc = mdd_attr_set_internal(ctxt, mdd_tobj, la_copy, handle);
+
out:
mdd_unlock2(ctxt, mdd_tobj, mdd_sobj);
mdd_trans_stop(ctxt, mdd, rc, handle);
struct mdd_device *mdd = mdo2mdd(pobj);
struct mdd_object *mdd_pobj = md2mdd_obj(pobj);
struct mdd_object *mdd_cobj = md2mdd_obj(cobj);
+ struct lu_attr *la_copy = &mdd_ctx_info(ctxt)->mti_la_for_fix;
struct thandle *handle;
int rc;
ENTRY;
GOTO(cleanup, rc);
__mdd_ref_del(ctxt, mdd_cobj, handle);
+ *la_copy = ma->ma_attr;
if (S_ISDIR(lu_object_attr(&cobj->mo_lu))) {
/* unlink dot */
__mdd_ref_del(ctxt, mdd_cobj, handle);
/* unlink dotdot */
__mdd_ref_del(ctxt, mdd_pobj, handle);
+ } else {
+ la_copy->la_valid = LA_CTIME;
+ rc = mdd_attr_set_internal(ctxt, mdd_cobj, la_copy, handle);
+ if (rc)
+ GOTO(cleanup, rc);
}
+ la_copy->la_valid = LA_CTIME | LA_MTIME;
+ rc = mdd_attr_set_internal(ctxt, mdd_pobj, la_copy, handle);
+ if (rc)
+ GOTO(cleanup, rc);
+
rc = __mdd_finish_unlink(ctxt, mdd_cobj, ma, handle);
cleanup:
struct mdd_object *mdd_tpobj = md2mdd_obj(tgt_pobj);
struct mdd_object *mdd_sobj = mdd_object_find(ctxt, mdd, lf);
struct mdd_object *mdd_tobj = NULL;
+ struct lu_attr *la_copy = &mdd_ctx_info(ctxt)->mti_la_for_fix;
struct thandle *handle;
int is_dir = S_ISDIR(mdd_object_type(mdd_sobj));
int rc;
if (rc)
GOTO(cleanup, rc);
+ *la_copy = ma->ma_attr;
+ la_copy->la_valid = LA_CTIME;
+ rc = mdd_attr_set_internal_locked(ctxt, mdd_sobj, la_copy, handle);
+ if (rc)
+ GOTO(cleanup, rc);
+
if (tobj && lu_object_exists(&tobj->mo_lu)) {
mdd_write_lock(ctxt, mdd_tobj);
__mdd_ref_del(ctxt, mdd_tobj, handle);
if (is_dir)
__mdd_ref_del(ctxt, mdd_tobj, handle);
+ la_copy->la_valid = LA_CTIME;
+ rc = mdd_attr_set_internal(ctxt, mdd_tobj, la_copy, handle);
+ if (rc)
+ GOTO(cleanup, rc);
+
rc = __mdd_finish_unlink(ctxt, mdd_tobj, ma, handle);
mdd_write_unlock(ctxt, mdd_tobj);
+ if (rc)
+ GOTO(cleanup, rc);
+ }
+
+ la_copy->la_valid = LA_CTIME | LA_MTIME;
+ rc = mdd_attr_set_internal(ctxt, mdd_spobj, la_copy, handle);
+ if (rc)
+ GOTO(cleanup, rc);
+
+ if (mdd_spobj != mdd_tpobj) {
+ la_copy->la_valid = LA_CTIME | LA_MTIME;
+ rc = mdd_attr_set_internal(ctxt, mdd_tpobj, la_copy, handle);
}
+
cleanup:
mdd_rename_unlock(ctxt, mdd_spobj, mdd_tpobj);
cleanup_unlocked:
struct mdd_device *mdd = mdo2mdd(pobj);
struct mdd_object *mdd_pobj = md2mdd_obj(pobj);
struct mdd_object *son = md2mdd_obj(child);
+ struct lu_attr *la_copy = &mdd_ctx_info(ctxt)->mti_la_for_fix;
struct lu_attr *attr = &ma->ma_attr;
struct lov_mds_md *lmm = NULL;
struct thandle *handle;
else
rc = -EFAULT;
}
+
+ *la_copy = ma->ma_attr;
+ la_copy->la_valid = LA_CTIME | LA_MTIME;
+ rc = mdd_attr_set_internal(ctxt, mdd_pobj, la_copy, handle);
+ if (rc)
+ GOTO(cleanup, rc);
+
/* return attr back */
rc = mdd_attr_get_internal_locked(ctxt, son, ma);
cleanup: