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:cont_expand_zero

Proto:static int cont_expand_zero(struct file *file, struct address_space *mapping, loff_t pos, loff_t *bytes)

Type:int

Parameter:

TypeParameterName
struct file *file
struct address_space *mapping
loff_tpos
loff_t *bytes
2373  inode = host
2374  blocksize = i_blocksize(inode)
2380  err = 0
2382  index = pos >> PAGE_SHIFT determines the page size
2383  offset = pos & ~PAGE_MASK
2385  When index > (curidx = (curpos = bytes) >> PAGE_SHIFT determines the page size ) cycle
2386  zerofrom = curpos & ~PAGE_MASK
2387  If zerofrom & blocksize - 1 Then
2388  bytes |= blocksize - 1
2389  bytes++
2391  len = PAGE_SIZE - zerofrom
2393  err = pagecache_write_begin(file, mapping, curpos, len, 0, & page, & fsdata)
2395  If err Then Go to out
2397  zero_user(page, zerofrom, len)
2398  err = pagecache_write_end(file, mapping, curpos, len, len, page, fsdata)
2400  If err < 0 Then Go to out
2402  BUG_ON(err != len)
2403  err = 0
2405  alance_dirty_pages_ratelimited - balance dirty memory state*@mapping: address_space which was dirtied* Processes which are dirtying memory should call in here once for each page* which was newly dirtied. The function will periodically check the system's
2408  err = -EINTR
2409  Go to out
2414  If index == curidx Then
2415  zerofrom = curpos & ~PAGE_MASK
2417  If offset <= zerofrom Then
2418  Go to out
2420  If zerofrom & blocksize - 1 Then
2421  bytes |= blocksize - 1
2422  bytes++
2424  len = offset - zerofrom
2426  err = pagecache_write_begin(file, mapping, curpos, len, 0, & page, & fsdata)
2428  If err Then Go to out
2430  zero_user(page, zerofrom, len)
2431  err = pagecache_write_end(file, mapping, curpos, len, len, page, fsdata)
2433  If err < 0 Then Go to out
2435  BUG_ON(err != len)
2436  err = 0
2438  out :
2439  Return err
Caller
NameDescribe
cont_write_beginFor moronic filesystems that do not allow holes in file.* We may have to extend the file.