X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=include%2Flinux%2Flockref.h;h=13dfd36a329474df228102dd49bafbdf1b5c687d;hb=1e27ab4d297fda68b0f2cdb6b274108c2a4a350e;hp=f279ed9a91631cca7f236d20ef5a29d152332932;hpb=896182ad319542e56dcf776565f92cb35c2b4abb;p=karo-tx-linux.git diff --git a/include/linux/lockref.h b/include/linux/lockref.h index f279ed9a9163..13dfd36a3294 100644 --- a/include/linux/lockref.h +++ b/include/linux/lockref.h @@ -36,4 +36,10 @@ extern int lockref_put_or_lock(struct lockref *); extern void lockref_mark_dead(struct lockref *); extern int lockref_get_not_dead(struct lockref *); +/* Must be called under spinlock for reliable results */ +static inline int __lockref_is_dead(const struct lockref *l) +{ + return ((int)l->count < 0); +} + #endif /* __LINUX_LOCKREF_H */