From 08afc2662742548112f165406b182e325e706165 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 3 Aug 2013 18:06:32 +0000 Subject: [PATCH] fcst: Do not define kref_get_unless_zero() if backported through stable tree git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4934 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- fcst/ft_sess.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/fcst/ft_sess.c b/fcst/ft_sess.c index 4eada9bd7..30e10a773 100644 --- a/fcst/ft_sess.c +++ b/fcst/ft_sess.c @@ -174,8 +174,16 @@ static u32 ft_sess_hash(u32 port_id) return hash_32(port_id, FT_SESS_HASH_BITS); } -#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 7, 0) -/* See also commit 4b20db3 (kref: Implement kref_get_unless_zero v3) */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0) && \ + ! (LINUX_VERSION_CODE >> 8 == KERNEL_VERSION(3, 4, 0) >> 8 && \ + LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 41)) && \ + ! (LINUX_VERSION_CODE >> 8 == KERNEL_VERSION(3, 2, 0) >> 8 && \ + LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 44)) +/* + * See also commit 4b20db3 (kref: Implement kref_get_unless_zero v3 -- v3.8). + * See also commit e3a5505 in branch stable/linux-3.4.y (v3.4.41). + * See also commit 3fa8ee5 in branch stable/linux-3.2.y (v3.2.44). + */ static inline int __must_check kref_get_unless_zero(struct kref *kref) { return atomic_add_unless(&kref->refcount, 1, 0);