VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Matthew Wilcox (Oracle) <willy@infradead.org> 2020-09-21 08:58:39 -0700 committer: Darrick J. Wong <darrick.wong@oracle.com> 2020-09-21 08:59:26 -0700 commit: a6901d4d148dcbad7efb3174afbdf68c995618c2 parent: 24addd848a45747bcda68418710c72fdc8e145e4
Commit Summary:
iomap: Use kzalloc to allocate iomap_page
Diffstat:
1 file changed, 1 insertion, 8 deletions
diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index dd0739606dce..d1caea4c5fba 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -49,16 +49,8 @@ iomap_page_create(struct inode *inode, struct page *page)
 	if (iop || i_blocks_per_page(inode, page) <= 1)
 		return iop;
 
-	iop = kmalloc(sizeof(*iop), GFP_NOFS | __GFP_NOFAIL);
-	atomic_set(&iop->read_count, 0);
-	atomic_set(&iop->write_count, 0);
+	iop = kzalloc(sizeof(*iop), GFP_NOFS | __GFP_NOFAIL);
 	spin_lock_init(&iop->uptodate_lock);
-	bitmap_zero(iop->uptodate, PAGE_SIZE / SECTOR_SIZE);
-
-	/*
-	 * migrate_page_move_mapping() assumes that pages with private data have
-	 * their count elevated by 1.
-	 */
 	attach_page_private(page, iop);
 	return iop;
 }