函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__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

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

返回类型:ssize_t

参数:

类型参数名称
struct kiocb *iocb
struct iov_iter *from
3375  file等于文件指针
3376  mapping等于f_mapping
3377  inode等于host
3378  written等于0
3383  backing_dev_info等于inode_to_bdi(inode)
3384  err等于file_remove_privs(file)
3385  如果err则转到:out
3388  err等于file_update_time(file)
3389  如果err则转到:out
3392  如果ki_flags按位与IOCB_DIRECT
3395  written等于generic_file_direct_write(iocb, from)
3403  如果written小于0或非iov_iter_count(from)或IS_DAX(inode)则转到:out
3406  status等于generic_perform_write(file, from, pos = 文件偏移)
3415  err等于status
3416  转到:out
3423  endbyte等于posstatus减1
3424  err等于lemap_write_and_wait_range - write out & wait on a file range*@mapping: the address_space for the pages*@lstart: offset in bytes where the range starts*@lend: offset in bytes where the range ends (inclusive)
3425  如果err恒等于0则
3426  文件偏移等于endbyte加1
3427  written加等于status
3431  否则
3437  否则
3438  written等于generic_perform_write(file, from, 文件偏移)
3439  如果此条件成立可能性大(为编译器优化)(written > 0)则文件偏移加等于written
3442  out :
3443  backing_dev_info = NULL
3444  返回:如果writtenwritten否则err
调用者
名称描述
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
blkdev_write_iterWrite data to the block device. Only intended for the block device itself* and the raw driver which basically is a fake block device.* Does not take i_mutex for the write and thus is not for general purpose* use.