Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\memfd.c Create Date:2022-07-28 16:37:55
Last Modify:2022-05-20 10:27:46 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Setting SEAL_WRITE requires us to verify there's no pending writer. However,* via get_user_pages(), drivers might have some pending I/O without any active* user-space mappings (eg., direct-IO, AIO). Therefore, we look at all pages

Proto:static int memfd_wait_for_pins(struct address_space *mapping)

Type:int

Parameter:

TypeParameterName
struct address_space *mapping
68  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, 0)
72  memfd_tag_pins( & xas)
74  error = 0
75  When scan <= about 150ms max cycle
76  tagged = 0
78  If Not xas_marked( & xas, We need a tag: a new tag would expand every xa_node by 8 bytes,* so reuse a tag which we firmly believe is never set or cleared on tmpfs* or hugetlbfs because they are memory only filesystems.) Then Break
81  If Not scan Then lru_add_drain_all()
83  Else if schedule_timeout_killable((HZ << scan) / 200) Then scan = about 150ms max
86  xas_set() - Set up XArray operation state for a different index
87  xas_lock_irq( & xas)
89  bool clear = true
90  If xa_is_value() - Determine if an entry is a value.*@entry: XArray entry.* Context: Any context.* Return: True if the entry is a value, false if it is a pointer. Then Continue
92  page = find_subpage(page, xa_index)
93  If page_count(page) - page_mapcount(page) != 1 Then
99  If scan == about 150ms max Then error = -EBUSY
101  Else clear = false
104  If clear Then xas_clear_mark() - Clears the mark on this entry and its parents.*@xas: XArray operation state.*@mark: Mark number.* Clears the specified mark on this entry, and walks back to the head* attempting to clear it on all the ancestor entries. Does nothing if
106  If ++tagged % XA_CHECK_SCHED Then Continue
109  xas_pause() - Pause a walk to drop a lock.*@xas: XArray operation state.* Some users need to pause a walk and drop the lock they're holding in* order to yield to a higher priority thread or carry out an operation* on an entry
110  xas_unlock_irq( & xas)
111  cond_resched()
112  xas_lock_irq( & xas)
114  xas_unlock_irq( & xas)
117  Return error
Caller
NameDescribe
memfd_add_seals