]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
[BLOCK] drop unnecessary bvec rewinding from flush_dry_bio_endio
authorTejun Heo <htejun@gmail.com>
Tue, 19 Jun 2007 07:18:13 +0000 (09:18 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 10 Jul 2007 06:03:33 +0000 (08:03 +0200)
commitf4b09303d00212ead0619db58d8ec8a0a7a94882
tree43f37ba1c6afe058eac7cdd345cea04ff7b1a851
parent554988d6fe369719ae5b41255c577569ecf47c30
[BLOCK] drop unnecessary bvec rewinding from flush_dry_bio_endio

Barrier bios are completed twice - once after the barrier write itself
is done and again after the whole sequence is complete.
flush_dry_bio_endio() is for the first completion.  It doesn't really
complete the bio.  It rewinds bvec and resets bio so that it can be
completed again when the whole barrier sequence is complete.

The bvec rewinding code has the following problems.

1. The rewinding code is wrong because filesystems may pass bvec with
   non zero bv_offset.

2. The block layer doesn't guarantee anything about the state of
   bvec array on request completion.  bv_offset and len are updated
   iff __end_that_request_first() completes the bvec partially.

Because of #2, #1 doesn't really matter (nobody cares whether bvec is
re-wound correctly or not) but then again by not doing unwinding at
all, we'll always give back the same bvec to the caller as full bvec
completion doesn't alter bvecs and the final completion is always full
completion.

Drop unnecessary rewinding code.

This is spotted by Neil Brown.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Neil Brown <neilb@suse.de>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
block/ll_rw_blk.c