From 095813cc565732e0dda31c91ed2564719491d507 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 3 Jun 2013 15:41:09 +0000 Subject: [PATCH] fcst: RHEL 6 build fix git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4886 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- fcst/ft_sess.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fcst/ft_sess.c b/fcst/ft_sess.c index 3c92b2160..1e212bb0e 100644 --- a/fcst/ft_sess.c +++ b/fcst/ft_sess.c @@ -174,6 +174,13 @@ 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) +static inline int __must_check kref_get_unless_zero(struct kref *kref) +{ + return atomic_add_unless(&kref->refcount, 1, 0); +} +#endif + /* * Find session in local port. * Sessions and hash lists are RCU-protected. @@ -512,7 +519,7 @@ static void ft_prlo(struct fc_rport_priv *rdata) rdata->prli_count--; } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36) && !defined(RHEL_MAJOR) static inline u32 fc_frame_sid(const struct fc_frame *fp) { return ntoh24(fc_frame_header_get(fp)->fh_s_id);