Whamcloud - gitweb
- add two methods for lu_device - init/fini. Aftef all lu_device are allocateed,
authortappro <tappro>
Tue, 11 Apr 2006 06:41:18 +0000 (06:41 +0000)
committertappro <tappro>
Tue, 11 Apr 2006 06:41:18 +0000 (06:41 +0000)
  the top device call init() through all stack to start them. It is needed
because there are insufficient info for startup until all layers are setup

- add statfs() support in dt_device_ops/md_device_ops

lustre/include/linux/lu_object.h
lustre/include/linux/md_object.h

index 68efb5f..ff00489 100644 (file)
@@ -127,6 +127,12 @@ struct lu_device_operations {
         *  repeatedly, until no new objects are created.
         *
         */
+
+        /* Initialize the devices after allocation
+         * called from top device, when all layers are linked */
+        int (*ldo_device_init)(struct lu_device *, char *);
+        void (*ldo_device_fini)(struct lu_device *);
+
        /*
         * Allocate lower-layer parts of the object by calling
         * ->ldo_object_alloc() of the corresponding underlying device.
@@ -453,6 +459,7 @@ struct txn_param;
 struct dt_device;
 
 struct dt_device_operations {
+        int   (*dt_statfs)(struct dt_device *dev, struct kstatfs *sfs);
         void  (*dt_object_lock)(struct dt_object *dt, enum dt_lock_mode mode);
         void  (*dt_object_unlock)(struct dt_object *dt, enum dt_lock_mode mode);
         struct thandle *(*dt_trans_start)(struct dt_device *dev,
@@ -477,6 +484,7 @@ struct dt_device_operations {
 struct dt_device {
        struct lu_device             dd_lu_dev;
        struct dt_device_operations *dd_ops;
+        struct lustre_mount_info    *dd_lmi;
 };
 
 struct txn_param {
index c1b1dcc..a25007f 100644 (file)
@@ -39,6 +39,7 @@ struct context {
 
 struct md_device_operations {
         int (*mdo_root_get)(struct md_device *m, struct lu_fid *f);
+        int (*mdo_statfs)(struct md_device *m, struct kstatfs *sfs);
         int (*mdo_mkdir)(struct md_object *obj, const char *name,
                          struct md_object *child);
 
@@ -80,6 +81,11 @@ static inline struct md_device *lu2md_dev(struct lu_device *d)
         return container_of(d, struct md_device, md_lu_dev);
 }
 
+static inline struct lu_device *md2lu_dev(struct md_device *d)
+{
+        return &d->md_lu_dev;
+}
+
 static inline struct md_object *lu2md(struct lu_object *o)
 {
         LASSERT(lu_device_is_md(o->lo_dev));