Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

block: Correct comments on bio_alloc_clone() and bio_init_clone()

Correct the comments that the cloned bio must be freed before the memory
pointed to by @bio_src->bi_io_vecs (is freed).

Christoph Hellwig contributed most the of the update wording.

Signed-off-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

John Garry and committed by
Jens Axboe
d0e5fc70 b0e497db

+6 -7
+6 -7
block/bio.c
··· 897 897 * @gfp: allocation priority 898 898 * @bs: bio_set to allocate from 899 899 * 900 - * Allocate a new bio that is a clone of @bio_src. The caller owns the returned 901 - * bio, but not the actual data it points to. 902 - * 903 - * The caller must ensure that the return bio is not freed before @bio_src. 900 + * Allocate a new bio that is a clone of @bio_src. This reuses the bio_vecs 901 + * pointed to by @bio_src->bi_io_vec, and clones the iterator pointing to 902 + * the current position in it. The caller owns the returned bio, but not 903 + * the bio_vecs, and must ensure the bio is freed before the memory 904 + * pointed to by @bio_Src->bi_io_vecs. 904 905 */ 905 906 struct bio *bio_alloc_clone(struct block_device *bdev, struct bio *bio_src, 906 907 gfp_t gfp, struct bio_set *bs) ··· 930 929 * @gfp: allocation priority 931 930 * 932 931 * Initialize a new bio in caller provided memory that is a clone of @bio_src. 933 - * The caller owns the returned bio, but not the actual data it points to. 934 - * 935 - * The caller must ensure that @bio_src is not freed before @bio. 932 + * The same bio_vecs reuse and bio lifetime rules as bio_alloc_clone() apply. 936 933 */ 937 934 int bio_init_clone(struct block_device *bdev, struct bio *bio, 938 935 struct bio *bio_src, gfp_t gfp)