On Tue, Aug 26, 2008 at 11:20 AM, v42bis <[EMAIL PROTECTED]> wrote:
>
> Just saw the thread about rhel5 symbol problems, which seems to be my
> issue. Tried to apply the patch from Erez to 869.2 source, but it
> failed :(

Try the attached patch.

Erez

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-iscsi@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/open-iscsi
-~----------~----~----~----~------~----~------~--~---

diff --git a/kernel/2.6.14-19_compat.patch b/kernel/2.6.14-19_compat.patch
index 4d66655..4730afa 100644
--- a/kernel/2.6.14-19_compat.patch
+++ b/kernel/2.6.14-19_compat.patch
@@ -1,9 +1,9 @@
 diff --git a/iscsi_compat.h b/iscsi_compat.h
 new file mode 100644
-index 0000000..965157a
+index 0000000..23ba2ea
 --- /dev/null
 +++ b/iscsi_compat.h
-@@ -0,0 +1,192 @@
+@@ -0,0 +1,216 @@
 +#include <linux/version.h>
 +#include <linux/kernel.h>
 +#include <scsi/scsi.h>
@@ -136,12 +136,21 @@ index 0000000..965157a
 +#endif
 +
 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
-+
++#ifdef RHEL_RELEASE_VERSION
++#if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(5,2)
 +static inline int is_power_of_2(unsigned long n)
 +{
 +	return (n != 0 && ((n & (n - 1)) == 0));
 +}
 +#endif
++#else
++/* not a redhat kernel */
++static inline int is_power_of_2(unsigned long n)
++{
++	return (n != 0 && ((n & (n - 1)) == 0));
++}
++#endif
++#endif
 +
 +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,21)
 +#define netlink_kernel_create(net, uint, groups, input, cb_mutex, mod) \
@@ -180,6 +189,20 @@ index 0000000..965157a
 +#define scsi_sglist(cmd) ((struct scatterlist *)(cmd)->request_buffer)
 +#define scsi_bufflen(cmd) ((cmd)->request_bufflen)
 +
++#ifdef RHEL_RELEASE_VERSION
++#if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(5,2)
++static inline void scsi_set_resid(struct scsi_cmnd *cmd, int resid)
++{
++	cmd->resid = resid;
++}
++
++static inline int scsi_get_resid(struct scsi_cmnd *cmd)
++{
++	return cmd->resid;
++}
++#endif
++#else
++/* not a redhat kernel */
 +static inline void scsi_set_resid(struct scsi_cmnd *cmd, int resid)
 +{
 +	cmd->resid = resid;
@@ -189,6 +212,7 @@ index 0000000..965157a
 +{
 +	return cmd->resid;
 +}
++#endif
 +
 +static inline struct nlmsghdr *nlmsg_hdr(const struct sk_buff *skb)
 +{
-- 
1.5.4.3

Reply via email to