函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\page_io.c Create Date:2022-07-27 16:44:06
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:__swap_writepage

函数原型:int __swap_writepage(struct page *page, struct writeback_control *wbc, bio_end_io_t end_write_func)

返回类型:int

参数:

类型参数名称
struct page *page
struct writeback_control *wbc
bio_end_io_tend_write_func
283  sis等于page_swap_info(page)
285  VM_BUG_ON_PAGE(!PageSwapCache(page), page)
286  如果SWP_USED etc: see above 按位与SWP_FS
288  swap_file等于seldom referenced
289  mapping等于f_mapping
290  struct bio_vec bv = {bv_page = page, bv_len = PAGE_SIZE, bv_offset = 0}
297  iov_iter_bvec( & from, WRITE, & bv, 1, PAGE_SIZE)
298  init_sync_kiocb( & kiocb, swap_file)
299  文件偏移等于page_file_offset(page)
301  set_page_writeback(page)
302  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.
303  ret等于direct_IO( & kiocb, & from)
304  如果ret恒等于PAGE_SIZE
306  ret等于0
307  否则
318  Dirty a page
320  pr_err_ratelimited("Write error on dio swapfile (%llu)\n", page_file_offset(page))
323  d_page_writeback - end writeback against a page*@page: the page
324  返回:ret
327  ret等于dev_write_page() - Start writing a page to a block device*@bdev: The device to write the page to*@sector: The offset on the device to write the page to (need not be aligned)*@page: The page to write*@wbc: The writeback_control for the write
328  如果非ret
329  count_swpout_vm_event(page)
330  返回:0
333  ret等于0
334  bio等于get_swap_bio(GFP_NOIO, page, end_write_func)
335  如果(bio == NULL)则
336  Dirty a page
337  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.
338  ret等于负ENOMEM
339  转到:out
341  bottom bits req flags, * top bits REQ_OP. Use * accessors.等于REQ_OP_WRITE按位或REQ_SWAP按位或wbc_to_write_flags(wbc)
342  bio_associate_blkg_from_page(bio, page)
343  count_swpout_vm_event(page)
344  set_page_writeback(page)
345  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.
346  submit_bio(bio)
347  out :
348  返回:ret
调用者
名称描述
swap_writepageWe may have stale swap cache pages in memory: notice* them here and get rid of the unnecessary final write.
zswap_writeback_entry