Checkpath and compiler fixes
authorvlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Fri, 1 Aug 2008 17:03:24 +0000 (17:03 +0000)
committervlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Fri, 1 Aug 2008 17:03:24 +0000 (17:03 +0000)
git-svn-id: https://scst.svn.sourceforge.net/svnroot/scst/trunk@485 d57e44dd-8a1f-0410-8b47-8ef2f437770f

iscsi-scst/kernel/patches/put_page_callback-2.6.26.patch
qla2x00t/qla_attr.c
qla2x00t/qla_gbl.h
qla2x00t/qla_init.c
qla2x00t/qla_iocb.c
qla2x00t/qla_isr.c
qla2x00t/qla_os.c
scst/kernel/scst_exec_req_fifo-2.6.26.patch
scst/src/dev_handlers/scst_vdisk.c

index c6a36f8..2905b6e 100644 (file)
@@ -221,7 +221,7 @@ diff -upr linux-2.6.26/net/ipv4/tcp_output.c linux-2.6.26/net/ipv4/tcp_output.c
                        skb_shinfo(skb)->frags[k] = skb_shinfo(skb)->frags[i];
 diff -upr linux-2.6.26/net/ipv4/tcp_zero_copy.c linux-2.6.26/net/ipv4/tcp_zero_copy.c
 --- linux-2.6.26/net/ipv4/tcp_zero_copy.c      2008-07-22 20:12:35.000000000 +0400
