函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\buffer.c Create Date:2022-07-29 10:45:20
Last Modify:2020-03-18 10:38:29 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:lock_page_mkwrite() is not allowed to change the file size as it gets* called from a page fault handler when a page is first dirtied

函数原型:int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, get_block_t get_block)

返回类型:int

参数:

类型参数名称
struct vm_area_struct *vma
struct vm_fault *vmf
get_block_tget_block
2499  page等于page
2500  inode等于file_inode(File we map to (can be NULL). )
2505  lock_page may only be called if we have the page's inode pinned.
2506  size等于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
2507  如果 See page-flags.h for PAGE_MAPPING_FLAGS 不等于i_mappingReturn byte-offset into filesystem object for page.大于size
2510  ret等于负EFAULT
2511  转到:out_unlock
2515  如果 Our offset within mapping. 加1左移PAGE_SHIFT determines the page size 位大于sizeend等于size按位与PAGE_MASK的反
2517  否则end等于PAGE_SIZE
2520  ret等于__block_write_begin(page, 0, end, get_block)
2521  如果非retret等于block_commit_write(page, 0, end)
2524  如果此条件成立可能性小(为编译器优化)(ret < 0)则转到:out_unlock
2526  Dirty a page
2527  wait_for_stable_page() - wait for writeback to finish, if necessary.*@page: The page to wait on.* This function determines if the given page is related to a backing device* that requires page contents to be held stable during writeback. If so, then
2528  返回:0
2529  out_unlock :
2530  lock_page - unlock a locked page*@page: the page* Unlocks the page and wakes up sleepers in ___wait_on_page_locked().* Also wakes sleepers in wait_on_page_writeback() because the wakeup* mechanism between PageLocked pages and PageWriteback pages is shared.
2531  返回:ret