Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\gup.c Create Date:2022-07-28 14:35:34
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__gup_longterm_locked() is a wrapper for __get_user_pages_locked which* allows us to process the FOLL_LONGTERM flag.

Proto:static long __gup_longterm_locked(struct task_struct *tsk, struct mm_struct *mm, unsigned long start, unsigned long nr_pages, struct page **pages, struct vm_area_struct **vmas, unsigned int gup_flags)

Type:long

Parameter:

TypeParameterName
struct task_struct *tsk
struct mm_struct *mm
unsigned longstart
unsigned longnr_pages
struct page **pages
struct vm_area_struct **vmas
unsigned intgup_flags
1558  vmas_tmp = vmas
1559  flags = 0
1562  If gup_flags & mapping lifetime is indefinite: see below Then
1563  If Not pages Then Return -EINVAL
1566  If Not vmas_tmp Then
1570  If Not vmas_tmp Then Return -ENOMEM
1573  flags = memalloc_nocma_save()
1576  rc = __get_user_pages_locked(tsk, mm, start, nr_pages, pages, vmas_tmp, NULL, gup_flags)
1579  If gup_flags & mapping lifetime is indefinite: see below Then
1580  memalloc_nocma_restore(flags)
1581  If rc < 0 Then Go to out
1585  When i < rc cycle put_page(pages[i])
1587  rc = -EOPNOTSUPP
1588  Go to out
1591  rc = check_and_migrate_cma_pages(tsk, mm, start, rc, pages, vmas_tmp, gup_flags)
1595  out :
1596  If vmas_tmp != vmas Then kfree(vmas_tmp)
1598  Return rc
Caller
NameDescribe
get_user_pagesThis is the same as get_user_pages_remote(), just with a* less-flexible calling convention where we assume that the task* and mm being operated on are the current task's and don't allow* passing of a locked parameter. We also obviously don't pass
__gup_longterm_unlocked