-+++ linux-2.6.26/net/ipv4/tcp_zero_copy.c      2008-07-29 20:43:46.000000000 +0400
++++ linux-2.6.26/net/ipv4/tcp_zero_copy.c      2008-07-31 21:21:13.000000000 +0400
 @@ -0,0 +1,49 @@
 +/*
 + *    Support routines for TCP zero copy transmit
@@ -236,7 +236,10 @@ diff -upr linux-2.6.26/net/ipv4/tcp_zero_copy.c linux-2.6.26/net/ipv4/tcp_zero_c
 +#include <linux/skbuff.h>
 +
 +net_get_page_callback_t net_get_page_callback __read_mostly;
++EXPORT_SYMBOL(net_get_page_callback);
++
 +net_put_page_callback_t net_put_page_callback __read_mostly;
++EXPORT_SYMBOL(net_put_page_callback);
 +
 +/*
 + * Caller of this function must ensure that at the moment when it's called
@@ -269,9 +272,6 @@ diff -upr linux-2.6.26/net/ipv4/tcp_zero_copy.c linux-2.6.26/net/ipv4/tcp_zero_c
 +      return res;
 +}
 +EXPORT_SYMBOL(net_set_get_put_page_callbacks);
-+
-+EXPORT_SYMBOL(net_get_page_callback);
-+EXPORT_SYMBOL(net_put_page_callback);
 diff -upr linux-2.6.26/net/ipv6/ip6_output.c linux-2.6.26/net/ipv6/ip6_output.c
 --- linux-2.6.26/net/ipv6/ip6_output.c 2008-07-14 01:51:29.000000000 +0400
 +++ linux-2.6.26/net/ipv6/ip6_output.c 2008-07-22 20:28:41.000000000 +0400
@@ -286,7 +286,7 @@ diff -upr linux-2.6.26/net/ipv6/ip6_output.c linux-2.6.26/net/ipv6/ip6_output.c
                                }
 diff -upr linux-2.6.26/net/Kconfig linux-2.6.26/net/Kconfig
 --- linux-2.6.26/net/Kconfig   2008-07-14 01:51:29.000000000 +0400
-+++ linux-2.6.26/net/Kconfig   2008-07-25 21:44:06.000000000 +0400
++++ linux-2.6.26/net/Kconfig   2008-07-29 21:15:39.000000000 +0400
 @@ -62,6 +62,18 @@ config INET
  
          Short answer: say Y.
index 0b40584..75eb330 100644 (file)
@@ -42,9 +42,8 @@ qla2x00_store_tgt_enabled(struct device *dev, struct device_attribute *attr,
        struct scsi_qla_host *ha = shost_priv(class_to_shost(dev));
        int force = 0;
 
-       if (buf == NULL) {
+       if (buf == NULL)
                return size;
-       }
 
        if (qla_target.tgt_host_action == NULL) {
                printk(KERN_INFO "%s: not acting for lack of target driver\n",
@@ -71,14 +70,13 @@ qla2x00_store_tgt_enabled(struct device *dev, struct device_attribute *attr,
                }
                break;
        default:
-               printk("%s: Requested action not understood: %s\n",
+               printk(KERN_INFO "%s: Requested action not understood: %s\n",
                       __func__, buf);
                break;
        }
 
-       if ((size > 2) && (buf[2] == 'r')) {
+       if ((size > 2) && (buf[2] == 'r'))
                set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
-       }
 
        return size;
 }
@@ -101,8 +99,8 @@ qla2x00_show_resource_counts(struct device *dev,
        mc.mb[0] = MBC_GET_RESOURCE_COUNTS;
        mc.out_mb = MBX_0;
        mc.in_mb = MBX_0|MBX_1|MBX_2;
-        mc.tov = 30;
-        mc.flags = 0;
+       mc.tov = 30;
+       mc.flags = 0;
 
        rval = qla2x00_mailbox_command(ha, &mc);
 
@@ -126,11 +124,6 @@ static DEVICE_ATTR(resource_counts,
                         qla2x00_show_resource_counts,
                         NULL);
 
-typedef struct {
-       uint8_t port_name[WWN_SIZE];
-       uint16_t loop_id;
-} port_data_t;
-
 static ssize_t
 qla2x00_show_port_database(struct device *dev,
                         struct device_attribute *attr, char *buf)
@@ -140,12 +133,15 @@ qla2x00_show_port_database(struct device *dev,
        ulong size = 0;
        int rval, i;
        uint16_t entries;
-
        mbx_cmd_t mc;
        dma_addr_t pmap_dma;
-       port_data_t *pmap;
+       struct port_data {
+               uint8_t port_name[WWN_SIZE];
+               uint16_t loop_id;
+       } *pmap;
        ulong dma_size = 0x100*sizeof(*pmap);
-       pmap = (port_data_t *)dma_alloc_coherent(&ha->pdev->dev, dma_size,
+
+       pmap = (struct port_data *)dma_alloc_coherent(&ha->pdev->dev, dma_size,
                                                &pmap_dma, GFP_KERNEL);
        if (pmap == NULL) {
                size = scnprintf(buf, max_size, "DMA Alloc failed of %ld",
@@ -161,8 +157,8 @@ qla2x00_show_port_database(struct device *dev,
        mc.mb[7] = LSW(MSD(pmap_dma));
        mc.out_mb = MBX_0|MBX_1|MBX_2|MBX_3|MBX_6|MBX_7;
        mc.in_mb = MBX_0|MBX_1;
-        mc.tov = 30;
-        mc.flags = MBX_DMA_IN;
+       mc.tov = 30;
+       mc.flags = MBX_DMA_IN;
 
        rval = qla2x00_mailbox_command(ha, &mc);
 
@@ -176,8 +172,9 @@ qla2x00_show_port_database(struct device *dev,
        entries = le16_to_cpu(mc.mb[1])/sizeof(*pmap);
 
        size += scnprintf(buf+size, max_size-size,
-                        "Port Name List (%#04x) returned %d bytes\nL_ID WWPN\n",
-                        MBC_PORT_NODE_NAME_LIST, le16_to_cpu(mc.mb[1]));
+                         "Port Name List (%#04x) returned %d bytes\n"
+                         "L_ID WWPN\n", MBC_PORT_NODE_NAME_LIST,
+                         le16_to_cpu(mc.mb[1]));
 
        for (i = 0; (i < entries) && (size < max_size); ++i) {
                size += scnprintf(buf+size, max_size-size,
@@ -244,7 +241,7 @@ out_free:
 get_id_failed:
        if (size < max_size) {
                fc_port_t *fcport;
-               char * state;
+               char *state;
                char port_type[] = "URSBIT";
 
                size += scnprintf(buf+size, max_size-size,
@@ -254,39 +251,51 @@ get_id_failed:
                        if (size >= max_size)
                                goto out;
                        switch (atomic_read(&fcport->state)) {
-                       case FCS_UNCONFIGURED : state = "Unconfigured"; break;
-                       case FCS_DEVICE_DEAD : state = "Dead"; break;
-                       case FCS_DEVICE_LOST : state = "Lost"; break;
-                       case FCS_ONLINE : state = "Online"; break;
-                       case FCS_NOT_SUPPORTED : state = "Not Supported"; break;
-                       case FCS_FAILOVER : state = "Failover"; break;
-                       case FCS_FAILOVER_FAILED : state = "Failover Failed"; break;
-                       default: state = "Unknown"; break;
+                       case FCS_UNCONFIGURED:
+                               state = "Unconfigured";
+                               break;
+                       case FCS_DEVICE_DEAD:
+                               state = "Dead";
+                               break;
+                       case FCS_DEVICE_LOST:
+                               state = "Lost";
+                               break;
+                       case FCS_ONLINE:
+                               state = "Online";
+                               break;
+                       case FCS_NOT_SUPPORTED:
+                               state = "Not Supported";
+                               break;
+                       case FCS_FAILOVER:
+                               state = "Failover";
+                               break;
+                       case FCS_FAILOVER_FAILED:
+                               state = "Failover Failed";
+                               break;
+                       default:
+                               state = "Unknown";
+                               break;
                        }
 
                        size += scnprintf(buf+size, max_size-size,
-                                        "%04x %02x%02x%02x "
-                                        "%02x%02x%02x%02x%02x%02x%02x%02x "
-                                        "%c %s\n",
-                                        fcport->loop_id,
-                                        fcport->d_id.b.domain,
-                                        fcport->d_id.b.area,
-                                        fcport->d_id.b.al_pa,
-                                        fcport->port_name[0], fcport->port_name[1],
-                                        fcport->port_name[2], fcport->port_name[3],
-                                        fcport->port_name[4], fcport->port_name[5],
-                                        fcport->port_name[6], fcport->port_name[7],
-                                        port_type[fcport->port_type], state);
+                                "%04x %02x%02x%02x "
+                                "%02x%02x%02x%02x%02x%02x%02x%02x "
+                                "%c %s\n",
+                                fcport->loop_id,
+                                fcport->d_id.b.domain,
+                                fcport->d_id.b.area,
+                                fcport->d_id.b.al_pa,
+                                fcport->port_name[0], fcport->port_name[1],
+                                fcport->port_name[2], fcport->port_name[3],
+                                fcport->port_name[4], fcport->port_name[5],
+                                fcport->port_name[6], fcport->port_name[7],
+                                port_type[fcport->port_type], state);
                }
        }
 out:
        return size;
 }
 
-extern int qla2x00_configure_loop(scsi_qla_host_t *);
-extern int qla2x00_configure_local_loop(scsi_qla_host_t *);
-extern int qla2x00_configure_fabric(scsi_qla_host_t *);
-
 static ssize_t
 qla2x00_update_portdb(struct device *dev, struct device_attribute *attr,
                      const char *buf, size_t size)
@@ -1163,7 +1172,7 @@ struct device_attribute *qla2x00_host_attrs[] = {
 #ifdef CONFIG_SCSI_QLA2XXX_TARGET
        &dev_attr_target_mode_enabled,
        &dev_attr_resource_counts,
-       &dev_attr_port_database,        
+       &dev_attr_port_database,
 #endif
        NULL,
 };
index e721301..1dbb7fa 100644 (file)
@@ -49,6 +49,10 @@ extern void qla2x00_try_to_stop_firmware(scsi_qla_host_t *);
 
 extern void qla84xx_put_chip(struct scsi_qla_host *);
 
+extern int qla2x00_configure_loop(scsi_qla_host_t *ha);
+extern int qla2x00_configure_local_loop(scsi_qla_host_t *ha);
+extern int qla2x00_configure_fabric(scsi_qla_host_t *ha);
+
 /*
  * Global Data in qla_os.c source file.
  */
