X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Finclude%2Fmd_object.h;h=f69fac59d991b2a00e8d91275ef284b13fc9932f;hb=92f7ed4a92abf85b9b1cdfb0cae06e50a5f8319d;hp=985550b12896d0cd1a9de070337c8eae77d53543;hpb=cccd15bd8f79564691f5fcd81450b00f313bb626;p=fs%2Flustre-release.git diff --git a/lustre/include/md_object.h b/lustre/include/md_object.h index 985550b..f69fac5 100644 --- a/lustre/include/md_object.h +++ b/lustre/include/md_object.h @@ -56,7 +56,7 @@ /* * super-class definitions. */ -#include +#include #include struct md_device; @@ -246,9 +246,12 @@ struct md_object_operations { struct lustre_capa *, int renewal); int (*moo_object_sync)(const struct lu_env *, struct md_object *); - + dt_obj_version_t (*moo_version_get)(const struct lu_env *, + struct md_object *); + void (*moo_version_set)(const struct lu_env *, struct md_object *, + dt_obj_version_t); int (*moo_path)(const struct lu_env *env, struct md_object *obj, - char *path, int pathlen, __u64 recno, int *linkno); + char *path, int pathlen, __u64 *recno, int *linkno); }; /** @@ -326,6 +329,12 @@ struct md_device_operations { struct md_device *m, struct lustre_capa_key *key); + int (*mdo_llog_ctxt_get)(const struct lu_env *env, + struct md_device *m, int idx, void **h); + + int (*mdo_iocontrol)(const struct lu_env *env, struct md_device *m, + unsigned int cmd, int len, void *data); + #ifdef HAVE_QUOTA_SUPPORT struct md_quota_operations { int (*mqo_notify)(const struct lu_env *env, @@ -402,11 +411,13 @@ struct md_device_operations { }; enum md_upcall_event { - /**sync the md layer*/ + /** Sync the md layer*/ MD_LOV_SYNC = (1 << 0), /** Just for split, no need trans, for replay */ MD_NO_TRANS = (1 << 1), - MD_LOV_CONFIG = (1 << 2) + MD_LOV_CONFIG = (1 << 2), + /** Trigger quota recovery */ + MD_LOV_QUOTA = (1 << 3) }; struct md_upcall { @@ -685,9 +696,10 @@ static inline int mo_capa_get(const struct lu_env *env, } static inline int mo_path(const struct lu_env *env, struct md_object *m, - char *path, int pathlen, __u64 recno, int *linkno) + char *path, int pathlen, __u64 *recno, int *linkno) { - LASSERT(m->mo_ops->moo_path); + if (m->mo_ops->moo_path == NULL) + return -ENOSYS; return m->mo_ops->moo_path(env, m, path, pathlen, recno, linkno); } @@ -697,6 +709,20 @@ static inline int mo_object_sync(const struct lu_env *env, struct md_object *m) return m->mo_ops->moo_object_sync(env, m); } +static inline dt_obj_version_t mo_version_get(const struct lu_env *env, + struct md_object *m) +{ + LASSERT(m->mo_ops->moo_version_get); + return m->mo_ops->moo_version_get(env, m); +} + +static inline void mo_version_set(const struct lu_env *env, + struct md_object *m, dt_obj_version_t ver) +{ + LASSERT(m->mo_ops->moo_version_set); + return m->mo_ops->moo_version_set(env, m, ver); +} + static inline int mdo_lookup(const struct lu_env *env, struct md_object *p, const struct lu_name *lname,