Whamcloud - gitweb
LU-8130 lu_object: convert lu_object cache to rhashtable
[fs/lustre-release.git] / lustre / osp / lwp_dev.c
index 6fdf950..188aca0 100644 (file)
@@ -56,7 +56,7 @@ struct lwp_device {
 
 static inline struct lwp_device *lu2lwp_dev(struct lu_device *d)
 {
-       return container_of0(d, struct lwp_device, lpd_dev);
+       return container_of_safe(d, struct lwp_device, lpd_dev);
 }
 
 static inline struct lu_device *lwp2lu_dev(struct lwp_device *d)
@@ -307,10 +307,8 @@ static struct lu_device *lwp_device_free(const struct lu_env *env,
        struct lwp_device *m = lu2lwp_dev(lu);
        ENTRY;
 
-       if (atomic_read(&lu->ld_ref) && lu->ld_site) {
-               LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, D_ERROR, NULL);
-               lu_site_print(env, lu->ld_site, &msgdata, lu_cdebug_printer);
-       }
+       lu_site_print(env, lu->ld_site, &lu->ld_ref, D_ERROR,
+                     lu_cdebug_printer);
        lu_device_fini(&m->lpd_dev);
        OBD_FREE_PTR(m);
        RETURN(NULL);