index 7f262bc..0a41873 100644 (file)
@@ -29,9 +29,6 @@ static void qla2x00_init_response_q_entries(scsi_qla_host_t *);
 static int qla2x00_init_rings(scsi_qla_host_t *);
 static int qla2x00_fw_ready(scsi_qla_host_t *);
 static int qla2x00_configure_hba(scsi_qla_host_t *);
-int qla2x00_configure_loop(scsi_qla_host_t *);
-int qla2x00_configure_local_loop(scsi_qla_host_t *);
-int qla2x00_configure_fabric(scsi_qla_host_t *);
 static int qla2x00_find_all_fabric_devs(scsi_qla_host_t *, struct list_head *);
 static int qla2x00_device_resync(scsi_qla_host_t *);
 static int qla2x00_fabric_dev_login(scsi_qla_host_t *, fc_port_t *, uint16_t *);
@@ -630,8 +627,8 @@ qla2x00_chip_diag(scsi_qla_host_t *ha)
 
        if (!IS_QLA23XX(ha)) {
                /*
-                * We need to have a delay here since the card will not respond while
-                * in reset causing an MCA on some architectures.
+                * We need to have a delay here since the card will not respond
+                * while in reset causing an MCA on some architectures.
                 */
                udelay(30);
                data = qla2x00_debounce_register(&reg->ctrl_status);
@@ -644,8 +641,8 @@ qla2x00_chip_diag(scsi_qla_host_t *ha)
                if (!cnt)
                        goto chip_diag_failed;
 
-               DEBUG3(printk("scsi(%ld): Reset register cleared by chip reset\n",
-                             ha->host_no));
+               DEBUG3(printk(KERN_INFO "scsi(%ld): Reset register cleared by "
+                       "chip reset\n", ha->host_no));
 
        } else {
                /*
@@ -4205,13 +4202,13 @@ __qla2x00_disable_lun(scsi_qla_host_t *ha)
 int
 __qla2x00_issue_marker(scsi_qla_host_t *ha)
 {
-        /* Send marker if required */
-        if (ha->marker_needed != 0) {
+       /* Send marker if required */
+       if (ha->marker_needed != 0) {
                if (__qla2x00_marker(ha, 0, 0, MK_SYNC_ALL) != QLA_SUCCESS)
-                       return (QLA_FUNCTION_FAILED);
-                ha->marker_needed = 0;
-        }
-        return (QLA_SUCCESS);
+                       return QLA_FUNCTION_FAILED;
+               ha->marker_needed = 0;
+       }
+       return QLA_SUCCESS;
 }
 
 int
