函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\read_write.c Create Date:2022-07-29 10:31:22
Last Modify:2020-03-18 10:18:51 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:vfs_write

函数原型:ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_t *pos)

返回类型:ssize_t

参数:

类型参数名称
struct file *file
const char __user *buf
size_tcount
loff_t *pos
546  如果非f_mode按位与le is open for writing 的值则返回:负EBADF
548  如果非f_mode按位与Has write method(s) 的值则返回:负EINVAL
550  如果此条件成立可能性小(为编译器优化)(!access_ok - Checks if a user space pointer is valid*@addr: User space pointer to start of block to check*@size: Size of block to check* Context: User context only. This function may sleep if pagefaults are* enabled.(buf, count))则返回:负EFAULT
553  ret等于rw_verify_area(WRITE, file, pos, count)
554  如果非ret
555  如果count大于MAX_RW_COUNTcount等于MAX_RW_COUNT
557  file_start_write(file)
558  ret等于__vfs_write(file, buf, count, pos)
559  如果ret大于0则
563  inc_syscw(当前进程)
564  file_end_write(file)
567  返回:ret
调用者
名称描述
kernel_write
ksys_write
ksys_pwrite64