Re: [PATCH 8/9] bio: add bvec_iter rewind API

From: Martin K. Petersen
Date: Wed Apr 19 2017 - 22:51:37 EST


Dmitry Monakhov <dmonakhov@xxxxxxxxxx> writes:

Dmitry,

> Some ->bi_end_io handlers (for example: pi_verify or decrypt handlers)
> need to know original data vector, but after bio traverse io-stack it
> may be advanced, splited and relocated many times so it is hard to
> guess original iterator. Let's add 'bi_done' conter which accounts
> number of bytes iterator was advanced during it's evolution. Later
> end_io handler may easily restore original iterator by rewinding
> iterator to iter->bi_done.

Originally, the original integrity bip was immutable. Any slicing and
dicing was exclusively done on clones. And therefore the original bip
was always suitable for use with verify.

--
Martin K. Petersen Oracle Linux Engineering