函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\buffer.c Create Date:2022-07-29 10:45:20
Last Modify:2020-03-18 10:38:29 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:cont_expand_zero

函数原型:static int cont_expand_zero(struct file *file, struct address_space *mapping, loff_t pos, loff_t *bytes)

返回类型:int

参数:

类型参数名称
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 index大于curidx等于curpos等于bytes右移PAGE_SHIFT determines the page size 循环
2386  zerofrom等于curpos按位与PAGE_MASK的反
2387  如果zerofrom按位与blocksize减1则
2388  bytes或等于blocksize减1
2389  bytes自加
2391  len等于PAGE_SIZEzerofrom
2393  err等于pagecache_write_begin(file, mapping, curpos, len, 0, & page, & fsdata)
2395  如果err则转到:out
2397  zero_user(page, zerofrom, len)
2398  err等于pagecache_write_end(file, mapping, curpos, len, len, page, fsdata)
2400  如果err小于0则转到: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  转到:out
2414  如果index恒等于curidx
2415  zerofrom等于curpos按位与PAGE_MASK的反
2417  如果offset小于等于zerofrom
2418  转到:out
2420  如果zerofrom按位与blocksize减1则
2421  bytes或等于blocksize减1
2422  bytes自加
2424  len等于offsetzerofrom
2426  err等于pagecache_write_begin(file, mapping, curpos, len, 0, & page, & fsdata)
2428  如果err则转到:out
2430  zero_user(page, zerofrom, len)
2431  err等于pagecache_write_end(file, mapping, curpos, len, len, page, fsdata)
2433  如果err小于0则转到:out
2435  BUG_ON(err != len)
2436  err等于0
2438  out :
2439  返回:err
调用者
名称描述
cont_write_beginFor moronic filesystems that do not allow holes in file.* We may have to extend the file.