Alan Cox wrote:
> On Thu, 29 Nov 2007 23:33:28 +0900
> Tejun Heo <[EMAIL PROTECTED]> wrote:
> 
>> Depending on how many bytes are transferred as a unit, PIO data
>> tranasfer may consume more bytes than requested.  Knowing how much
>> data is consumed is necessary to determine how much is left for
>> draining.  This patch update ->data_xfer such that it returns the
>> number of consumed bytes.
> 
> Why do we care ? 
> 
> If the drive and controller disagree or the drive has gone off its
> trolley all we actually care about is when the thing stops saying there
> is data. In addition all our methods transfer the entire block they are
> asked to each time.

It's for draining.  Let's say drive says it wanna transfer 18 bytes but
the buffer is only 13 bytes long.  If the transfer method consumes 2
bytes per read, it would consume 14 bytes.  If the transfer method
consumes 4 bytes per read, it would consume 16 bytes.  If we drain too
much, we risk hanging the machine.

-- 
tejun
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to