函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:block_truncate_page

函数原型:int block_truncate_page(struct address_space *mapping, loff_t from, get_block_t *get_block)

返回类型:int

参数:

类型参数名称
struct address_space *mapping
loff_tfrom
get_block_t *get_block
2883  index等于from右移PAGE_SHIFT determines the page size
2884  offset等于from按位与PAGE_SIZE减1
2888  inode等于host
2893  blocksize等于i_blocksize(inode)
2894  length等于offset按位与blocksize减1
2897  如果非length则返回:0
2900  length等于blocksizelength
2901  iblock等于index左移PAGE_SHIFT determines the page size i_blkbits
2903  page等于Returns locked page at given index in given cache, creating it if needed.
2904  err等于负ENOMEM
2905  如果非page则转到:out
2908  如果非page_has_buffers(page)则We attach and possibly dirty the buffers atomically wrt* __set_page_dirty_buffers() via private_lock. try_to_free_buffers* is already excluded via the page lock.
2912  bh等于If we *know* page->private refers to buffer_heads (page)
2913  pos等于blocksize
2914 offset大于等于pos循环
2915  bh等于 circular list of page's buffers
2916  iblock自加
2917  pos加等于blocksize
2920  err等于0
2921  如果非buffer_mapped(bh)则
2922  WARN_ON( size of mapping != blocksize)
2923  err等于get_block(inode, iblock, bh, 0)
2924  如果err则转到:unlock
2927  如果非buffer_mapped(bh)则转到:unlock
2932  如果PageUptodate(page)则Emit the buffer bitops functions. Note that there are also functions* of the form "mark_buffer_foo()". These are higher-level functions which* do something in addition to setting a b_state bit.
2935  如果非Emit the buffer bitops functions. Note that there are also functions* of the form "mark_buffer_foo()". These are higher-level functions which* do something in addition to setting a b_state bit.且非buffer_delay(bh)且非buffer_unwritten(bh)则
2936  err等于负EIO
2937  ll_rw_block: low-level access to block devices (DEPRECATED)*@op: whether to %READ or %WRITE*@op_flags: req_flag_bits*@nr: number of &struct buffer_heads in the array*@bhs: array of pointers to &struct buffer_head* ll_rw_block() takes an array of pointers
2938  wait_on_buffer(bh)
2940  如果非Emit the buffer bitops functions. Note that there are also functions* of the form "mark_buffer_foo()". These are higher-level functions which* do something in addition to setting a b_state bit.则转到:unlock
2944  zero_user(page, offset, length)
2945  mark_buffer_dirty - mark a buffer_head as needing writeout*@bh: the buffer_head to mark dirty* mark_buffer_dirty() will set the dirty bit against the buffer, then set* its backing page dirty, then tag the page as dirty in the page cache* and then attach
2946  err等于0
2948  unlock :
2949  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.
2950  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
2951  out :
2952  返回:err
调用者
名称描述
nobh_truncate_page