Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\buffer.c Create Date:2022-07-28 20:14:11
Last Modify:2020-03-18 10:38:29 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:For moronic filesystems that do not allow holes in file.* We may have to extend the file.

Proto:int cont_write_begin(struct file *file, struct address_space *mapping, loff_t pos, unsigned len, unsigned flags, struct page **pagep, void **fsdata, get_block_t *get_block, loff_t *bytes)

Type:int

Parameter:

TypeParameterName
struct file *file
struct address_space *mapping
loff_tpos
unsignedlen
unsignedflags
struct page **pagep
void **fsdata
get_block_t *get_block
loff_t *bytes
2451  inode = host
2452  blocksize = i_blocksize(inode)
2456  err = cont_expand_zero(file, mapping, pos, bytes)
2457  If err Then Return err
2460  zerofrom = bytes & ~PAGE_MASK
2461  If pos + len > bytes && zerofrom & blocksize - 1 Then
2462  bytes |= blocksize - 1
2463  bytes++
2466  Return lock_write_begin takes care of the basic task of block allocation and* bringing partial write blocks uptodate first.* The filesystem needs to handle block truncation upon failure.