Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\dax.c Create Date:2022-07-28 20:23:12
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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

Proto:static void *grab_mapping_entry(struct xa_state *xas, struct address_space *mapping, unsigned int order)

Type:void

Parameter:

TypeParameterName
struct xa_state *xas
struct address_space *mapping
unsigned intorder
479  index = xa_index
480  bool pmd_downgrade = false
483  retry :
484  xas_lock_irq(xas)
485  entry = Look up entry in page cache, wait for it to become unlocked if it* is a DAX entry and return it. The caller must subsequently call* put_unlocked_entry() if it did not lock the entry or dax_unlock_entry()* if it did
487  If entry Then
488  If rue if the entry that was found is of a smaller order than the entry* we were looking for Then Go to fallback
492  Go to out_unlock
495  If order == 0 Then
499  pmd_downgrade = true
504  If pmd_downgrade Then
509  Return: The entry stored at this location before it was locked.
516  If dax_is_zero_entry(entry) Then
522  xas_lock_irq(xas)
525  dax_disassociate_entry(entry, mapping, false)
526  xas_store() - Store this entry in the XArray
527  @entry may no longer be the entry at the index in the mapping.* The important information it's conveying is whether the entry at* this index used to be a PMD entry.
528  nrexceptional--
529  entry = NULL
530  xas_set() - Set up XArray operation state for a different index
533  If entry Then
534  Return: The entry stored at this location before it was locked.
535  Else
536  flags = DAX_EMPTY
538  If order > 0 Then flags |= DAX_PMD
540  entry = dax_make_entry(a default pfn to pfn_t conversion assumes that @pfn is pfn_valid() , flags)
541  Return: The entry stored at this location before it was locked.
542  If xas_error() - Return an errno stored in the xa_state.*@xas: XArray operation state.* Return: 0 if no error has been noted. A negative errno if one has. Then Go to out_unlock
544  nrexceptional++
547  out_unlock :
548  xas_unlock_irq(xas)
549  If xas_nomem() - Allocate memory if needed.*@xas: XArray operation state.*@gfp: Memory allocation flags.* If we need to add new nodes to the XArray, we try to allocate memory* with GFP_NOWAIT while holding the lock, which will usually succeed. Then Go to retry
551  If xa_node == We encode errnos in the xas->xa_node. If an error has happened, we need to* drop the lock to fix it, and once we've done so the xa_state is invalid.( - ENOMEM) Then Return xa_mk_internal() - Create an internal entry.*@v: Value to turn into an internal entry.* Internal entries are used for a number of purposes. Entries 0-255 are* used for sibling entries (only 0-62 are used by the current code). 256
553  If xas_error() - Return an errno stored in the xa_state.*@xas: XArray operation state.* Return: 0 if no error has been noted. A negative errno if one has. Then Return xa_mk_internal() - Create an internal entry.*@v: Value to turn into an internal entry.* Internal entries are used for a number of purposes. Entries 0-255 are* used for sibling entries (only 0-62 are used by the current code). 256
555  Return entry
556  fallback :
557  xas_unlock_irq(xas)
558  Return xa_mk_internal() - Create an internal entry.*@v: Value to turn into an internal entry.* Internal entries are used for a number of purposes. Entries 0-255 are* used for sibling entries (only 0-62 are used by the current code). 256
Caller
NameDescribe
dax_iomap_pte_fault