• Andrew Morton's avatar
    [PATCH] clarify meaning of bio fields in the end_io function · 1fbe06d4
    Andrew Morton authored
    From: Christophe Saout <christophe@saout.de>
    
    The intent of these are to clarify the meaning of the bio fields in the
    bi_end_io function (since we are already mostly there).  After these small
    modifications bio->bi_idx and the corresponding bio_iovec(bio)->bv_offset
    point to the beginning of the completed data, together with the nr_bytes
    argument you know exactly what data was finished, e.g.  when you can't
    track it otherwise (or it would be unnecessary expensive).  Apart from that
    it's a nice-to-have.
    
    The first mini-patch moves the update of bio_iovec(bio)->bv_offset and
    ->bv_len after the call of bi_end_io where bi_idx gets updated so they get
    updated together.  Ok with Jens.
    
    The second part of the patch modifies the multwrite hack in PIO non-
    taskfile ide disk code.  It modifies the bi_idx field to walk the bios and
    doesn't reset it correctly before ending the request.  The patch uses the
    segment counter in the request field to correctly restore the bi_idx field
    before ending the request.  Can't possibly break anything since it's
    working on the local request copy ("scratchpad") anyway.  Also does this in
    legacy/pdc4030.c (similar code).  The code modified here is going to die
    anyway any trying to fix it would be too invasive.  Ok with Bartlomiej.
    1fbe06d4
pdc4030.c 24 KB