summaryrefslogtreecommitdiff
path: root/include/linux/bio.h
diff options
context:
space:
mode:
authorMing Lei <ming.lei@redhat.com>2019-03-17 13:01:08 +0300
committerJens Axboe <axboe@kernel.dk>2019-04-01 21:11:34 +0300
commit190470871ae28da7bdb3909f6124385c8472fc97 (patch)
tree6af7ea3cda825066245aedd136a40cd4a31b3c64 /include/linux/bio.h
parent5919482e222908d40279a616b1fe6400549e32b4 (diff)
downloadlinux-190470871ae28da7bdb3909f6124385c8472fc97.tar.xz
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>
Diffstat (limited to 'include/linux/bio.h')
-rw-r--r--include/linux/bio.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h
index bb6090aa165d..bb915591557b 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -432,6 +432,9 @@ void bio_chain(struct bio *, struct bio *);
extern int bio_add_page(struct bio *, struct page *, unsigned int,unsigned int);
extern int bio_add_pc_page(struct request_queue *, struct bio *, struct page *,
unsigned int, unsigned int);
+extern int __bio_add_pc_page(struct request_queue *, struct bio *,
+ struct page *, unsigned int, unsigned int,
+ bool);
bool __bio_try_merge_page(struct bio *bio, struct page *page,
unsigned int len, unsigned int off, bool same_page);
void __bio_add_page(struct bio *bio, struct page *page,