X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fcmm%2Fcmm_object.c;h=c9301cf9327f8f2eda655c534682910171dbab96;hb=6e3ec5812ebd1b5ecf7cae584f429b013ffe7431;hp=73c9dad3cd96196c6e981ff1af238479d7974138;hpb=cefa8cda2ba2d288ccaa4ec077a6c627592503ea;p=fs%2Flustre-release.git diff --git a/lustre/cmm/cmm_object.c b/lustre/cmm/cmm_object.c index 73c9dad..c9301cf 100644 --- a/lustre/cmm/cmm_object.c +++ b/lustre/cmm/cmm_object.c @@ -66,12 +66,12 @@ int cmm_fld_lookup(struct cmm_device *cm, const struct lu_fid *fid, } if (*mds > cm->cmm_tgt_count) { - CERROR("Got invalid mdsno: "LPU64" (max: %u)\n", + CERROR("Got invalid mdsno: %x (max: %x)\n", *mds, cm->cmm_tgt_count); rc = -EINVAL; } else { - CDEBUG(D_INFO, "CMM: got MDS "LPU64" for sequence: " - LPU64"\n", *mds, fid_seq(fid)); + CDEBUG(D_INFO, "CMM: got MDS %x for sequence: " + LPX64"\n", *mds, fid_seq(fid)); } RETURN (rc); @@ -160,7 +160,7 @@ static void cml_object_free(const struct lu_env *env, } static int cml_object_init(const struct lu_env *env, struct lu_object *lo, - const struct lu_object_conf *_) + const struct lu_object_conf *unused) { struct cmm_device *cd = lu2cmm_dev(lo->lo_dev); struct lu_device *c_dev; @@ -345,6 +345,15 @@ static int cml_capa_get(const struct lu_env *env, struct md_object *mo, RETURN(rc); } +static int cml_path(const struct lu_env *env, struct md_object *mo, + char *path, int pathlen, __u64 *recno, int *linkno) +{ + int rc; + ENTRY; + rc = mo_path(env, md_object_next(mo), path, pathlen, recno, linkno); + RETURN(rc); +} + static int cml_object_sync(const struct lu_env *env, struct md_object *mo) { int rc; @@ -353,6 +362,18 @@ static int cml_object_sync(const struct lu_env *env, struct md_object *mo) RETURN(rc); } +static dt_obj_version_t cml_version_get(const struct lu_env *env, + struct md_object *mo) +{ + return mo_version_get(env, md_object_next(mo)); +} + +static void cml_version_set(const struct lu_env *env, struct md_object *mo, + dt_obj_version_t version) +{ + return mo_version_set(env, md_object_next(mo), version); +} + static const struct md_object_operations cml_mo_ops = { .moo_permission = cml_permission, .moo_attr_get = cml_attr_get, @@ -370,6 +391,9 @@ static const struct md_object_operations cml_mo_ops = { .moo_readlink = cml_readlink, .moo_capa_get = cml_capa_get, .moo_object_sync = cml_object_sync, + .moo_version_get = cml_version_get, + .moo_version_set = cml_version_set, + .moo_path = cml_path, }; /* md_dir operations */ @@ -777,14 +801,14 @@ static struct lu_device *cmr_child_dev(struct cmm_device *d, __u32 num) struct lu_device *next = NULL; struct mdc_device *mdc; - spin_lock(&d->cmm_tgt_guard); - list_for_each_entry(mdc, &d->cmm_targets, mc_linkage) { + cfs_spin_lock(&d->cmm_tgt_guard); + cfs_list_for_each_entry(mdc, &d->cmm_targets, mc_linkage) { if (mdc->mc_num == num) { next = mdc2lu_dev(mdc); break; } } - spin_unlock(&d->cmm_tgt_guard); + cfs_spin_unlock(&d->cmm_tgt_guard); return next; } @@ -798,7 +822,7 @@ static void cmr_object_free(const struct lu_env *env, } static int cmr_object_init(const struct lu_env *env, struct lu_object *lo, - const struct lu_object_conf *_) + const struct lu_object_conf *unused) { struct cmm_device *cd = lu2cmm_dev(lo->lo_dev); struct lu_device *c_dev; @@ -827,7 +851,8 @@ static int cmr_object_init(const struct lu_env *env, struct lu_object *lo, static int cmr_object_print(const struct lu_env *env, void *cookie, lu_printer_t p, const struct lu_object *lo) { - return (*p)(env, cookie, "[remote]"); + const struct cmr_object *cro = lu2cmr_obj((struct lu_object *)lo); + return (*p)(env, cookie, "[remote](mds_num=%d)", cro->cmo_num); } static const struct lu_object_operations cmr_obj_ops = { @@ -931,11 +956,31 @@ static int cmr_capa_get(const struct lu_env *env, struct md_object *mo, return -EFAULT; } +static int cmr_path(const struct lu_env *env, struct md_object *obj, + char *path, int pathlen, __u64 *recno, int *linkno) +{ + return -EREMOTE; +} + static int cmr_object_sync(const struct lu_env *env, struct md_object *mo) { return -EFAULT; } +static dt_obj_version_t cmr_version_get(const struct lu_env *env, + struct md_object *mo) +{ + /* Don't check remote object version */ + return 0; +} + +static void cmr_version_set(const struct lu_env *env, struct md_object *mo, + dt_obj_version_t version) +{ + /* No need to update remote object version here, it is done as a part + * of reintegration of partial operation on the remote server */ +} + static const struct md_object_operations cmr_mo_ops = { .moo_permission = cmr_permission, .moo_attr_get = cmr_attr_get, @@ -953,6 +998,9 @@ static const struct md_object_operations cmr_mo_ops = { .moo_readlink = cmr_readlink, .moo_capa_get = cmr_capa_get, .moo_object_sync = cmr_object_sync, + .moo_version_get = cmr_version_get, + .moo_version_set = cmr_version_set, + .moo_path = cmr_path, }; /* remote part of md_dir operations */