__GENERIC_FILE_WRITE(9) Memory Management in Linux __GENERIC_FILE_WRITE(9)NAME__generic_file_write_iter - write data to a file
SYNOPSIS
ssize_t __generic_file_write_iter(struct kiocb * iocb,
struct iov_iter * iter,
loff_t * ppos);
ARGUMENTS
iocb
IO state structure (file, offset, etc.)
iter
iov_iter specifying memory to write
ppos
position where to write
DESCRIPTION
This function does all the work needed for actually writing data to a
file. It does all basic checks, removes SUID from the file, updates
modification times and calls proper subroutines depending on whether we
do direct IO or a standard buffered write.
It expects i_mutex to be grabbed unless we work on a block device or
similar object which does not need locking at all.
This function does *not* take care of syncing data in case of O_SYNC
write. A caller has to handle it. This is mainly due to the fact that
we want to avoid syncing under i_mutex.
COPYRIGHTKernel Hackers Manual 3.8. June 2014 __GENERIC_FILE_WRITE(9)