函数逻辑报告

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

函数名称:nobh_truncate_page

函数原型:int nobh_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
2805  index等于from右移PAGE_SHIFT determines the page size
2806  offset等于from按位与PAGE_SIZE减1
2810  inode等于host
2815  blocksize等于i_blocksize(inode)
2816  length等于offset按位与blocksize减1
2819  如果非length则返回:0
2822  length等于blocksizelength
2823  iblock等于index左移PAGE_SHIFT determines the page size i_blkbits
2825  page等于Returns locked page at given index in given cache, creating it if needed.
2826  err等于负ENOMEM
2827  如果非page则转到:out
2830  如果page_has_buffers(page)则
2831  has_buffers :
2832  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.
2833  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
2834  返回:block_truncate_page(mapping, from, get_block)
2838  pos等于blocksize
2839 offset大于等于pos循环
2840  iblock自加
2841  pos加等于blocksize
2844  size of mapping 等于blocksize
2845  buffer state bitmap (see above) 等于0
2846  err等于get_block(inode, iblock, & map_bh, 0)
2847  如果err则转到:unlock
2850  如果非buffer_mapped( & map_bh)则转到:unlock
2854  如果非PageUptodate(page)则
2855  err等于readpage(NULL, page)
2856  如果err
2858  转到:out
2860  lock_page may only be called if we have the page's inode pinned.
2861  如果非PageUptodate(page)则
2862  err等于负EIO
2863  转到:unlock
2865  如果page_has_buffers(page)则转到:has_buffers
2868  zero_user(page, offset, length)
2869  Dirty a page
2870  err等于0
2872  unlock :
2873  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.
2874  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
2875  out :
2876  返回:err