Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\direct-io.c Create Date:2022-07-28 20:15:12
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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

Proto:static int do_direct_IO(struct dio *dio, struct dio_submit *sdio, struct buffer_head *map_bh)

Type:int

Parameter:

TypeParameterName
struct dio *dio
struct dio_submit *sdio
struct buffer_head *map_bh
946  blkbits = doesn't change
947  i_blkbits = blkbits + When 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  When Current offset into the underlyingfile in dio_block units. < doesn't change cycle
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  If IS_ERR(page) Then
956  ret = PTR_ERR(page)
957  Go to out
959  from = If xt page to process Then 0 Else from
960  to = If xt page to process == last valid page + 1 - 1 Then to Else PAGE_SIZE
961  xt page to process ++
963  When from < to cycle
968  If At block_in_file. changes == 0 Then
976  If ret Then
980  If Not buffer_mapped(map_bh) Then Go to do_holes
987  If buffer_new(map_bh) Then
1015  do_holes :
1017  If Not buffer_mapped(map_bh) Then
1058  u = to - from >> blkbits
1059  If this_chunk_blocks > u Then this_chunk_blocks = u
1062  If this_chunk_blocks > u Then this_chunk_blocks = u
1065  BUG_ON(this_chunk_bytes == 0)
1074  If ret Then
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  Return ret
Caller
NameDescribe
do_blockdev_direct_IOThis is a library function for use by filesystem drivers