函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\dax.c Create Date:2022-07-29 10:56:32
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:dax_iomap_pte_fault

函数原型:static vm_fault_t dax_iomap_pte_fault(struct vm_fault *vmf, pfn_t *pfnp, int *iomap_errp, const struct iomap_ops *ops)

返回类型:vm_fault_t

参数:

类型参数名称
struct vm_fault *vmf
pfn_t *pfnp
int *iomap_errp
const struct iomap_ops *ops
1248  vma等于vma
1249  mapping等于f_mapping
1250  XA_STATE() - Declare an XArray operation state.*@name: Name of this operation state (usually xas).*@array: Array to operate on.*@index: Initial index of interest.* Declare and initialise an xa_state on the stack.(xas, & i_pages, pgoff)
1251  inode等于host
1252  vaddr等于address
1253  pos等于pgoff左移PAGE_SHIFT determines the page size
1254  struct iomap iomap = { type of mapping = blocks allocated, need allocation }
1255  struct iomap srcmap = { type of mapping = blocks allocated, need allocation }
1256  flags等于mapping for page fault
1257  major等于0
1258  write等于flags按位与Fault was a write access
1260  ret等于0
1264  trace_dax_pte_fault(inode, vmf, ret)
1270  如果pos大于等于NOTE: in a 32bit arch with a preemptable kernel and* an UP compile the i_size_read/write must be atomic* with respect to the local cpu (unlike with preempt disabled),* but they don't need to be atomic with respect to other cpus like in* true SMP (so they
1271  ret等于VM_FAULT_SIGBUS
1272  转到:out
1275  如果write且非cow_pageflags或等于writing, must allocate blocks
1278  entry等于Find page cache entry at given index. If it is a DAX entry, return it* with the entry locked. If the page cache doesn't contain an entry at* that index, add a locked empty entry.* When requesting an entry with size DAX_PMD, grab_mapping_entry() will
1279  如果xa_is_internal() - Is the entry an internal entry?*@entry: XArray entry.* Context: Any context.* Return: %true if the entry is an internal entry.
1280  ret等于xa_to_internal() - Extract the value from an internal entry.*@entry: XArray entry.* Context: Any context.* Return: The value which was stored in the internal entry.
1281  转到:out
1290  如果pmd_trans_huge( * pmd)或pmd_devmap( * pmd)则
1291  ret等于VM_FAULT_NOPAGE
1292  转到:unlock_entry
1300  error等于iomap_begin(inode, pos, PAGE_SIZE, flags, & iomap, & srcmap)
1301  如果iomap_errpiomap_errp等于error
1303  如果error
1304  ret等于dax_fault_return(error)
1305  转到:unlock_entry
1307  如果WARN_ON_ONCE( file offset of mapping, bytes + length of mapping, bytes < pos + PAGE_SIZE)则
1308  error等于负EIO
1309  转到:error_finish_iomap
1312  如果cow_page
1313  sector等于dax_iomap_sector( & iomap, pos)
1316  : type of mapping 恒等于 blocks allocated, need allocation
1319  退出
1323  退出
1324  默认
1325  WARN_ON_ONCE(1)
1326  error等于负EIO
1327  退出
1330  如果error则转到:error_finish_iomap
1333  __SetPageUptodate(cow_page)
1334  ret等于sh_fault - finish page fault once we have prepared the page to fault*@vmf: structure describing the fault* This function handles all that is needed to finish a page fault once the* page to fault in is prepared
1335  如果非retret等于VM_FAULT_DONE_COW
1337  转到:finish_iomap
1340  sync等于MAP_SYNC on a dax mapping guarantees dirty metadata is* flushed on write-faults (non-cow), but not read-faults.
1343  : type of mapping 恒等于locks allocated at @addr
1347  major等于VM_FAULT_MAJOR
1349  error等于dax_iomap_pfn( & iomap, pos, PAGE_SIZE, & pfn)
1350  如果error小于0则转到:error_finish_iomap
1353  entry等于By this point grab_mapping_entry() has ensured that we have a locked entry* of the appropriate size so we don't have to worry about downgrading PMDs to* PTEs
1362  如果sync
1363  如果WARN_ON_ONCE(!pfnp)则
1364  error等于负EIO
1365  转到:error_finish_iomap
1367  pfnp等于pfn
1368  ret等于VM_FAULT_NEEDDSYNC按位或major
1369  转到:finish_iomap
1371  trace_dax_insert_mapping(inode, vmf, entry)
1372  如果writeret等于If the insertion of PTE failed because someone else already added a* different entry in the mean time, we treat that as success as we assume* the same entry was actually inserted.
1374  否则ret等于vmf_insert_mixed(vma, vaddr, pfn)
1377  转到:finish_iomap
1378  : type of mapping 恒等于locks allocated at @addr in unwritten state
1379  : type of mapping 恒等于 blocks allocated, need allocation
1380  如果非write
1382  转到:finish_iomap
1385  默认
1386  WARN_ON_ONCE(1)
1387  error等于负EIO
1388  退出
1391  error_finish_iomap :
1392  ret等于dax_fault_return(error)
1393  finish_iomap :
1394  如果iomap_end
1395  copied等于PAGE_SIZE
1397  如果ret按位与VM_FAULT_ERRORcopied等于0
1405  iomap_end(inode, pos, PAGE_SIZE, copied, flags, & iomap)
1407  unlock_entry :
1408  We used the xa_state to get the entry, but then we locked the entry and* dropped the xa_lock, so we know the xa_state is stale and must be reset* before use.
1409  out :
1410  trace_dax_pte_fault_done(inode, vmf, ret)
1411  返回:ret按位或major
调用者
名称描述
dax_iomap_faultdax_iomap_fault - handle a page fault on a DAX file*@vmf: The description of the fault*@pe_size: Size of the page to fault in*@pfnp: PFN to insert for synchronous faults if fsync is required*@iomap_errp: Storage for detailed error code in case of