@@ -4257,15 +4254,15 @@ qla2x00_req_cont_pkt(scsi_qla_host_t *ha)
 
 int
 qla2xxx_tgt_register_driver(struct qla2x_tgt_initiator *tgt_data,
-                               struct qla2x_tgt_targetinit_data)
+                               struct qla2x_tgt_target *init_data)
 {
        int res = 0;
 
        ENTER(__func__);
 
        if ((tgt_data == NULL) || (tgt_data->magic != QLA2X_TARGET_MAGIC)) {
-               printk("***ERROR*** Wrong version of the target driver: %d\n",
-                       tgt_data->magic);
+               printk(KERN_INFO "***ERROR*** Wrong version of the target "
+                       "driver: %d\n", tgt_data->magic);
                res = -EINVAL;
                goto out;
        }
index 7d30c85..3b4a8ef 100644 (file)
@@ -12,7 +12,6 @@
 #include <scsi/scsi_tcq.h>
 
 request_t *qla2x00_req_pkt(scsi_qla_host_t *ha);
-void qla2x00_isp_cmd(scsi_qla_host_t *ha);
 
 /**
  * qla2x00_get_cmd_direction() - Determine control_flag data direction.
index 471bb53..a116fd7 100644 (file)
@@ -365,7 +365,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
                set_bit(RESET_MARKER_NEEDED, &ha->dpc_flags);
 #ifdef CONFIG_SCSI_QLA2XXX_TARGET
                if (qla_target.tgt_async_event)
-                        qla_target.tgt_async_event(mb[0], ha, mb);
+                       qla_target.tgt_async_event(mb[0], ha, mb);
 #endif
                break;
 
@@ -394,7 +394,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
                        set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
 #ifdef CONFIG_SCSI_QLA2XXX_TARGET
                if (qla_target.tgt_async_event)
-                        qla_target.tgt_async_event(mb[0], ha, mb);
+                       qla_target.tgt_async_event(mb[0], ha, mb);
 #endif
                break;
 
@@ -407,7 +407,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
                set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
 #ifdef CONFIG_SCSI_QLA2XXX_TARGET
                if (qla_target.tgt_async_event)
-                        qla_target.tgt_async_event(mb[0], ha, mb);
+                       qla_target.tgt_async_event(mb[0], ha, mb);
 #endif
                break;
 
@@ -420,7 +420,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
                set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
 #ifdef CONFIG_SCSI_QLA2XXX_TARGET
                if (qla_target.tgt_async_event)
-                        qla_target.tgt_async_event(mb[0], ha, mb);
+                       qla_target.tgt_async_event(mb[0], ha, mb);
 #endif
                break;
 
@@ -429,7 +429,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
                    ha->host_no));
 #ifdef CONFIG_SCSI_QLA2XXX_TARGET
                if (qla_target.tgt_async_event)
-                        qla_target.tgt_async_event(mb[0], ha, mb);
+                       qla_target.tgt_async_event(mb[0], ha, mb);
 #endif
                break;
 
@@ -456,7 +456,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
                qla2x00_post_aen_work(ha, FCH_EVT_LIP, mb[1]);
 #ifdef CONFIG_SCSI_QLA2XXX_TARGET
                if (qla_target.tgt_async_event)
-                        qla_target.tgt_async_event(mb[0], ha, mb);
+                       qla_target.tgt_async_event(mb[0], ha, mb);
 #endif
                break;
 
@@ -480,7 +480,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
                qla2x00_post_aen_work(ha, FCH_EVT_LINKUP, ha->link_data_rate);
 #ifdef CONFIG_SCSI_QLA2XXX_TARGET
                if (qla_target.tgt_async_event)
-                        qla_target.tgt_async_event(mb[0], ha, mb);
+                       qla_target.tgt_async_event(mb[0], ha, mb);
 #endif
                break;
 
@@ -507,7 +507,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
                qla2x00_post_aen_work(ha, FCH_EVT_LINKDOWN, 0);
 #ifdef CONFIG_SCSI_QLA2XXX_TARGET
                if (qla_target.tgt_async_event)
-                        qla_target.tgt_async_event(mb[0], ha, mb);
+                       qla_target.tgt_async_event(mb[0], ha, mb);
 #endif
                break;
 
@@ -535,7 +535,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
                qla2x00_post_aen_work(ha, FCH_EVT_LIPRESET, mb[1]);
 #ifdef CONFIG_SCSI_QLA2XXX_TARGET
                if (qla_target.tgt_async_event)
-                        qla_target.tgt_async_event(mb[0], ha, mb);
+                       qla_target.tgt_async_event(mb[0], ha, mb);
 #endif
                break;
 
@@ -573,7 +573,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
                ha->flags.management_server_logged_in = 0;
 #ifdef CONFIG_SCSI_QLA2XXX_TARGET
                if (qla_target.tgt_async_event)
-                        qla_target.tgt_async_event(mb[0], ha, mb);
+                       qla_target.tgt_async_event(mb[0], ha, mb);
 #endif
                break;
 
@@ -604,7 +604,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
                set_bit(LOCAL_LOOP_UPDATE, &ha->dpc_flags);
 #ifdef CONFIG_SCSI_QLA2XXX_TARGET
                if (qla_target.tgt_async_event)
-                        qla_target.tgt_async_event(mb[0], ha, mb);
+                       qla_target.tgt_async_event(mb[0], ha, mb);
 #endif
                break;
 
@@ -626,7 +626,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
                            mb[2], mb[3]));
 #ifdef CONFIG_SCSI_QLA2XXX_TARGET
                        if (qla_target.tgt_async_event)
-                               qla_target.tgt_async_event(mb[0], ha, mb);
+                               qla_target.tgt_async_event(mb[0], ha, mb);
 #endif
                        break;
                }
@@ -650,7 +650,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
                set_bit(LOCAL_LOOP_UPDATE, &ha->dpc_flags);
 #ifdef CONFIG_SCSI_QLA2XXX_TARGET
                if (qla_target.tgt_async_event)
-                        qla_target.tgt_async_event(mb[0], ha, mb);
+                       qla_target.tgt_async_event(mb[0], ha, mb);
 #endif
                break;
 
@@ -698,7 +698,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
                qla2x00_post_aen_work(ha, FCH_EVT_RSCN, rscn_entry);
 #ifdef CONFIG_SCSI_QLA2XXX_TARGET
                if (qla_target.tgt_async_event)
-                        qla_target.tgt_async_event(mb[0], ha, mb);
+                       qla_target.tgt_async_event(mb[0], ha, mb);
 #endif
                break;
 
@@ -916,13 +916,13 @@ qla2x00_process_response_queue(struct scsi_qla_host *ha)
 
                switch (pkt->entry_type) {
 #ifdef CONFIG_SCSI_QLA2XXX_TARGET
-                case ACCEPT_TGT_IO_TYPE:
-                case CONTINUE_TGT_IO_TYPE:
-                case CTIO_A64_TYPE:
-                case IMMED_NOTIFY_TYPE:
-                case NOTIFY_ACK_TYPE:
-                case ENABLE_LUN_TYPE:
-                case MODIFY_LUN_TYPE:
+               case ACCEPT_TGT_IO_TYPE:
+               case CONTINUE_TGT_IO_TYPE:
+               case CTIO_A64_TYPE:
+               case IMMED_NOTIFY_TYPE:
+               case NOTIFY_ACK_TYPE:
+               case ENABLE_LUN_TYPE:
+               case MODIFY_LUN_TYPE:
                        DEBUG4(printk(KERN_WARNING
                                      "qla2x00_response_pkt: "
                                      "calling tgt_response_pkt %p "
@@ -930,9 +930,7 @@ qla2x00_process_response_queue(struct scsi_qla_host *ha)
                                      qla_target.tgt_response_pkt,
                                      pkt->entry_type););
                        if (qla_target.tgt_response_pkt)
-                       {
                                qla_target.tgt_response_pkt(ha, pkt);
-                       }
                        break;
 #endif /* CONFIG_SCSI_QLA2XXX_TARGET */
                case STATUS_TYPE:
index 11df40e..732aaa9 100644 (file)
@@ -1784,7 +1784,7 @@ qla2x00_stop_dpc_thread(scsi_qla_host_t *ha)
                ha->dpc_thread = NULL;
        }
        spin_unlock_irq(&ha->dpc_lock);
