函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\splice.c Create Date:2022-07-29 10:42:15
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:vmsplice splices a user address range into a pipe. It can be thought of* as splice-from-memory, where the regular splice is splice-from-file (or* to file). In both cases the output is a pipe, naturally.

函数原型:static long vmsplice_to_pipe(struct file *file, struct iov_iter *iter, unsigned int flags)

返回类型:long

参数:

类型参数名称
struct file *file
struct iov_iter *iter
unsigned intflags
1310  ret等于0
1311  buf_flag等于0
1313  如果flags按位与pages passed in are a gift buf_flag等于page is a gift
1316  pipe等于After the inode slimming patch, i_pipe/i_bdev/i_cdev share the same* location, so checking ->i_pipe is not enough to verify that this is a* pipe.
1317  如果非pipe则返回:负EBADF
1320  pipe_lock(pipe)
1321  ret等于wait_for_space(pipe, flags)
1322  如果非retret等于iter_to_pipe(iter, pipe, buf_flag)
1324  pipe_unlock(pipe)
1325  如果ret大于0则wakeup_pipe_readers(pipe)
1327  返回:ret
调用者
名称描述
do_vmspliceNote that vmsplice only really supports true splicing _from_ user memory* to a pipe, not the other way around. Splicing from user memory is a simple* operation that can be supported without any funky alignment restrictions* or nasty vm tricks