函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\hugetlb.c Create Date:2022-07-27 17:01:39
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:hugetlb_reserve_pages

函数原型:int hugetlb_reserve_pages(struct inode *inode, long from, long to, struct vm_area_struct *vma, vm_flags_t vm_flags)

返回类型:int

参数:

类型参数名称
struct inode *inode
longfrom
longto
struct vm_area_struct *vma
vm_flags_tvm_flags
4545  h等于hstate_inode(inode)
4546  spool等于subpool_inode(inode)
4551  如果from大于to
4552  VM_WARN(1, "%s called with a negative range\n", __func__)
4553  返回:负EINVAL
4561  如果vm_flags按位与should the VM suppress accounting 则返回:0
4570  如果非vmaFlags, see mm.h. 按位与VM_MAYSHARE
4576  resv_map等于inode_resv_map(inode)
4578  chg等于Examine the existing reserve map and determine how many* huge pages in the specified range [f, t) are NOT currently* represented. This routine is called before a subsequent* call to region_add that will actually modify the reserve
4580  否则
4581  resv_map等于resv_map_alloc()
4582  如果非resv_map则返回:负ENOMEM
4585  chg等于tofrom
4587  set_vma_resv_map(vma, resv_map)
4588  set_vma_resv_flags(vma, Flags for MAP_PRIVATE reservations. These are stored in the bottom* bits of the reservation map pointer, which are always clear due to* alignment.)
4591  如果chg小于0则
4592  ret等于chg
4593  转到:out_err
4601  gbl_reserve等于Subpool accounting for allocating and reserving pages
4602  如果gbl_reserve小于0则
4603  ret等于负ENOSPC
4604  转到:out_err
4611  ret等于Forward declaration
4612  如果ret小于0则
4614  Subpool accounting for freeing and unreserving pages.* Return the number of global page reservations that must be dropped.* The return value may only be different than the passed value (delta)* in the case where a subpool minimum size must be maintained.
4615  转到:out_err
4629  如果非vmaFlags, see mm.h. 按位与VM_MAYSHARE
4630  add等于Add the huge page range represented by [f, t) to the reserve* map
4647  返回:0
4648  out_err :
4649  如果非vmaFlags, see mm.h. 按位与VM_MAYSHARE则如果chg大于等于0则
4652  Abort the in progress add operation. The adds_in_progress field* of the resv_map keeps track of the operations in progress between* calls to region_chg and region_add. Operations are sometimes* aborted after the call to region_chg
4653  如果vmais_vma_resv_set(vma, Flags for MAP_PRIVATE reservations. These are stored in the bottom* bits of the reservation map pointer, which are always clear due to* alignment.)则kref_put - decrement refcount for object.*@kref: object.*@release: pointer to the function that will clean up the object when the* last reference to the object is released.* This pointer is required, and it is not acceptable to pass kfree
4655  返回:ret