Whamcloud - gitweb
Branch b_new_cmd
authorwangdi <wangdi>
Thu, 6 Apr 2006 09:33:03 +0000 (09:33 +0000)
committerwangdi <wangdi>
Thu, 6 Apr 2006 09:33:03 +0000 (09:33 +0000)
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
lustre/mdd/mdd_handler.c
lustre/mdd/mdd_internal.h

index 71c5b18..aabb920 100644 (file)
@@ -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;
 };
index 979c02f..ae5b092 100644 (file)
@@ -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);
-
index b52b44a..854d253 100644 (file)
@@ -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