函数逻辑报告 |
Source Code:fs\mpage.c |
Create Date:2022-07-29 10:47:01 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:__mpage_writepage
函数原型:static int __mpage_writepage(struct page *page, struct writeback_control *wbc, void *data)
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
struct page * | page | |
struct writeback_control * | wbc | |
void * | data |
505 | blocks_per_page等于PAGE_SIZE右移blkbits位 |
511 | struct block_device * bdev = NULL |
512 | boundary等于0 |
513 | boundary_block等于0 |
514 | struct block_device * boundary_bdev = NULL |
518 | ret等于0 |
519 | op_flags等于wbc_to_write_flags(wbc) |
521 | 如果page_has_buffers(page)则 |
526 | page_block等于0 |
527 | 循环 |
528 | BUG_ON(buffer_locked(bh)) |
529 | 如果非buffer_mapped(bh)则 |
534 | 如果buffer_dirty(bh)则转到:confused |
538 | 继续下一循环 |
541 | 如果first_unmapped不等于blocks_per_page则转到:confused |
546 | 如果page_block则 |
547 | 如果 start block number 不等于blocks[page_block - 1]加1则转到:confused |
550 | blocks[page_block++]等于 start block number |
551 | boundary等于buffer_boundary(bh) |
552 | 如果boundary则 |
554 | boundary_bdev等于b_bdev |
557 | 当bh等于 circular list of page's buffers 不等于head循环 |
559 | 如果first_unmapped则转到:page_is_mapped |
568 | 转到:confused |
574 | BUG_ON(!PageUptodate(page)) |
576 | last_block等于i_size减1右移blkbits位 |
578 | 以page_block小于blocks_per_page循环 |
580 | buffer state bitmap (see above) 等于0 |
581 | size of mapping 等于1左移blkbits位 |
582 | 如果get_block(inode, block_in_file, & map_bh, 1)则转到:confused |
584 | 如果buffer_new( & map_bh)则clean_bdev_bh_alias( & map_bh) |
586 | 如果buffer_boundary( & map_bh)则 |
588 | boundary_bdev等于b_bdev |
590 | 如果page_block则 |
591 | 如果 start block number 不等于blocks[page_block - 1]加1则转到:confused |
594 | blocks[page_block++]等于 start block number |
595 | boundary等于buffer_boundary( & map_bh) |
597 | 如果block_in_file恒等于last_block则退出 |
599 | block_in_file自加 |
601 | BUG_ON(page_block == 0) |
603 | first_unmapped等于page_block |
605 | page_is_mapped : |
607 | 如果 Our offset within mapping. 大于等于end_index则 |
618 | 如果 Our offset within mapping. 大于end_index或非offset则转到:confused |
620 | zero_user_segment(page, offset, PAGE_SIZE) |
626 | 如果bio且last_block_in_bio不等于blocks[0]减1则bio等于mpage_bio_submit(REQ_OP_WRITE, op_flags, bio) |
629 | alloc_new : |
630 | 如果(bio == NULL)则 |
631 | 如果first_unmapped恒等于blocks_per_page则 |
636 | bio等于mpage_alloc(bdev, blocks[0] << (blkbits - 9), BIO_MAX_PAGES, GFP_NOFS | __GFP_HIGH) |
641 | wbc_init_bio(wbc, bio) |
650 | wbc_account_cgroup_owner(wbc, page, PAGE_SIZE) |
651 | length等于first_unmapped左移blkbits位 |
652 | 如果bio_add_page(bio, page, length, 0)小于length则 |
653 | bio等于mpage_bio_submit(REQ_OP_WRITE, op_flags, bio) |
654 | 转到:alloc_new |
659 | BUG_ON(Only test-and-set exist for PG_writeback. The unconditional operators are* risky: they bypass page accounting.) |
660 | set_page_writeback(page) |
662 | 如果boundary或first_unmapped不等于blocks_per_page则 |
663 | bio等于mpage_bio_submit(REQ_OP_WRITE, op_flags, bio) |
664 | 如果boundary_block则 |
668 | 否则 |
669 | last_block_in_bio等于blocks[blocks_per_page - 1] |
671 | 转到:out |
673 | confused : |
674 | 如果bio则bio等于mpage_bio_submit(REQ_OP_WRITE, op_flags, bio) |
677 | 如果use_writepage则 |
679 | 否则 |
687 | out : |
689 | 返回:ret |
名称 | 描述 |
---|---|
mpage_writepage |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |