VirtualBox

Changeset 21807 in vbox for trunk/src/VBox/Devices/Storage


Ignore:
Timestamp:
Jul 27, 2009 11:19:23 AM (16 years ago)
Author:
vboxsync
Message:

Storage/iSCSI: clip read/write block size to sane values, and make sure the caller gets the information how much was actually transferred

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/ISCSIHDDCore.cpp

    r21806 r21807  
    27582758    }
    27592759
     2760    /*
     2761     * Clip read size to a value which is supported by many targets.
     2762     */
     2763    cbToRead = RT_MIN(cbToRead, _256K);
     2764
    27602765    lba = uOffset / pImage->cbSector;
    27612766    tls = (uint16_t)(cbToRead / pImage->cbSector);
     
    27872792    rc = iscsiCommand(pImage, &sr);
    27882793    if (RT_FAILURE(rc))
     2794    {
    27892795        AssertMsgFailed(("iscsiCommand(%s, %#llx) -> %Rrc\n", pImage->pszTargetName, uOffset, rc));
     2796        *pcbActuallyRead = 0;
     2797    }
     2798    else
     2799        *pcbActuallyRead = cbToRead;
    27902800
    27912801out:
     
    28212831    *pcbPreRead = 0;
    28222832    *pcbPostRead = 0;
     2833
     2834    /*
     2835     * Clip write size to a value which is supported by many targets.
     2836     */
     2837    cbToWrite = RT_MIN(cbToWrite, _256K);
    28232838
    28242839    lba = uOffset / pImage->cbSector;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette