From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Matthew Wilcox To: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Cc: Matthew Wilcox , Jan Kara , Jeff Layton , Lukas Czerner , Ross Zwisler , Christoph Hellwig , Goldwyn Rodrigues , Nicholas Piggin , Ryusuke Konishi , linux-nilfs@vger.kernel.org, Jaegeuk Kim , Chao Yu , linux-f2fs-devel@lists.sourceforge.net, Oleg Drokin , Andreas Dilger , James Simmons , Mike Kravetz Subject: [PATCH v11 51/63] dax: Fix use of zero page Date: Sat, 14 Apr 2018 07:13:04 -0700 Message-Id: <20180414141316.7167-52-willy@infradead.org> In-Reply-To: <20180414141316.7167-1-willy@infradead.org> References: <20180414141316.7167-1-willy@infradead.org> Sender: owner-linux-mm@kvack.org List-ID: From: Matthew Wilcox Use my_zero_pfn instead of ZERO_PAGE, and pass the vaddr to it so it works on MIPS and s390. Signed-off-by: Matthew Wilcox --- fs/dax.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index e014c99b21fd..b0efb0a9604a 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -909,17 +909,9 @@ static int dax_load_hole(struct address_space *mapping, void *entry, struct inode *inode = mapping->host; unsigned long vaddr = vmf->address; int ret = VM_FAULT_NOPAGE; - struct page *zero_page; void *entry2; - pfn_t pfn; - - zero_page = ZERO_PAGE(0); - if (unlikely(!zero_page)) { - ret = VM_FAULT_OOM; - goto out; - } + pfn_t pfn = pfn_to_pfn_t(my_zero_pfn(vaddr)); - pfn = page_to_pfn_t(zero_page); entry2 = dax_insert_mapping_entry(mapping, vmf, entry, pfn, DAX_ZERO_PAGE, false); if (IS_ERR(entry2)) { -- 2.17.0