From aec51e803c79f591bc1e2a84246e3adc4bcc87e7 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 19 May 2013 16:58:52 +0000 Subject: [PATCH] fcst: Kernel 3.9 build fix git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4866 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- fcst/ft_sess.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/fcst/ft_sess.c b/fcst/ft_sess.c index 651ba963f..29601a553 100644 --- a/fcst/ft_sess.c +++ b/fcst/ft_sess.c @@ -183,7 +183,9 @@ static struct ft_sess *ft_sess_get(struct fc_lport *lport, u32 port_id) { struct ft_tport *tport; struct hlist_head *head; +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0) struct hlist_node *pos; +#endif struct ft_sess *sess = NULL; rcu_read_lock(); @@ -192,7 +194,11 @@ static struct ft_sess *ft_sess_get(struct fc_lport *lport, u32 port_id) goto out; head = &tport->hash[ft_sess_hash(port_id)]; +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0) hlist_for_each_entry_rcu(sess, pos, head, hash) { +#else + hlist_for_each_entry_rcu(sess, head, hash) { +#endif if (sess->port_id == port_id) { kref_get(&sess->kref); rcu_read_unlock(); @@ -216,7 +222,9 @@ static int ft_sess_create(struct ft_tport *tport, struct fc_rport_priv *rdata, struct ft_sess *sess; struct scst_session *scst_sess; struct hlist_head *head; +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0) struct hlist_node *pos; +#endif u32 port_id; char name[FT_NAMELEN]; @@ -227,7 +235,11 @@ static int ft_sess_create(struct ft_tport *tport, struct fc_rport_priv *rdata, } head = &tport->hash[ft_sess_hash(port_id)]; +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0) hlist_for_each_entry_rcu(sess, pos, head, hash) { +#else + hlist_for_each_entry_rcu(sess, head, hash) { +#endif if (sess->port_id == port_id) { sess->params = fcp_parm; return 0; @@ -288,11 +300,17 @@ static void ft_sess_unhash(struct ft_sess *sess) static struct ft_sess *ft_sess_delete(struct ft_tport *tport, u32 port_id) { struct hlist_head *head; +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0) struct hlist_node *pos; +#endif struct ft_sess *sess; head = &tport->hash[ft_sess_hash(port_id)]; +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0) hlist_for_each_entry_rcu(sess, pos, head, hash) { +#else + hlist_for_each_entry_rcu(sess, head, hash) { +#endif if (sess->port_id == port_id) { ft_sess_unhash(sess); return sess; @@ -537,7 +555,9 @@ int ft_tgt_release(struct scst_tgt *tgt) { struct ft_tport *tport; struct hlist_head *head; +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0) struct hlist_node *pos; +#endif struct ft_sess *sess; tport = scst_tgt_get_tgt_priv(tgt); @@ -545,7 +565,11 @@ int ft_tgt_release(struct scst_tgt *tgt) tport->lport->service_params &= ~FCP_SPPF_TARG_FCN; for (head = tport->hash; head < &tport->hash[FT_SESS_HASH_SIZE]; head++) +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0) hlist_for_each_entry_rcu(sess, pos, head, hash) +#else + hlist_for_each_entry_rcu(sess, head, hash) +#endif ft_sess_close(sess); synchronize_rcu();