#include <linux/obd.h>
#include <linux/md_object.h>
-struct cmm_mdc_device {
- struct md_device mdc_md_dev;
- /* other MD servers in cluster */
- __u32 cmm_tgt_count;
- struct list_head cmm_tgt_linkage;
-};
-
struct cmm_device {
struct md_device cmm_md_dev;
/* underlaying device in MDS stack, usually MDD */
struct md_device *cmm_child;
/* other MD servers in cluster */
- __u32 local_num;
+ __u32 cmm_local_num;
__u32 cmm_tgt_count;
struct list_head cmm_targets;
};
}
struct cmm_object {
- struct md_object cmo_obj;
+ struct md_object cmo_obj;
+ /* mds number where object is placed */
+ __u32 cmo_num;
};
static inline struct cmm_device *cmm_obj2dev(struct cmm_object *c)
return container_of0(o, struct cmm_object, cmo_obj.mo_lu);
}
+static inline int cmm_is_local_obj(struct cmm_object *c)
+{
+ return (c->cmo_num == cmm_obj2dev(c)->cmm_local_num);
+}
+
/* get cmm object from md_object */
static inline struct cmm_object *md2cmm_obj(struct md_object *o)
{
return lu2md(lu_object_next(&o->cmo_obj.mo_lu));
}
-/* cmm device */
-int cmm_add_mdc(struct cmm_device *, struct lustre_cfg *);
-
/* cmm_object.c */
struct lu_object *cmm_object_alloc(struct lu_context *ctx, struct lu_device *);
void cmm_object_free(struct lu_context *ctx, struct lu_object *o);
int cmm_root_get(struct lu_context *ctx, struct md_device *m, struct lu_fid *f);
int cmm_statfs(struct lu_context *ctx,
struct md_device *m, struct kstatfs *sfs);
-int cmm_mkdir(struct lu_context *ctxt, struct md_object *o, const char *name,
+int cmm_object_create(struct lu_context *, struct md_object *);
+int cmm_mkdir(struct lu_context *ctxt, struct lu_attr*,
+ struct md_object *o, const char *name,
struct md_object *child);
int cmm_xattr_get(struct lu_context *ctxt,
struct md_object *obj, void *buf, int size,