X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lnet%2Finclude%2Flnet%2Flib-lnet.h;h=c5310554b9f29273cd2dbaa6f51cff4f9c040d88;hp=176c9a2b3385bbe1c037c045f389242c989ff3c4;hb=e520ee276800362caa652088b56325fac16aef7f;hpb=f6cd6a880cd03fd1d3fd3d8e03133f0835ad275d diff --git a/lnet/include/lnet/lib-lnet.h b/lnet/include/lnet/lib-lnet.h index 176c9a2..c531055 100644 --- a/lnet/include/lnet/lib-lnet.h +++ b/lnet/include/lnet/lib-lnet.h @@ -375,18 +375,15 @@ lnet_peer_decref_locked(struct lnet_peer *lp) static inline void lnet_peer_ni_addref_locked(struct lnet_peer_ni *lp) { - LASSERT(atomic_read(&lp->lpni_refcount) > 0); - atomic_inc(&lp->lpni_refcount); + kref_get(&lp->lpni_kref); } -extern void lnet_destroy_peer_ni_locked(struct lnet_peer_ni *lp); +extern void lnet_destroy_peer_ni_locked(struct kref *ref); static inline void lnet_peer_ni_decref_locked(struct lnet_peer_ni *lp) { - LASSERT(atomic_read(&lp->lpni_refcount) > 0); - if (atomic_dec_and_test(&lp->lpni_refcount)) - lnet_destroy_peer_ni_locked(lp); + kref_put(&lp->lpni_kref, lnet_destroy_peer_ni_locked); } static inline int