Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\kfifo.c Create Date:2022-07-28 06:24:40
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:setup_sgl_buf

Proto:static int setup_sgl_buf(struct scatterlist *sgl, void *buf, int nents, unsigned int len)

Type:int

Parameter:

TypeParameterName
struct scatterlist *sgl
void *buf
intnents
unsigned intlen
303  If Not nents Then Return 0
306  If Not len Then Return 0
309  n = 0
310  page = virt_to_page(kaddr) returns a valid pointer if and only if* virt_addr_valid(kaddr) returns true.(buf)
311  off = offset_in_page(buf)
312  l = 0
314  When len >= l + PAGE_SIZE - off cycle
317  l += PAGE_SIZE
318  buf += PAGE_SIZE
319  npage = virt_to_page(kaddr) returns a valid pointer if and only if* virt_addr_valid(kaddr) returns true.(buf)
323  If (++n == nents || sgl == NULL) Then Return n
325  page = npage
326  len -= l - off
327  l = off = 0
330  sg_set_page - Set sg entry to point at given page*@sg: SG entry*@page: The page*@len: Length of data*@offset: Offset into page* Description:* Use this function to set an sg entry pointing at a page, never assign* the page directly
331  Return n + 1
Caller
NameDescribe
setup_sgl