Re: [RFC PATCH 6/9] iomap: use set/clear_fs_page_private

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/27/20 2:26 AM, Matthew Wilcox wrote:
On Sun, Apr 26, 2020 at 11:49:22PM +0200, Guoqing Jiang wrote:
@@ -59,24 +59,18 @@ iomap_page_create(struct inode *inode, struct page *page)
  	 * migrate_page_move_mapping() assumes that pages with private data have
  	 * their count elevated by 1.
  	 */
-	get_page(page);
-	set_page_private(page, (unsigned long)iop);
-	SetPagePrivate(page);
-	return iop;
+	return (struct iomap_page *)set_fs_page_private(page, iop);
  }
This cast is unnecessary.  void * will be automatically cast to the
appropriate pointer type.

@@ -556,11 +550,9 @@ iomap_migrate_page(struct address_space *mapping, struct page *newpage,
if (page_has_private(page)) {
  		ClearPagePrivate(page);
-		get_page(newpage);
-		set_page_private(newpage, page_private(page));
+		set_fs_page_private(newpage, (void *)page_private(page));
  		set_page_private(page, 0);
  		put_page(page);
-		SetPagePrivate(newpage);
  	}
Same comment here as for the btrfs migrate page that Dave reviewed.

Yes, thanks for the review.

Thanks,
Guoqing



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux