Thread (62 messages) 62 messages, 5 authors, 2021-07-30

Re: [PATCH v15 05/17] iomap: Convert iomap_page_release to take a folio

From: Matthew Wilcox <willy@infradead.org>
Date: 2021-07-20 11:30:47
Also in: linux-fsdevel, linux-mm

On Tue, Jul 20, 2021 at 08:52:43AM +0200, Christoph Hellwig wrote:
On Mon, Jul 19, 2021 at 07:39:49PM +0100, Matthew Wilcox (Oracle) wrote:
quoted
-static void
-iomap_page_release(struct page *page)
+static void iomap_page_release(struct folio *folio)
 {
-	struct iomap_page *iop = detach_page_private(page);
-	unsigned int nr_blocks = i_blocks_per_page(page->mapping->host, page);
+	struct iomap_page *iop = folio_detach_private(folio);
+	unsigned int nr_blocks = i_blocks_per_folio(folio->mapping->host,
+							folio);
Nit: but I find this variant much easier to read:

	unsigned int nr_blocks =
		i_blocks_per_folio(folio->mapping->host, folio);
Probably even better ...

	struct inode *inode = folio->mapping->host;
	unsigned int nr_blocks = i_blocks_per_folio(inode, folio);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help