On 29.02.2012 19:54, Paolo Bonzini wrote: > Il 29/02/2012 00:54, Michael Tokarev ha scritto: >> iscsi block driver may receive some additional work. For now, some >> common code has been moved out of iscsi_aio_writev() and iscsi_aio_readv() >> into iscsi_aio_rw_vector(). Leftovers there can be optimized further, >> and consolidated into the rw_vector too. Read and write callbacks are >> consolidated as well, and once the XXX "todo" bounce-buffer change is >> complete the only difference there should go away too. > > What about flush, discard, etc.? > > It seems to me that either we make a single entry point that takes some > kind of BlockRequest, or there is no reason to do partial unification.
Flush and discard are quite special. _All_ drivers provide reads and writes (well, except of the case when the device is read-only by definition). But very few provides discard, and discard is different from reads and writes because it does not take any data. Flush is of the same nature -- it is just request, no data. So for these, separate methods exists and are in use now -- only in these drivers where it is appropriate. The only additional flag or operation which can be passed - which I can think of, anyway - is WRITE_ZEROES. But I think it is more of discard variety than read/write. So there, maybe it is discard method which may be combined with write_zeroes, but not discard and flush combined with reads and writes. Thanks, /mjt