Function report |
Source Code:mm\mlock.c |
Create Date:2022-07-28 14:46:06 |
Last Modify:2022-05-23 14:12:58 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:user_shm_lock
Proto:int user_shm_lock(size_t size, struct user_struct *user)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
size_t | size | |
struct user_struct * | user |
848 | allowed = 0 |
850 | locked = size + PAGE_SIZE - 1 >> PAGE_SHIFT determines the page size |
851 | lock_limit = rlimit(RLIMIT_MEMLOCK) |
852 | If lock_limit == RLIM_INFINITY Then allowed = 1 |
855 | spin_lock( & Objects with different lifetime than processes (SHM_LOCK and SHM_HUGETLB* shm segments) get accounted against the user_struct instead.) |
856 | If Not allowed && locked + How many pages of mlocked shm ? > lock_limit && Not Check operation authority Then Go to out |
861 | allowed = 1 |
862 | out : |
863 | spin_unlock( & Objects with different lifetime than processes (SHM_LOCK and SHM_HUGETLB* shm segments) get accounted against the user_struct instead.) |
864 | Return allowed |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |