函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\direct-io.c Create Date:2022-07-29 10:46:35
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:An autonomous function to put a chunk of a page under deferred IO.* The caller doesn't actually know (or care) whether this piece of page is in* a BIO, or is under IO or whatever. We just take care of all possible * situations here

函数原型:static inline int submit_page_section(struct dio *dio, struct dio_submit *sdio, struct page *page, unsigned offset, unsigned len, sector_t blocknr, struct buffer_head *map_bh)

返回类型:int

参数:

类型参数名称
struct dio *dio
struct dio_submit *sdio
struct page *page
unsignedoffset
unsignedlen
sector_tblocknr
struct buffer_head *map_bh
831  ret等于0
833  如果op恒等于REQ_OP_WRITE
837  task_io_account_write(len)
843  如果The page 恒等于pageOffset into it, in bytes Nr of bytes at cur_page_offset 恒等于offsetWhere it starts Nr of bytes at cur_page_offset 右移doesn't change 位的值恒等于blocknr
847  Nr of bytes at cur_page_offset 加等于len
848  转到:out
854  如果The page
855  ret等于Put cur_page under IO
856  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
857  The page = NULL
858  如果ret则返回:ret
862  get_page(page)
863  The page 等于page
864  Offset into it, in bytes 等于offset
865  Nr of bytes at cur_page_offset 等于len
866  Where it starts 等于blocknr
867  Offset in file 等于Current offset into the underlyingfile in dio_block units. 左移doesn't change
868  out :
873  如果prev block is at a boundary
874  ret等于Put cur_page under IO
875  如果 under assembly In the AIO read case we speculatively dirty the pages before starting IO.* During IO completion, any of these pages which happen to have been written* back will be redirtied by bio_check_pages_dirty().
877  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
878  The page = NULL
880  返回:ret
调用者
名称描述
dio_zero_blockIf we are not writing the entire block and get_block() allocated* the block for us, we need to fill-in the unused portion of the* block with zeros
do_direct_IOWalk the user pages, and the file, mapping blocks to disk and generating* a sequence of (page,offset,len,block) mappings. These mappings are injected* into submit_page_section(), which takes care of the next stage of submission