/*
* super-class definitions.
*/
-#include <lu_object.h>
+#include <dt_object.h>
#include <lvfs.h>
struct md_device;
__u32 mu_suppgids[2];
cfs_cap_t mu_cap;
__u32 mu_umask;
- struct group_info *mu_ginfo;
- struct md_identity *mu_identity;
+ struct group_info *mu_ginfo;
+ struct md_identity *mu_identity;
};
enum {
int (*moo_capa_get)(const struct lu_env *, struct md_object *,
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);
};
/**
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,
int (*mqo_on)(const struct lu_env *env,
struct md_device *m,
- __u32 type,
- __u32 id);
+ __u32 type);
int (*mqo_off)(const struct lu_env *env,
struct md_device *m,
- __u32 type,
- __u32 id);
+ __u32 type);
int (*mqo_setinfo)(const struct lu_env *env,
struct md_device *m,
};
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 {
struct md_device *mu_upcall_dev;
/** upcall function */
int (*mu_upcall)(const struct lu_env *env, struct md_device *md,
- enum md_upcall_event ev);
+ enum md_upcall_event ev, void *data);
};
struct md_device {
}
static inline int md_do_upcall(const struct lu_env *env, struct md_device *m,
- enum md_upcall_event ev)
+ enum md_upcall_event ev, void *data)
{
int rc = 0;
down_read(&m->md_upcall.mu_upcall_sem);
if (m->md_upcall.mu_upcall_dev != NULL &&
m->md_upcall.mu_upcall_dev->md_upcall.mu_upcall != NULL) {
rc = m->md_upcall.mu_upcall_dev->md_upcall.mu_upcall(env,
- m->md_upcall.mu_upcall_dev, ev);
+ m->md_upcall.mu_upcall_dev,
+ ev, data);
}
up_read(&m->md_upcall.mu_upcall_sem);
return rc;
return m->mo_ops->moo_capa_get(env, m, c, renewal);
}
+static inline int mo_path(const struct lu_env *env, struct md_object *m,
+ char *path, int pathlen, __u64 *recno, int *linkno)
+{
+ if (m->mo_ops->moo_path == NULL)
+ return -ENOSYS;
+ return m->mo_ops->moo_path(env, m, path, pathlen, recno, linkno);
+}
+
static inline int mo_object_sync(const struct lu_env *env, struct md_object *m)
{
LASSERT(m->mo_ops->moo_object_sync);
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,