History

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.

Ming Lei committed 7 years ago

Commit 19047081 parent 59194822 files · +19 −12Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/bio.h+3−0
@@ -432,6 +432,9 @@ void bio_chain(struct bio *, struct bio *); · 431 unmodified lines
432432 extern int bio_add_page(struct bio *, struct page *, unsigned int,unsigned int);
433433 extern int bio_add_pc_page(struct request_queue *, struct bio *, struct page *,
434434 unsigned int, unsigned int);
435+extern int __bio_add_pc_page(struct request_queue *, struct bio *,
436+ struct page *, unsigned int, unsigned int,
437+ bool);
435438 bool __bio_try_merge_page(struct bio *bio, struct page *page,
436439 unsigned int len, unsigned int off, bool same_page);
437440 void __bio_add_page(struct bio *bio, struct page *page,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t