]> git.baikalelectronics.ru Git - kernel.git/commit
block: remove bio_rewind_iter()
authorMing Lei <ming.lei@redhat.com>
Wed, 5 Sep 2018 21:45:54 +0000 (15:45 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 6 Sep 2018 21:12:24 +0000 (15:12 -0600)
commit9e66c8ff4ff6a105048e9909f8ec7eb47dac5108
tree5ff1a0f21a48ee3f1c4eae4c2dbc7dd084e59792
parentc8bf34d812c321b3fd0233de749e3a3ef4dabf78
block: remove bio_rewind_iter()

It is pointed that bio_rewind_iter() is one very bad API[1]:

1) bio size may not be restored after rewinding

2) it causes some bogus change, such as c8f3ec6dace320 (block: reset
bi_iter.bi_done after splitting bio)

3) rewinding really makes things complicated wrt. bio splitting

4) unnecessary updating of .bi_done in fast path

[1] https://marc.info/?t=153549924200005&r=1&w=2

So this patch takes Kent's suggestion to restore one bio into its original
state via saving bio iterator(struct bvec_iter) in bio_integrity_prep(),
given now bio_rewind_iter() is only used by bio integrity code.

Cc: Dmitry Monakhov <dmonakhov@openvz.org>
Cc: Hannes Reinecke <hare@suse.com>
Suggested-by: Kent Overstreet <kent.overstreet@gmail.com>
Acked-by: Kent Overstreet <kent.overstreet@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bio-integrity.c
block/bio.c
include/linux/bio.h
include/linux/bvec.h