On 11/25/2011 11:05 PM, Jörn Engel wrote:
+ tmp = task->task_lba * dev->se_sub_dev->se_dev_attrib.block_size;
+ req->rd_offset = do_div(tmp, PAGE_SIZE);
+ req->rd_page = tmp;
How about:
byte_offset = task->task_lba * dev->se_sub_dev->se_dev_attrib.block_size;
req->rd_offset = byte_offset& ~PAGE_MASK;
req->rd_page = byte_offset>> PAGE_SHIFT;
I could change tmp to byte_offset if you want. However your & probably
does not compile on 32bit. And for that reason we have do_div() :)
Jörn
Sebastian
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html