Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\iov_iter.c Create Date:2022-07-28 06:23:20
Last Modify:2022-05-21 11:43:54 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:iov_iter_get_pages_alloc

Proto:ssize_t iov_iter_get_pages_alloc(struct iov_iter *i, struct page ***pages, size_t maxsize, size_t *start)

Type:ssize_t

Parameter:

TypeParameterName
struct iov_iter *i
struct page ***pages
size_tmaxsize
size_t *start
1395  If maxsize > count Then maxsize = count
1398  If Value for the false possibility is greater at compile time(iov_iter_is_pipe(i)) Then Return pipe_get_pages_alloc(i, pages, maxsize, start)
1400  If Value for the false possibility is greater at compile time(iov_iter_is_discard(i)) Then Return -EFAULT
1403  iterate_all_kinds(i, maxsize, v, ({unsignedlongaddr = (unsignedlong)iov_base;size_tlen = iov_len + ( * start = addr & (PAGE_SIZE - 1));intn;intres;addr &= ~(PAGE_SIZE - 1);n = DIV_ROUND_UP(len, PAGE_SIZE);p = get_pages_array(n);If Not p Then Return - ENOMEM;res = get_user_pages_fast(addr, n, iov_iter_rw(i) != WRITE ? check pte is writable : 0, p);If Value for the false possibility is greater at compile time(res < 0) Then {kvfree() - Free memory.*@addr: Pointer to allocated memory.* kvfree frees memory allocated by any of vmalloc(), kmalloc() or kvmalloc().* It is slightly more efficient to use kfree() or vfree() if you are certain* that you know which one to use.;Return res;} * pages = p;Return If res == n Then len Else res * PAGE_SIZE - * start;0;}), ({ * start = bv_offset; * pages = p = get_pages_array(1);If Not p Then Return - ENOMEM;get_page( * p = bv_page);Return bv_len;}), ({Return - EFAULT;}))
1434  Return 0