From fc63284862a06090125ccbe00798c8b736c7d39a Mon Sep 17 00:00:00 2001 From: wangdi Date: Thu, 6 Apr 2006 09:33:03 +0000 Subject: [PATCH] Branch b_new_cmd 1) add mdd_put_object in release method to destory the object when nlink of the object is zero. 2) some minor fixes --- lustre/include/linux/md_object.h | 2 -- lustre/mdd/mdd_handler.c | 7 ++++++- lustre/mdd/mdd_internal.h | 5 ++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lustre/include/linux/md_object.h b/lustre/include/linux/md_object.h index 71c5b18..aabb920 100644 --- a/lustre/include/linux/md_object.h +++ b/lustre/include/linux/md_object.h @@ -33,8 +33,6 @@ struct md_object; /*the context of the mdd ops*/ struct context { - const char *name; - int name_len; __u32 mode; int flags; }; diff --git a/lustre/mdd/mdd_handler.c b/lustre/mdd/mdd_handler.c index 979c02f..ae5b092 100644 --- a/lustre/mdd/mdd_handler.c +++ b/lustre/mdd/mdd_handler.c @@ -134,6 +134,10 @@ void mdd_object_free(struct lu_object *o) void mdd_object_release(struct lu_object *o) { + struct mdd_device *mdd = lu2mdd_dev(o->lo_dev); + struct mdd_object *obj = mdd_obj(o); + + mdd_object_put(mdd, obj); } int mdd_object_print(struct seq_file *f, const struct lu_object *o) @@ -566,6 +570,8 @@ cleanup: static int mdd_root_get(struct md_device *m, struct lu_fid *f) { + struct mdd_device *mdd = lu2mdd_dev(&m->md_lu_dev); + memcpy(f, &mdd->mdd_rootfid, sizeof(*f)); return 0; } @@ -717,4 +723,3 @@ MODULE_DESCRIPTION("Lustre Meta-data Device Prototype ("LUSTRE_MDD_NAME")"); MODULE_LICENSE("GPL"); cfs_module(mdd, "0.0.2", mdd_mod_init, mdd_mod_exit); - diff --git a/lustre/mdd/mdd_internal.h b/lustre/mdd/mdd_internal.h index b52b44a..854d253 100644 --- a/lustre/mdd/mdd_internal.h +++ b/lustre/mdd/mdd_internal.h @@ -67,8 +67,8 @@ struct osd_device_operations { const char *name, struct context *uctxt, void *handle); int (*osd_index_delete)(struct lu_object *lu, struct lu_fid *fid, - const char *name, struct context *uctxt, - void *handle); + const char *name, struct context *uctxt, + void *handle); }; struct osd_device { @@ -76,7 +76,6 @@ struct osd_device { struct osd_device_operations *osd_ops; }; - int mdd_object_put(struct mdd_device *mdd, struct mdd_object *obj); void mdd_object_get(struct mdd_device *mdd, struct mdd_object *obj); #endif -- 1.8.3.1