Whamcloud - gitweb
LU-6142 lustre: convert use of container_of0 in include/
[fs/lustre-release.git] / lustre / include / md_object.h
index a54af3e..baafdc4 100644 (file)
@@ -204,11 +204,16 @@ struct md_layout_change {
                        __u32                   *mlc_resync_ids;
                }; /* file */
                struct {
-                       struct md_object        *mlc_parent;    /* parent obj in plain dir split */
-                       struct md_object        *mlc_target;    /* target obj in plain dir split */
-                       struct lu_attr          *mlc_attr;      /* target attr in plain dir split */
-                       const struct lu_name    *mlc_name;      /* target name in plain dir split */
-                       struct md_op_spec       *mlc_spec;      /* dir split spec */
+                       /* parent obj in plain dir split */
+                       struct md_object        *mlc_parent;
+                       /* target obj in plain dir split */
+                       struct md_object        *mlc_target;
+                       /* target attr in plain dir split */
+                       struct lu_attr          *mlc_attr;
+                       /* target name in plain dir split */
+                       const struct lu_name    *mlc_name;
+                       /* dir split spec */
+                       struct md_op_spec       *mlc_spec;
                }; /* dir */
        };
 };
@@ -379,8 +384,8 @@ struct md_object {
 
 static inline struct md_device *lu2md_dev(const struct lu_device *d)
 {
-        LASSERT(IS_ERR(d) || lu_device_is_md(d));
-        return container_of0(d, struct md_device, md_lu_dev);
+       LASSERT(IS_ERR(d) || lu_device_is_md(d));
+       return container_of_safe(d, struct md_device, md_lu_dev);
 }
 
 static inline struct lu_device *md2lu_dev(struct md_device *d)
@@ -390,8 +395,8 @@ static inline struct lu_device *md2lu_dev(struct md_device *d)
 
 static inline struct md_object *lu2md(const struct lu_object *o)
 {
-        LASSERT(o == NULL || IS_ERR(o) || lu_device_is_md(o->lo_dev));
-        return container_of0(o, struct md_object, mo_lu);
+       LASSERT(o == NULL || IS_ERR(o) || lu_device_is_md(o->lo_dev));
+       return container_of_safe(o, struct md_object, mo_lu);
 }
 
 static inline int md_device_init(struct md_device *md, struct lu_device_type *t)