Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

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

Type:ssize_t

Parameter:

TypeParameterName
struct kiocb *iocb
struct iov_iter *from
2940  file = ki_filp
2941  inode = host
2945  If IS_SWAPFILE(inode) Then Return -ETXTBSY
2948  If Not iov_iter_count(from) Then Return 0
2952  If ki_flags & IOCB_APPEND Then The 'ki_filp' pointer is shared in a union for aio = 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  If ki_flags & IOCB_NOWAIT && Not (ki_flags & IOCB_DIRECT) Then Return -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  If ret Then Return 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  Return iov_iter_count(from)
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