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)
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)
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)
static inline struct dt_object *osp_object_child(struct osp_object *o)
{
- return container_of0(lu_object_next(osp2lu_obj(o)),
- struct dt_object, do_lu);
+ return container_of(lu_object_next(osp2lu_obj(o)),
+ struct dt_object, do_lu);
}
static inline struct seq_server_site *osp_seq_site(struct osp_device *osp)
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,