block: cleanup direct access on .bi_vcnt & .bi_io_vec
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest27 patches 27 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/27 | block: bio: introduce 4 helpers for cleanupinclude/ | +28 | 6 replies | |
| 2/27 | block: drbd: use bio_get_base_vec() to retrieve the 1st bvecdrivers/ | +3 | 0 replies | |
| 3/27 | block: drbd: remove impossible failure handlingdrivers/ | +1 | 1 reply | |
| 4/27 | block: loop: use bio_get_base_vec() to retrive bvec tabledrivers/ | +3 | 0 replies | |
| 5/27 | block: pktcdvd: use bio_get_base_vec() to retrive bvec tabledrivers/ | +2 | 0 replies | |
| 6/27 | block: floppy: use bio_set_vec_table()drivers/ | +1 | 1 reply | |
| 7/27 | block: floppy: use bio_add_page()drivers/ | +2 | 0 replies | |
| 8/27 | staging: lustre: avoid to use bio->bi_vcnt directlydrivers/ | +5 | 6 replies | |
| 9/27 | target: use bio_is_full()drivers/ | +1 | 2 replies | |
| 10/27 | bcache: debug: avoid to access .bi_io_vec directlydrivers/ | +8 | 0 replies | |
| 11/27 | bcache: io.c: use bio_set_vec_tabledrivers/ | +1 | 4 replies | |
| 12/27 | bcache: journal.c: use bio_set_vec_table()drivers/ | +1 | 0 replies | |
| 13/27 | bcache: movinggc: use bio_set_vec_table()drivers/ | +3 | 0 replies | |
| 14/27 | bcache: writeback: use bio_set_vec_table()drivers/ | +2 | 0 replies | |
| 15/27 | bcache: super: use bio_set_vec_table()drivers/ | +4 | 0 replies | |
| 16/27 | bcache: super: use bio_get_base_vecdrivers/ | +14 | 0 replies | |
| 17/27 | dm: crypt: use bio_add_page()drivers/ | +1 | 1 reply | |
| 18/27 | dm: dm-io.c: use bio_get_base_vec()drivers/ | +6 | 0 replies | |
| 19/27 | dm: dm.c: replace 'bio->bi_vcnt == 1' with !bio_multiple_segmentsdrivers/ | +2 | 0 replies | |
| 20/27 | dm: dm-bufio.c: use bio_set_vec_table()drivers/ | +1 | 2 replies | |
| 21/27 | fs: logfs: use bio_set_vec_table()fs/ | +1 | 1 reply | |
| 22/27 | fs: logfs: convert to bio_add_page() in sync_request()fs/ | +2 | 1 reply | |
| 23/27 | fs: logfs: use bio_add_page() in __bdev_writeseg()fs/ | +21 | 0 replies | |
| 24/27 | fs: logfs: use bio_add_page() in do_erase()fs/ | +18 | 0 replies | |
| 25/27 | fs: logfs: remove unnecesary checkfs/ | +0 | 0 replies | |
| 26/27 | kernel/power/swap.c: use bio_get_base_vec()kernel/ | +9 | 2 replies | |
| 27/27 | mm: page_io.c: use bio_get_base_vec()mm/ | +16 | 0 replies |
Reviews trailers per patch
3 of 27 patches have a Reviewed-by or Acked-by.
| Patch | Christoph Hellwig | Greg Kroah-Hartman |
|---|---|---|
| 1/27 | ||
| 2/27 | ||
| 3/27 | ||
| 4/27 | ||
| 5/27 | ||
| 6/27 | ||
| 7/27 | ||
| 8/27 | A-b | |
| 9/27 | ||
| 10/27 | ||
| 11/27 | ||
| 12/27 | ||
| 13/27 | ||
| 14/27 | ||
| 15/27 | ||
| 16/27 | ||
| 17/27 | R-b | |
| 18/27 | ||
| 19/27 | ||
| 20/27 | ||
| 21/27 | ||
| 22/27 | R-b | |
| 23/27 | ||
| 24/27 | ||
| 25/27 | ||
| 26/27 | ||
| 27/27 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 00/27] block: cleanup direct access on .bi_vcnt & .bi_io_vec
Hi Guys,
It is always not a good practice to access bio->bi_vcnt and bio->bi_io_vec from drivers directly. Also this kind of direct access will cause trouble when converting to multipage bvecs.
The 1st patch introduces the following 4 bio helpers which can be used inside drivers for avoiding direct access to .bi_vcnt and .bi_io_vec.
bio_pages() bio_is_full() bio_get_base_vec() bio_set_vec_table()
Both bio_pages() and bio_is_full() can be easy to convert to multipage bvecs.
For bio_get_base_vec() and bio_set_vec_table(), they are often used during initializing a new bio or in case of single bvec bio. With the two new helpers, it becomes quite easy to audit access to .bi_io_vec and .bi_vcnt.
Most of the other patches use the 4 helpers to clean up most of direct access to .bi_vcnt and .bi_io_vec from drivers, except for MD and btrfs, which two subsystems will be done in the future.
Also bio_add_page() is used in floppy, dm-crypt and fs/logfs to avoiding direct access to .bi_vcnt & .bi_io_vec.
Thanks,
Ming
Ming Lei (27):
block: bio: introduce 4 helpers for cleanup
block: drbd: use bio_get_base_vec() to retrieve the 1st bvec
block: drbd: remove impossible failure handling
block: loop: use bio_get_base_vec() to retrive bvec table
block: pktcdvd: use bio_get_base_vec() to retrive bvec table
block: floppy: use bio_set_vec_table()
block: floppy: use bio_add_page()
staging: lustre: avoid to use bio->bi_vcnt directly
target: use bio_is_full()
bcache: debug: avoid to access .bi_io_vec directly
bcache: io.c: use bio_set_vec_table
bcache: journal.c: use bio_set_vec_table()
bcache: movinggc: use bio_set_vec_table()
bcache: writeback: use bio_set_vec_table()
bcache: super: use bio_set_vec_table()
bcache: super: use bio_get_base_vec
dm: crypt: use bio_add_page()
dm: dm-io.c: use bio_get_base_vec()
dm: dm.c: replace 'bio->bi_vcnt == 1' with !bio_multiple_segments
dm: dm-bufio.c: use bio_set_vec_table()
fs: logfs: use bio_set_vec_table()
fs: logfs: convert to bio_add_page() in sync_request()
fs: logfs: use bio_add_page() in __bdev_writeseg()
fs: logfs: use bio_add_page() in do_erase()
fs: logfs: remove unnecesary check kernel/power/swap.c: use bio_get_base_vec()
mm: page_io.c: use bio_get_base_vec()
drivers/block/drbd/drbd_bitmap.c | 4 +- drivers/block/drbd/drbd_receiver.c | 14 +--- drivers/block/floppy.c | 9 +-- drivers/block/loop.c | 5 +- drivers/block/pktcdvd.c | 3 +- drivers/md/bcache/debug.c | 11 ++- drivers/md/bcache/io.c | 3 +- drivers/md/bcache/journal.c | 3 +- drivers/md/bcache/movinggc.c | 6 +- drivers/md/bcache/super.c | 28 +++++--- drivers/md/bcache/writeback.c | 4 +- drivers/md/dm-bufio.c | 3 +- drivers/md/dm-crypt.c | 8 +-- drivers/md/dm-io.c | 7 +- drivers/md/dm.c | 3 +- drivers/staging/lustre/lustre/llite/lloop.c | 9 +-- drivers/target/target_core_pscsi.c | 2 +- fs/logfs/dev_bdev.c | 107 +++++++++++----------------- include/linux/bio.h | 28 ++++++++ kernel/power/swap.c | 10 ++- mm/page_io.c | 18 ++++- 21 files changed, 156 insertions(+), 129 deletions(-)
Signature · 1 line
1.9.1