]> git.baikalelectronics.ru Git - kernel.git/commit
block: put the same page when adding it to bio
authorMing Lei <ming.lei@redhat.com>
Sun, 17 Mar 2019 10:01:08 +0000 (18:01 +0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 1 Apr 2019 18:11:34 +0000 (12:11 -0600)
commit136e7be81935056b92449246bc5817db48e2a946
tree6af7ea3cda825066245aedd136a40cd4a31b3c64
parent1417333fc849c36e4859ee213ec66ef799a81cf4
block: put the same page when adding it to bio

When the added page is merged to last same page in bio_add_pc_page(),
the user may need to put this page for avoiding page leak.

bio_map_user_iov() needs this kind of handling, and now it deals with
it by itself in hack style.

Moves the handling of put page into __bio_add_pc_page(), so
bio_map_user_iov() may be simplified a bit, and maybe more users
can benefit from this change.

Cc: Omar Sandoval <osandov@fb.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bio.c
include/linux/bio.h