Whamcloud - gitweb
LU-17705 ptlrpc: replace synchronize_rcu() with rcu_barrier()
[fs/lustre-release.git] / lustre / obdclass / local_storage.h
index 7ff6faa..2353650 100644 (file)
@@ -42,7 +42,7 @@ struct ls_device {
        /* all initialized ls_devices on this node linked by this */
        struct list_head         ls_linkage;
        /* how many handle's reference this local storage */
-       atomic_t                 ls_refcount;
+       struct kref              ls_refcount;
        /* underlaying OSD device */
        struct dt_device        *ls_osd;
        /* list of all local OID storages */
@@ -52,7 +52,7 @@ struct ls_device {
 
 static inline struct ls_device *dt2ls_dev(struct dt_device *d)
 {
-       return container_of0(d, struct ls_device, ls_top_dev);
+       return container_of_safe(d, struct ls_device, ls_top_dev);
 }
 
 struct ls_object {
@@ -62,7 +62,7 @@ struct ls_object {
 
 static inline struct ls_object *lu2ls_obj(struct lu_object *o)
 {
-       return container_of0(o, struct ls_object, ls_obj.do_lu);
+       return container_of_safe(o, struct ls_object, ls_obj.do_lu);
 }
 
 static inline struct dt_object *ls_locate(const struct lu_env *env,
@@ -74,7 +74,7 @@ static inline struct dt_object *ls_locate(const struct lu_env *env,
                            &ls->ls_top_dev.dd_lu_dev, conf);
 }
 
-struct ls_device *ls_device_get(struct dt_device *dev);
+struct ls_device *ls_device_find_or_init(struct dt_device *dev);
 void ls_device_put(const struct lu_env *env, struct ls_device *ls);
 struct local_oid_storage *dt_los_find(struct ls_device *ls, __u64 seq);
 void dt_los_put(struct local_oid_storage *los);