Whamcloud - gitweb
LU-13974 llog: check stale osp object
[fs/lustre-release.git] / lustre / osp / osp_internal.h
index 5aadd7b..7a4418e 100644 (file)
@@ -460,7 +460,7 @@ static inline int lu_device_is_osp(struct lu_device *d)
 static inline struct osp_device *lu2osp_dev(struct lu_device *d)
 {
        LASSERT(lu_device_is_osp(d));
-       return container_of0(d, struct osp_device, opd_dt_dev.dd_lu_dev);
+       return container_of_safe(d, struct osp_device, opd_dt_dev.dd_lu_dev);
 }
 
 static inline struct lu_device *osp2lu_dev(struct osp_device *d)
@@ -471,13 +471,13 @@ static inline struct lu_device *osp2lu_dev(struct osp_device *d)
 static inline struct osp_device *dt2osp_dev(struct dt_device *d)
 {
        LASSERT(lu_device_is_osp(&d->dd_lu_dev));
-       return container_of0(d, struct osp_device, opd_dt_dev);
+       return container_of_safe(d, struct osp_device, opd_dt_dev);
 }
 
 static inline struct osp_object *lu2osp_obj(struct lu_object *o)
 {
        LASSERT(ergo(o != NULL, lu_device_is_osp(o->lo_dev)));
-       return container_of0(o, struct osp_object, opo_obj.do_lu);
+       return container_of_safe(o, struct osp_object, opo_obj.do_lu);
 }
 
 static inline struct lu_object *osp2lu_obj(struct osp_object *obj)
@@ -488,7 +488,7 @@ static inline struct lu_object *osp2lu_obj(struct osp_object *obj)
 static inline struct osp_object *osp_obj(const struct lu_object *o)
 {
        LASSERT(lu_device_is_osp(o->lo_dev));
-       return container_of0(o, struct osp_object, opo_obj.do_lu);
+       return container_of_safe(o, struct osp_object, opo_obj.do_lu);
 }
 
 static inline struct osp_object *dt2osp_obj(const struct dt_object *d)
@@ -818,6 +818,7 @@ int osp_declare_xattr_del(const struct lu_env *env, struct dt_object *dt,
 int osp_xattr_del(const struct lu_env *env, struct dt_object *dt,
                  const char *name, struct thandle *th);
 int osp_invalidate(const struct lu_env *env, struct dt_object *dt);
+bool osp_check_stale(struct dt_object *dt);
 void osp_obj_invalidate_cache(struct osp_object *obj);
 
 int osp_trans_stop(const struct lu_env *env, struct dt_device *dt,