}
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);
}
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;
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;
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,
.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 */
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;
}
}
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;
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 = {
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,
.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 */
.mdo_link = cmr_link,
.mdo_unlink = cmr_unlink,
.mdo_rename = cmr_rename,
- .mdo_rename_tgt = cmr_rename_tgt,
+ .mdo_rename_tgt = cmr_rename_tgt
};