diff options
author | Christoph Hellwig <hch@lst.de> | 2024-03-28 09:41:44 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-04-01 19:53:37 +0200 |
commit | c9418adfbabadf7530c034a52e54b31705568f95 (patch) | |
tree | 3b6349431281f52352ea306e6c175b83e020fd5a | |
parent | blk-throttle: Only use seq_printf() in tg_prfill_limit() (diff) | |
download | linux-c9418adfbabadf7530c034a52e54b31705568f95.tar.xz linux-c9418adfbabadf7530c034a52e54b31705568f95.zip |
block: add a bio_list_merge_init helper
This is a simple combination of bio_list_merge + bio_list_init
similar to list_splice_init. While it only saves a single
line in a callers, it makes the move all bios from one list to
another and reinitialize the original pattern a lot more obvious
in the callers.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Matthew Sakai <msakai@redhat.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20240328084147.2954434-2-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | include/linux/bio.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h index 875d792bffff..9b8a369f44bc 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -615,6 +615,13 @@ static inline void bio_list_merge(struct bio_list *bl, struct bio_list *bl2) bl->tail = bl2->tail; } +static inline void bio_list_merge_init(struct bio_list *bl, + struct bio_list *bl2) +{ + bio_list_merge(bl, bl2); + bio_list_init(bl2); +} + static inline void bio_list_merge_head(struct bio_list *bl, struct bio_list *bl2) { |