Thread (18 messages) 18 messages, 2 authors, 2020-05-15

Re: [PATCH v2 06/10] mm/swap: use npage_to_sectors() and PAGE_SECTORS to clean up code

From: Matthew Wilcox <willy@infradead.org>
Date: 2020-05-15 04:15:06
Also in: dm-devel, linux-block, linux-mm, lkml

On Thu, May 07, 2020 at 03:50:56PM +0800, Zhen Lei wrote:
quoted hunk ↗ jump to hunk
+++ b/mm/page_io.c
@@ -38,7 +38,7 @@ static struct bio *get_swap_bio(gfp_t gfp_flags,
 
 		bio->bi_iter.bi_sector = map_swap_page(page, &bdev);
 		bio_set_dev(bio, bdev);
-		bio->bi_iter.bi_sector <<= PAGE_SHIFT - 9;
+		bio->bi_iter.bi_sector *= PAGE_SECTORS;
 		bio->bi_end_io = end_io;
This just doesn't look right.  Why is map_swap_page() returning a sector_t
which isn't actually a sector_t?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help