-               
+
        if (t != NULL)
                kthread_stop(t);
 }
index f2c6734..882cf78 100644 (file)
@@ -1,6 +1,6 @@
-diff -upkr linux-2.6.26/drivers/scsi/scsi_lib.c linux-2.6.26/drivers/scsi/scsi_lib.c
+diff -upr linux-2.6.26/drivers/scsi/scsi_lib.c linux-2.6.26/drivers/scsi/scsi_lib.c
 --- linux-2.6.26/drivers/scsi/scsi_lib.c       2008-07-14 01:51:29.000000000 +0400
-+++ linux-2.6.26/drivers/scsi/scsi_lib.c       2008-07-22 20:24:44.000000000 +0400
++++ linux-2.6.26/drivers/scsi/scsi_lib.c       2008-07-31 21:20:00.000000000 +0400
 @@ -372,7 +372,7 @@ free_bios:
  }
  
@@ -36,7 +36,7 @@ diff -upkr linux-2.6.26/drivers/scsi/scsi_lib.c linux-2.6.26/drivers/scsi/scsi_l
        return 0;
  
  free_req:
-@@ -435,8 +438,53 @@ free_sense:
+@@ -435,8 +438,55 @@ free_sense:
        kmem_cache_free(scsi_io_context_cache, sioc);
        return DRIVER_ERROR << 24;
  }
