函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:generic_perform_write

函数原型:ssize_t generic_perform_write(struct file *file, struct iov_iter *i, loff_t pos)

返回类型:ssize_t

参数:

类型参数名称
struct file *file
struct iov_iter *i
loff_tpos
3271  mapping等于f_mapping
3272  a_ops等于a_ops
3273  status等于0
3274  written等于0
3275  flags等于0
3277  循环
3284  offset等于pos按位与PAGE_SIZE减1
3285  bytes等于min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(unsignedlong, PAGE_SIZE - offset, iov_iter_count(i))
3288  again :
3300  status等于负EFAULT
3301  退出
3305  status等于负EINTR
3306  退出
3309  status等于write_begin(file, mapping, pos, bytes, flags, & page, & fsdata)
3311  如果此条件成立可能性小(为编译器优化)(status < 0)则退出
3314  如果Might pages of this file have been modified in userspace?* Note that i_mmap_writable counts all VM_SHARED vmas: do_mmap_pgoff* marks vma as VM_SHARED if it is shared, and the file was opened for* writing iflush_dcache_page(page)
3317  copied等于iov_iter_copy_from_user_atomic(page, i, offset, bytes)
3318  flush_dcache_page(page)
3320  status等于write_end(file, mapping, pos, bytes, copied, page, fsdata)
3322  如果此条件成立可能性小(为编译器优化)(status < 0)则退出
3324  copied等于status
3326  cond_resched()
3328  iov_iter_advance(i, copied)
3340  转到:again
3342  pos加等于copied
3343  written加等于copied
3345  balance_dirty_pages_ratelimited(mapping)
3346 iov_iter_count(i)循环
3348  返回:如果writtenwritten否则status
调用者
名称描述
__generic_file_write_iter__generic_file_write_iter - write data to a file*@iocb: IO state structure (file, offset, etc.)*@from: iov_iter with data to write* This function does all the work needed for actually writing data to a* file