函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

函数原型:static int do_direct_IO(struct dio *dio, struct dio_submit *sdio, struct buffer_head *map_bh)

返回类型:int

参数:

类型参数名称
struct dio *dio
struct dio_submit *sdio
struct buffer_head *map_bh
946  blkbits等于doesn't change
947  i_blkbits等于blkbitsWhen we're using an alignment whichis finer than the filesystem's softblocksize, this specifies how muchfiner. blkfactor=2 means 1/4-blockalignment. Does not change
948  ret等于0
950 Current offset into the underlyingfile in dio_block units. 小于doesn't change 循环
954  page等于Get another userspace page. Returns an ERR_PTR on error. Pages are* buffered inside the dio so that we can call get_user_pages() against a* decent number of pages, less frequently. To provide nicer use of the* L1 cache.
955  如果是错误
956  ret等于错误
957  转到:out
959  from等于如果xt page to process 则0否则from
960  to等于如果xt page to process 恒等于last valid page + 1 减1则to否则PAGE_SIZE
961  xt page to process 自加
963 from小于to循环
968  如果At block_in_file. changes 恒等于0则
976  如果ret
980  如果非buffer_mapped(map_bh)则转到:do_holes
987  如果buffer_new(map_bh)则
1015  do_holes :
1017  如果非buffer_mapped(map_bh)则
1058  u等于tofrom右移blkbits
1059  如果this_chunk_blocks大于uthis_chunk_blocks等于u
1062  如果this_chunk_blocks大于uthis_chunk_blocks等于u
1065  BUG_ON(this_chunk_bytes == 0)
1074  如果ret
1081  from加等于this_chunk_bytes
1082  IO result 加等于this_chunk_bytes
1084  next_block :
1091  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
1093  out :
1094  返回:ret
调用者
名称描述
do_blockdev_direct_IOThis is a library function for use by filesystem drivers