Sophie

Sophie

distrib > CentOS > 5 > x86_64 > by-pkgid > ea32411352494358b8d75a78402a4713 > files > 4359

kernel-2.6.18-238.19.1.el5.centos.plus.src.rpm

From: Steve Best <sbest@redhat.com>
Date: Thu, 22 Apr 2010 18:22:24 -0400
Subject: [scsi] ipr: add some defines that are missing in RHEL5.5
Message-id: <20100422181331.16224.41158.sendpatchset@squad5-lp1.lab.bos.redhat.com>
Patchwork-id: 24592
O-Subject: [PATCH RHEL5.6 BZ563589 v2 1/15] ipr adds the scsi_for_each_sg() and
	for_each_sg() defines that are missing in RHEL5
Bugzilla: 563589
RH-Acked-by: Jarod Wilson <jarod@redhat.com>
RH-Acked-by: David Howells <dhowells@redhat.com>

RHBZ#:
======
https://bugzilla.redhat.com/show_bug.cgi?id=563589

Description:
============
Patch 1/15: ipr adds the scsi_for_each_sg() and for_each_sg() defines that are missing in RHEL5

There is not a commit id for this patch.  This patch contains two macro
definitions that have been defined in the kernel SCSI code since 2.6.18, but
have so far not been backported into RHEL 5.  The defines are outside of the
IPR code.

This patch adds the scsi_for_each_sg() and for_each_sg() defines that are
missing in RHEL5

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>

V2 - has this patch now first in the series

Brew:
=====
Built on all platforms. All patches brewed together.
https://brewweb.devel.redhat.com/taskinfo?taskID=2396559

===============================================================
Steve Best
IBM on-site partner

Signed-off-by: Jarod Wilson <jarod@redhat.com>

diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
index b1974a7..0902ebf 100644
--- a/drivers/scsi/ipr.h
+++ b/drivers/scsi/ipr.h
@@ -1566,4 +1566,18 @@ static inline int ipr_sdt_is_fmt2(u32 sdt_word)
 	return 0;
 }
 
+#ifndef for_each_sg
+/*
+ * Loop over each sg element, following the pointer to a new list if necessary
+ */
+#define for_each_sg(sglist, __sg, nr, __i)        \
+	for (__i = 0, __sg = (sglist); __i < (nr); __i++, __sg = sg_next(__sg))
+#endif
+
+#ifndef scsi_for_each_sg
+#define scsi_for_each_sg(cmd, sg, nseg, __i)    \
+	        for_each_sg(scsi_sglist(cmd), sg, nseg, __i)
+#endif
+
+
 #endif