X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fcmm%2Fcmm_object.c;h=910e5c07716fe82674f25bd43ec884469b4df478;hp=0d9ac93b2b01bf3daf705e3ddc436d2b06e295fd;hb=0ad352cfebf46499bf9d3162e6c388f47e65f25d;hpb=0e531fd8833e5cddb1fcbbc9bfa76a50aa01b67f diff --git a/lustre/cmm/cmm_object.c b/lustre/cmm/cmm_object.c index 0d9ac93..910e5c0 100644 --- a/lustre/cmm/cmm_object.c +++ b/lustre/cmm/cmm_object.c @@ -159,7 +159,8 @@ static void cml_object_free(const struct lu_env *env, OBD_FREE_PTR(clo); } -static int cml_object_init(const struct lu_env *env, struct lu_object *lo) +static int cml_object_init(const struct lu_env *env, struct lu_object *lo, + const struct lu_object_conf *_) { struct cmm_device *cd = lu2cmm_dev(lo->lo_dev); struct lu_device *c_dev; @@ -503,30 +504,11 @@ static int cml_unlink(const struct lu_env *env, struct md_object *mo_p, RETURN(rc); } -/* rename is split to local/remote by location of new parent dir */ -struct md_object *md_object_find(const struct lu_env *env, - struct md_device *md, - const struct lu_fid *f) -{ - struct lu_object *o; - struct md_object *m; - ENTRY; - - o = lu_object_find(env, md2lu_dev(md)->ld_site, f); - if (IS_ERR(o)) - m = (struct md_object *)o; - else { - o = lu_object_locate(o->lo_header, md2lu_dev(md)->ld_type); - m = o ? lu2md(o) : NULL; - } - RETURN(m); -} - static int cmm_mode_get(const struct lu_env *env, struct md_device *md, const struct lu_fid *lf, struct md_attr *ma, int *remote) { - struct md_object *mo_s = md_object_find(env, md, lf); + struct md_object *mo_s = md_object_find_slice(env, md, lf); struct cmm_thread_info *cmi; struct md_attr *tmp_ma; int rc; @@ -558,7 +540,7 @@ static int cmm_mode_get(const struct lu_env *env, struct md_device *md, static int cmm_rename_ctime(const struct lu_env *env, struct md_device *md, const struct lu_fid *lf, struct md_attr *ma) { - struct md_object *mo_s = md_object_find(env, md, lf); + struct md_object *mo_s = md_object_find_slice(env, md, lf); int rc; ENTRY; @@ -619,7 +601,7 @@ static int cml_rename(const struct lu_env *env, struct md_object *mo_po, /* XXX: mo_t is remote object and there is RPC to unlink it. * before that, do local sanity check for rename first. */ if (!remote) { - struct md_object *mo_s = md_object_find(env, + struct md_object *mo_s = md_object_find_slice(env, md_obj2dev(mo_po), lf); if (IS_ERR(mo_s)) RETURN(PTR_ERR(mo_s)); @@ -815,7 +797,8 @@ static void cmr_object_free(const struct lu_env *env, OBD_FREE_PTR(cro); } -static int cmr_object_init(const struct lu_env *env, struct lu_object *lo) +static int cmr_object_init(const struct lu_env *env, struct lu_object *lo, + const struct lu_object_conf *_) { struct cmm_device *cd = lu2cmm_dev(lo->lo_dev); struct lu_device *c_dev;