/* * fs/dax.c - Direct Access filesystem code * Copyright (c) 2013-2014 Intel Corporation * Author: Matthew Wilcox <matthew.r.wilcox@intel.com> * Author: Ross Zwisler <ross.zwisler@linux.intel.com> * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. */#include<linux/atomic.h>#include<linux/blkdev.h>#include<linux/buffer_head.h>#include<linux/dax.h>#include<linux/fs.h>#include<linux/genhd.h>#include<linux/highmem.h>#include<linux/memcontrol.h>#include<linux/mm.h>#include<linux/mutex.h>#include<linux/pagevec.h>#include<linux/sched.h>#include<linux/sched/signal.h>#include<linux/uio.h>#include<linux/vmstat.h>#include<linux/pfn_t.h>#include<linux/sizes.h>#include<linux/mmu_notifier.h>#include<linux/iomap.h>#include"internal.h"#define CREATE_TRACE_POINTS#include<trace/events/fs_dax.h>/* We choose 4096 entries - same as per-zone page wait tables */#define DAX_WAIT_TABLE_BITS 12#define DAX_WAIT_TABLE_ENTRIES (1 << DAX_WAIT_TABLE_BITS)staticwait_queue_head_twait_table[DAX_WAIT_TABLE_ENTRIES];staticint__initinit_dax_wait_table(void){inti;for(i=0;i<DAX_WAIT_TABLE_ENTRIES;i++)init_waitqueue_head(wait_table+i);return0;}fs_initcall(init_dax_wait_table);staticintdax_is_pmd_entry(void*entry){return(unsignedlong)entry&RADIX_DAX_PMD;}staticintdax_is_pte_entry(void*entry){return!((unsignedlong)entry&RADIX_DAX_PMD);}staticintdax_is_zero_entry(void*entry){return(unsignedlong)entry&