函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\memfd.c Create Date:2022-07-27 18:13:16
Last Modify:2022-05-20 10:27:46 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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

函数原型:static int memfd_wait_for_pins(struct address_space *mapping)

返回类型:int

参数:

类型参数名称
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 scan小于等于about 150ms max 循环
76  tagged等于0
78  如果非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.)则退出
81  如果非scanlru_add_drain_all()
83  否则如果schedule_timeout_killable((HZ << scan) / 200)则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  如果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.则继续下一循环
92  page等于find_subpage(page, xa_index)
93  如果page_count(page)减page_mapcount(page)不等于1则
99  如果scan恒等于about 150ms max error等于负EBUSY
101  否则clear = false
104  如果clearxas_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  如果tagged先自加取模XA_CHECK_SCHED则继续下一循环
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  返回:error
调用者
名称描述
memfd_add_seals