@@ -55,8 +55,9 @@ diff -upkr linux-2.6.26/drivers/scsi/scsi_lib.c linux-2.6.26/drivers/scsi/scsi_l
 + * @flags:    or into request flags
 + **/
 +int scsi_execute_async(struct scsi_device *sdev, const unsigned char *cmd,
-+                     int cmd_len, int data_direction, void *buffer, unsigned bufflen,
-+                     int use_sg, int timeout, int retries, void *privdata,
++                     int cmd_len, int data_direction, void *buffer,
++                     unsigned bufflen, int use_sg, int timeout,
++                     int retries, void *privdata,
 +                     void (*done)(void *, char *, int, int), gfp_t gfp)
 +{
 +      return __scsi_execute_async(sdev, cmd, cmd_len, data_direction, buffer,
@@ -78,8 +79,9 @@ diff -upkr linux-2.6.26/drivers/scsi/scsi_lib.c linux-2.6.26/drivers/scsi/scsi_l
 + * @flags:    or into request flags
 + **/
 +int scsi_execute_async_fifo(struct scsi_device *sdev, const unsigned char *cmd,
-+                     int cmd_len, int data_direction, void *buffer, unsigned bufflen,
-+                     int use_sg, int timeout, int retries, void *privdata,
++                     int cmd_len, int data_direction, void *buffer,
++                     unsigned bufflen, int use_sg, int timeout, int retries,
++                     void *privdata,
 +                     void (*done)(void *, char *, int, int), gfp_t gfp)
 +{
 +      return __scsi_execute_async(sdev, cmd, cmd_len, data_direction, buffer,
@@ -90,17 +92,18 @@ diff -upkr linux-2.6.26/drivers/scsi/scsi_lib.c linux-2.6.26/drivers/scsi/scsi_l
  /*
   * Function:    scsi_init_cmd_errh()
   *
-diff -upkr linux-2.6.26/include/scsi/scsi_device.h linux-2.6.26/include/scsi/scsi_device.h
+diff -upr linux-2.6.26/include/scsi/scsi_device.h linux-2.6.26/include/scsi/scsi_device.h
 --- linux-2.6.26/include/scsi/scsi_device.h    2008-07-14 01:51:29.000000000 +0400
-+++ linux-2.6.26/include/scsi/scsi_device.h    2008-07-22 20:24:44.000000000 +0400
-@@ -333,6 +333,13 @@ extern int scsi_execute_async(struct scs
++++ linux-2.6.26/include/scsi/scsi_device.h    2008-07-31 21:20:39.000000000 +0400
+@@ -333,6 +333,14 @@ extern int scsi_execute_async(struct scs
                              int timeout, int retries, void *privdata,
                              void (*done)(void *, char *, int, int),
                              gfp_t gfp);
 +#define SCSI_EXEC_REQ_FIFO_DEFINED
 +extern int scsi_execute_async_fifo(struct scsi_device *sdev,
-+                            const unsigned char *cmd, int cmd_len, int data_direction,
-+                            void *buffer, unsigned bufflen, int use_sg,
++                            const unsigned char *cmd, int cmd_len,
++                            int data_direction, void *buffer,
++                            unsigned bufflen, int use_sg,
 +                            int timeout, int retries, void *privdata,
 +                            void (*done)(void *, char *, int, int),
 +                            gfp_t gfp);
index fefe288..c342aef 100644 (file)
@@ -2182,7 +2182,7 @@ restart:
                }
                full_len -= err;
                for (i = 0; i < e; i++) {
-                       if (eiv->iov_len < err) {
+                       if ((long long)eiv->iov_len < err) {
                                err -= eiv->iov_len;
                                eiv++;
                                eiv_count--;