Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\filemap.c Create Date:2022-07-28 14:03:31
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__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

Proto:ssize_t __generic_file_write_iter(struct kiocb *iocb, struct iov_iter *from)

Type:ssize_t

Parameter:

TypeParameterName
struct kiocb *iocb
struct iov_iter *from
3375  file = ki_filp
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  If err Then Go to out
3388  err = file_update_time(file)
3389  If err Then Go to out
3392  If ki_flags & IOCB_DIRECT Then
3395  written = generic_file_direct_write(iocb, from)
3403  If written < 0 || Not iov_iter_count(from) || IS_DAX(inode) Then Go to out
3406  status = generic_perform_write(file, from, pos = The 'ki_filp' pointer is shared in a union for aio )
3415  err = status
3416  Go to out
3423  endbyte = pos + status - 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  If err == 0 Then
3427  written += status
3431  Else
3437  Else
3438  written = generic_perform_write(file, from, The 'ki_filp' pointer is shared in a union for aio )
3439  If Value is more likely to compile time(written > 0) Then The 'ki_filp' pointer is shared in a union for aio += written
3442  out :
3443  backing_dev_info = NULL
3444  Return If written Then written Else err
Caller
NameDescribe
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