函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Create the appropriate buffers when given a page for data area and* the size of each buffer

函数原型:struct buffer_head *alloc_page_buffers(struct page *page, unsigned long size, bool retry)

返回类型:struct buffer_head

参数:

类型参数名称
struct page *page
unsigned longsize
boolretry
858  gfp等于GFP_NOFS按位或__GFP_ACCOUNT
862  如果retrygfp或等于__GFP_NOFAIL
865  memcg等于get_mem_cgroup_from_page: Obtain a reference on given page's memcg.*@page: page from which memcg should be extracted.* Obtain a reference on page->memcg and returns it if successful. Otherwise* root_mem_cgroup is returned.
866  memalloc_use_memcg - Starts the remote memcg charging scope.*@memcg: memcg to charge.* This function marks the beginning of the remote memcg charging scope. All the* __GFP_ACCOUNT allocations till the end of the scope will be charged to the* given memcg.
868  head = NULL
869  offset等于PAGE_SIZE
870 offset减等于size的差大于等于0循环
871  bh等于alloc_buffer_head(gfp)
872  如果非bh则转到:no_grow
875  circular list of page's buffers 等于head
876  start block number 等于负1
877  head等于bh
879  size of mapping 等于size
882  set_bh_page(bh, page, offset)
884  out :
885  memalloc_unuse_memcg - Ends the remote memcg charging scope.* This function marks the end of the remote memcg charging scope started by* memalloc_use_memcg().
886  mem_cgroup_put(memcg)
887  返回:head
891  no_grow :
892  如果head
893  循环
894  bh等于head
897 head循环
900  转到:out
调用者
名称描述
grow_dev_pageCreate the page-cache page that contains the requested block.* This is used purely for blockdev mappings.
create_empty_buffersWe 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.
nobh_write_beginOn entry, the page is fully not uptodate.* On exit the page is fully uptodate in the areas outside (from,to)* The filesystem needs to handle block truncation upon failure.