函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Performs necessary checks before doing a write* Can adjust writing position or amount of bytes to write.* Returns appropriate error code that caller should return or* zero in case that write should be allowed.

函数原型:inline ssize_t generic_write_checks(struct kiocb *iocb, struct iov_iter *from)

返回类型:ssize_t

参数:

类型参数名称
struct kiocb *iocb
struct iov_iter *from
2940  file等于文件指针
2941  inode等于host
2945  如果IS_SWAPFILE(inode)则返回:负ETXTBSY
2948  如果非iov_iter_count(from)则返回:0
2952  如果ki_flags按位与IOCB_APPEND文件偏移等于NOTE: in a 32bit arch with a preemptable kernel and* an UP compile the i_size_read/write must be atomic* with respect to the local cpu (unlike with preempt disabled),* but they don't need to be atomic with respect to other cpus like in* true SMP (so they
2955  如果ki_flags按位与IOCB_NOWAIT且非ki_flags按位与IOCB_DIRECT的值则返回:负EINVAL
2958  count等于iov_iter_count(from)
2959  ret等于Don't operate on ranges the page cache doesn't support, and don't exceed the* LFS limits. If pos is under the limit it becomes a short access. If it* exceeds the limit we return -EFBIG.
2960  如果ret则返回:ret
2963  Cap the iov_iter by given limit; note that the second argument is* *not* the new size - it's upper limit for such. Passing it a value* greater than the amount of data in iov_iter is fine - it'll just do* nothing in that case.
2964  返回:iov_iter_count(from)
调用者
名称描述
generic_file_write_itergeneric_file_write_iter - write data to a file*@iocb: IO state structure*@from: iov_iter with data to write* This is a wrapper around __generic_file_write_iter() to be used by most* filesystems. It takes care of syncing the file in case of O_SYNC file