Skip to content
Snippets Groups Projects
Commit 657712b4 authored by Nikita Danilov's avatar Nikita Danilov
Browse files

fix lu_device_is_md() assertions.

parent 8bd30505
No related branches found
No related tags found
No related merge requests found
...@@ -167,7 +167,7 @@ struct md_op_spec { ...@@ -167,7 +167,7 @@ struct md_op_spec {
int eadatalen; int eadatalen;
} sp_ea; } sp_ea;
} u; } u;
/** Create flag from client: such as MDS_OPEN_CREAT, and others. */ /** Create flag from client: such as MDS_OPEN_CREAT, and others. */
__u32 sp_cr_flags; __u32 sp_cr_flags;
...@@ -233,7 +233,7 @@ struct md_object_operations { ...@@ -233,7 +233,7 @@ struct md_object_operations {
int (*moo_close)(const struct lu_env *env, struct md_object *obj, int (*moo_close)(const struct lu_env *env, struct md_object *obj,
struct md_attr *ma); struct md_attr *ma);
int (*moo_capa_get)(const struct lu_env *, struct md_object *, int (*moo_capa_get)(const struct lu_env *, struct md_object *,
struct lustre_capa *, int renewal); struct lustre_capa *, int renewal);
int (*moo_object_sync)(const struct lu_env *, struct md_object *); int (*moo_object_sync)(const struct lu_env *, struct md_object *);
...@@ -421,7 +421,7 @@ static inline int lu_device_is_md(const struct lu_device *d) ...@@ -421,7 +421,7 @@ static inline int lu_device_is_md(const struct lu_device *d)
static inline struct md_device *lu2md_dev(const struct lu_device *d) static inline struct md_device *lu2md_dev(const struct lu_device *d)
{ {
LASSERT(lu_device_is_md(d)); LASSERT(IS_ERR(d) || lu_device_is_md(d));
return container_of0(d, struct md_device, md_lu_dev); return container_of0(d, struct md_device, md_lu_dev);
} }
...@@ -432,7 +432,7 @@ static inline struct lu_device *md2lu_dev(struct md_device *d) ...@@ -432,7 +432,7 @@ static inline struct lu_device *md2lu_dev(struct md_device *d)
static inline struct md_object *lu2md(const struct lu_object *o) static inline struct md_object *lu2md(const struct lu_object *o)
{ {
LASSERT(lu_device_is_md(o->lo_dev)); LASSERT(o == NULL || IS_ERR(o) || lu_device_is_md(o->lo_dev));
return container_of0(o, struct md_object, mo_lu); return container_of0(o, struct md_object, mo_lu);
} }
...@@ -443,7 +443,7 @@ static inline struct md_object *md_object_next(const struct md_object *obj) ...@@ -443,7 +443,7 @@ static inline struct md_object *md_object_next(const struct md_object *obj)
static inline struct md_device *md_obj2dev(const struct md_object *o) static inline struct md_device *md_obj2dev(const struct md_object *o)
{ {
LASSERT(lu_device_is_md(o->mo_lu.lo_dev)); LASSERT(o == NULL || IS_ERR(o) || lu_device_is_md(o->mo_lu.lo_dev));
return container_of0(o->mo_lu.lo_dev, struct md_device, md_lu_dev); return container_of0(o->mo_lu.lo_dev, struct md_device, md_lu_dev);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment