From: tappro Date: Wed, 12 Apr 2006 22:17:26 +0000 (+0000) Subject: remove unneeded methods and apply changes due to lu_context X-Git-Tag: v1_8_0_110~486^2~2025 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=edc33de8bfcb4f4cc272fcb2f6373235f301184c;p=fs%2Flustre-release.git remove unneeded methods and apply changes due to lu_context --- diff --git a/lustre/cmm/cmm_internal.h b/lustre/cmm/cmm_internal.h index 53226a7..d9c90b7 100644 --- a/lustre/cmm/cmm_internal.h +++ b/lustre/cmm/cmm_internal.h @@ -85,10 +85,10 @@ static inline struct md_object *cmm2child_obj(struct cmm_object *o) } /* cmm_object.c */ -int cmm_object_init(struct lu_object*); +int cmm_object_init(struct lu_context *ctxt, struct lu_object*); struct lu_object *cmm_object_alloc(struct lu_device *); void cmm_object_free(struct lu_object *o); -void cmm_object_release(struct lu_object *o); +void cmm_object_release(struct lu_context *ctxt, struct lu_object *o); //int cmm_getattr(struct lu_object *o, struct lu_attr *a); //int cmm_setattr(struct lu_object *o, struct lu_attr *a); int cmm_object_print(struct seq_file *f, const struct lu_object *o); @@ -98,10 +98,10 @@ int cmm_config(struct md_device *md, const char *name, void *buf, int size, int mode); int cmm_root_get(struct md_device *m, struct lu_fid *f); int cmm_statfs(struct md_device *m, struct kstatfs *sfs); -int cmm_mkdir(struct md_object *o, const char *name, +int cmm_mkdir(struct lu_context *ctxt, struct md_object *o, const char *name, struct md_object *child); -int cmm_attr_get(struct md_object *obj, void *buf, int size, - const char *name, struct context *ctxt); +int cmm_attr_get(struct lu_context *ctxt, struct md_object *obj, void *buf, int size, + const char *name, struct md_params *); #endif /* __KERNEL__ */ #endif /* _CMM_INTERNAL_H */ diff --git a/lustre/cmm/cmm_object.c b/lustre/cmm/cmm_object.c index 83f5cee..95ba5bf 100644 --- a/lustre/cmm/cmm_object.c +++ b/lustre/cmm/cmm_object.c @@ -36,22 +36,6 @@ static struct md_object_operations cmm_mo_ops; -struct cmm_object *cmm_object_find(struct cmm_device *d, struct lu_fid *f) -{ - struct lu_object *o; - - o = lu_object_find(d->cmm_md_dev.md_lu_dev.ld_site, f); - if (IS_ERR(o)) - return (struct cmm_object *)o; - else - return container_of(o, struct cmm_object, cmo_obj.mo_lu); -} - -void cmm_object_put(struct cmm_object *o) -{ - lu_object_put(&o->cmo_obj.mo_lu); -} - struct lu_object *cmm_object_alloc(struct lu_device *d) { struct cmm_object *mo; @@ -69,7 +53,7 @@ struct lu_object *cmm_object_alloc(struct lu_device *d) RETURN(NULL); } -int cmm_object_init(struct lu_object *o) +int cmm_object_init(struct lu_context *ctxt, struct lu_object *o) { struct cmm_device *d = lu2cmm_dev(o->lo_dev); struct lu_device *under; @@ -90,7 +74,7 @@ void cmm_object_free(struct lu_object *o) lu_object_fini(o); } -void cmm_object_release(struct lu_object *o) +void cmm_object_release(struct lu_context *ctxt, struct lu_object *o) { return; } @@ -149,18 +133,25 @@ int cmm_statfs(struct md_device *md, struct kstatfs *sfs) { RETURN (result); } -int cmm_mkdir(struct md_object *md_parent, const char *name, - struct md_object *md_child) +int cmm_mkdir(struct lu_context *ctxt, struct md_object *md_parent, + const char *name, struct md_object *md_child) { struct cmm_object *cmm_parent = md2cmm_obj(md_parent); struct md_object *next = cmm2child_obj(cmm_parent); - return next->mo_ops->moo_mkdir(next, name, md_child); + return next->mo_ops->moo_mkdir(ctxt, next, name, md_child); +} + +int cmm_attr_get(struct lu_context *ctxt, struct md_object *obj, + void *buf, int size, const char *name, struct md_params *arg) +{ + struct md_object *next = cmm2child_obj(md2cmm_obj(obj)); + + return next->mo_ops->moo_attr_get(ctxt, next, buf, size, name, arg); } static struct md_object_operations cmm_mo_ops = { .moo_mkdir = cmm_mkdir, - .moo_mkdir = cmm_mkdir, .moo_attr_get = cmm_attr_get, // .moo_rename = cmm_rename, // .moo_link = cmm_link, @@ -170,12 +161,4 @@ static struct md_object_operations cmm_mo_ops = { // .moo_object_create = cmm_object_create, }; -int cmm_attr_get(struct md_object *obj, void *buf, int size, - const char *name, struct context *ctxt) -{ - struct md_object *next = cmm2child_obj(md2cmm_obj(obj)); - - LASSERT((void *)obj->mo_ops > (void *)0x100); - return next->mo_ops->moo_attr_get(next, buf, size, name, ctxt); -}