-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
+/*
* GPL HEADER START
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
/*
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2012, Whamcloud, Inc.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
* Author: Mike Pershin <tappro@clusterfs.com>
*/
-#ifndef EXPORT_SYMTAB
-# define EXPORT_SYMTAB
-#endif
-
#define DEBUG_SUBSYSTEM S_MDS
#include <lustre_fid.h>
}
static int cml_close(const struct lu_env *env, struct md_object *mo,
- struct md_attr *ma)
+ struct md_attr *ma, int mode)
{
int rc;
ENTRY;
- rc = mo_close(env, md_object_next(mo), ma);
+ rc = mo_close(env, md_object_next(mo), ma, mode);
RETURN(rc);
}
RETURN(rc);
}
-static int cml_object_sync(const struct lu_env *env, struct md_object *mo)
+static int cml_file_lock(const struct lu_env *env, struct md_object *mo,
+ struct lov_mds_md *lmm, struct ldlm_extent *extent,
+ struct lustre_handle *lockh)
{
int rc;
ENTRY;
- rc = mo_object_sync(env, md_object_next(mo));
+ rc = mo_file_lock(env, md_object_next(mo), lmm, extent, lockh);
RETURN(rc);
}
-static dt_obj_version_t cml_version_get(const struct lu_env *env,
- struct md_object *mo)
+static int cml_file_unlock(const struct lu_env *env, struct md_object *mo,
+ struct lov_mds_md *lmm, struct lustre_handle *lockh)
{
- return mo_version_get(env, md_object_next(mo));
+ int rc;
+ ENTRY;
+ rc = mo_file_unlock(env, md_object_next(mo), lmm, lockh);
+ RETURN(rc);
}
-static void cml_version_set(const struct lu_env *env, struct md_object *mo,
- dt_obj_version_t version)
+static int cml_object_sync(const struct lu_env *env, struct md_object *mo)
{
- return mo_version_set(env, md_object_next(mo), version);
+ int rc;
+ ENTRY;
+ rc = mo_object_sync(env, md_object_next(mo));
+ RETURN(rc);
}
static const struct md_object_operations cml_mo_ops = {
.moo_changelog = cml_changelog,
.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,
+ .moo_file_lock = cml_file_lock,
+ .moo_file_unlock = cml_file_unlock,
};
/** @} */
RETURN(rc);
}
+/** Call mdo_lum_lmm_cmp() on next layer */
+static int cml_lum_lmm_cmp(const struct lu_env *env, struct md_object *mo_c,
+ const struct md_op_spec *spec, struct md_attr *ma)
+{
+ int rc;
+ ENTRY;
+
+ rc = mdo_lum_lmm_cmp(env, md_object_next(mo_c), spec, ma);
+ RETURN(rc);
+}
+
/**
* \ingroup cmm
* Get mode of object.
.mdo_create = cml_create,
.mdo_link = cml_link,
.mdo_unlink = cml_unlink,
+ .mdo_lum_lmm_cmp = cml_lum_lmm_cmp,
.mdo_name_insert = cml_name_insert,
.mdo_rename = cml_rename,
.mdo_rename_tgt = cml_rename_tgt,
}
static int cmr_close(const struct lu_env *env, struct md_object *mo,
- struct md_attr *ma)
+ struct md_attr *ma, int mode)
{
return -EFAULT;
}
return -EFAULT;
}
-/**
- * cmr moo_version_get().
- */
-static dt_obj_version_t cmr_version_get(const struct lu_env *env,
- struct md_object *mo)
+static int cmr_file_lock(const struct lu_env *env, struct md_object *mo,
+ struct lov_mds_md *lmm, struct ldlm_extent *extent,
+ struct lustre_handle *lockh)
{
- /** Don't check remote object version */
- return 0;
+ return -EREMOTE;
}
+static int cmr_file_unlock(const struct lu_env *env, struct md_object *mo,
+ struct lov_mds_md *lmm, struct lustre_handle *lockh)
+{
+ return -EREMOTE;
+}
-/**
- * cmr moo_version_set().
- * No need to update remote object version here, it is done as a part
- * of reintegration of partial operation on the remote server.
- */
-static void cmr_version_set(const struct lu_env *env, struct md_object *mo,
- dt_obj_version_t version)
+static int cmr_lum_lmm_cmp(const struct lu_env *env, struct md_object *mo_c,
+ const struct md_op_spec *spec, struct md_attr *ma)
{
- return;
+ return -EREMOTE;
}
/** Set of md_object_operations for cmr. */
.moo_changelog = cmr_changelog,
.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,
+ .moo_file_lock = cmr_file_lock,
+ .moo_file_unlock = cmr_file_unlock,
};
/** @} */
.mdo_create = cmr_create,
.mdo_link = cmr_link,
.mdo_unlink = cmr_unlink,
+ .mdo_lum_lmm_cmp = cmr_lum_lmm_cmp,
.mdo_rename = cmr_rename,
.mdo_rename_tgt = cmr_rename_tgt
};