int eadatalen;
} sp_ea;
} u;
-
+
/** Create flag from client: such as MDS_OPEN_CREAT, and others. */
__u32 sp_cr_flags;
int (*moo_close)(const struct lu_env *env, struct md_object *obj,
struct md_attr *ma);
-
+
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 *);
struct md_device {
struct lu_device md_lu_dev;
- struct md_device_operations *md_ops;
+ const struct md_device_operations *md_ops;
struct md_upcall md_upcall;
};
struct md_object {
struct lu_object mo_lu;
- struct md_object_operations *mo_ops;
- struct md_dir_operations *mo_dir_ops;
+ const struct md_object_operations *mo_ops;
+ const struct md_dir_operations *mo_dir_ops;
+};
+
+/**
+ * md-server site.
+ */
+struct md_site {
+ struct lu_site ms_lu;
+ /**
+ * mds number of this site.
+ */
+ mdsno_t ms_node_id;
+ /**
+ * Fid location database
+ */
+ struct lu_server_fld *ms_server_fld;
+ struct lu_client_fld *ms_client_fld;
+
+ /**
+ * Server Seq Manager
+ */
+ struct lu_server_seq *ms_server_seq;
+
+ /**
+ * Controller Seq Manager
+ */
+ struct lu_server_seq *ms_control_seq;
+ struct obd_export *ms_control_exp;
+
+ /**
+ * Client Seq Manager
+ */
+ struct lu_client_seq *ms_client_seq;
};
static inline int lu_device_is_md(const struct lu_device *d)
static inline struct md_device *lu2md_dev(const struct lu_device *d)
{
- LASSERT(lu_device_is_md(d));
+ LASSERT(IS_ERR(d) || lu_device_is_md(d));
return container_of0(d, struct md_device, md_lu_dev);
}
static inline struct md_object *lu2md(const struct lu_object *o)
{
- LASSERT(lu_device_is_md(o->lo_dev));
+ LASSERT(o == NULL || IS_ERR(o) || lu_device_is_md(o->lo_dev));
return container_of0(o, struct md_object, mo_lu);
}
static inline struct md_device *md_obj2dev(const struct md_object *o)
{
- LASSERT(lu_device_is_md(o->mo_lu.lo_dev));
+ LASSERT(o == NULL || IS_ERR(o) || lu_device_is_md(o->mo_lu.lo_dev));
return container_of0(o->mo_lu.lo_dev, struct md_device, md_lu_dev);
}
+static inline struct md_site *lu_site2md(const struct lu_site *s)
+{
+ return container_of0(s, struct md_site, ms_lu);
+}
+
static inline int md_device_init(struct md_device *md, struct lu_device_type *t)
{
return lu_device_init(&md->md_lu_dev, t);
lu_device_fini(&md->md_lu_dev);
}
-/* md operations */
+static inline struct md_object *md_object_find_slice(const struct lu_env *env,
+ struct md_device *md,
+ const struct lu_fid *f)
+{
+ return lu2md(lu_object_find_slice(env, md2lu_dev(md), f, NULL));
+}
+
+
+/** md operations */
static inline int mo_permission(const struct lu_env *env,
struct md_object *p,
struct md_object *c,