函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:sg_copy_buffer - Copy data between a linear buffer and an SG list*@sgl: The SG list*@nents: Number of SG entries*@buf: Where to copy from*@buflen: The number of bytes to copy*@skip: Number of bytes to skip before copying*@to_buffer: transfer direction

函数原型:size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents, void *buf, size_t buflen, off_t skip, bool to_buffer)

返回类型:size_t

参数:

类型参数名称
struct scatterlist *sgl
unsigned intnents
void *buf
size_tbuflen
off_tskip
boolto_buffer
843  offset等于0
845  sg_flags等于use kmap_atomic
847  如果to_buffersg_flags或等于p
849  否则sg_flags或等于lush back to phys on unmap
852  开始映射迭代一个SG名单
854  如果非sg_miter_skip - reposition mapping iterator*@miter: sg mapping iter to be skipped*@offset: number of bytes to plus the current location* Description:* Sets the offset of @miter to its current location plus @offset bytes则返回:false
857 offset小于buflensg_miter_next - proceed mapping iterator to the next mapping*@miter: sg mapping iter to proceed* Description:* Proceeds @miter to the next mapping. @miter should have been started* using sg_miter_start(). On successful return, @miter->page,循环
860  len等于两数取小( length of the mapped area , buflen - offset)
862  如果to_buffer内存复制(buf + offset, pointer to the mapped area , len)
864  否则内存复制( pointer to the mapped area , buf + offset, len)
867  offset加等于len
870  sg_miter_stop - stop mapping iteration*@miter: sg mapping iter to be stopped* Description:* Stops mapping iterator @miter. @miter should have been started* using sg_miter_start(). A stopped iteration can be resumed by* calling sg_miter_next() on it
872  返回:offset
调用者
名称描述
sg_copy_from_buffer从线性缓冲区拷贝到SG
sg_copy_to_buffer 从SG列表复制到一个线性缓冲区
sg_pcopy_from_buffersg_pcopy_from_buffer - Copy from a linear buffer to an SG list*@sgl: The SG list*@nents: Number of SG entries*@buf: Where to copy from*@buflen: The number of bytes to copy*@skip: Number of bytes to skip before copying* Returns the number of copied bytes.
sg_pcopy_to_buffersg_pcopy_to_buffer - Copy from an SG list to a linear buffer*@sgl: The SG list*@nents: Number of SG entries*@buf: Where to copy to*@buflen: The number of bytes to copy*@skip: Number of bytes to skip before copying* Returns the number of copied bytes.