Function report |
Source Code:fs\buffer.c |
Create Date:2022-07-28 20:14:10 |
| Last Modify:2020-03-18 10:38:29 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:While block_write_full_page is writing back the dirty buffers under* the page lock, whoever dirtied the buffers may decide to clean them* again at any time
Proto:int __block_write_full_page(struct inode *inode, struct page *page, get_block_t *get_block, struct writeback_control *wbc, bh_end_io_t *handler)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct inode * | inode | |
| struct page * | page | |
| get_block_t * | get_block | |
| struct writeback_control * | wbc | |
| bh_end_io_t * | handler |
| 1718 | nr_underway = 0 |
| 1719 | write_flags = wbc_to_write_flags(wbc) |
| 1721 | head = create_page_buffers(page, inode, (1 << BH_Dirty) | (1 << BH_Uptodate)) |
| 1735 | blocksize = size of mapping |
| 1745 | Do |
| 1746 | If block > last_block Then |
| 1755 | clear_buffer_dirty(bh) |
| 1757 | Else if ( Not buffer_mapped(bh) || buffer_delay(bh)) && buffer_dirty(bh) Then |
| 1759 | WARN_ON( size of mapping != blocksize) |
| 1763 | clear_buffer_delay(bh) |
| 1764 | If buffer_new(bh) Then |
| 1766 | clear_buffer_new(bh) |
| 1767 | clean_bdev_bh_alias(bh) |
| 1771 | block++ |
| 1774 | Do |
| 1775 | If Not buffer_mapped(bh) Then Continue |
| 1784 | If sync_mode != Don't wait on anything Then |
| 1785 | lock_buffer(bh) |
| 1786 | Else if Not trylock_buffer(bh) Then |
| 1790 | If test_clear_buffer_dirty(bh) Then |
| 1792 | Else |
| 1793 | unlock_buffer(bh) |
| 1795 | When (bh = circular list of page's buffers ) != head cycle |
| 1801 | BUG_ON(Only test-and-set exist for PG_writeback. The unconditional operators are* risky: they bypass page accounting.) |
| 1802 | set_page_writeback(page) |
| 1804 | Do |
| 1806 | If buffer_async_write(bh) Then |
| 1807 | submit_bh_wbc(REQ_OP_WRITE, write_flags, bh, i_write_hint, wbc) |
| 1809 | nr_underway++ |
| 1815 | err = 0 |
| 1816 | done : |
| 1817 | If nr_underway == 0 Then |
| 1830 | Return err |
| 1832 | recover : |
| 1841 | Do |
| 1842 | If buffer_mapped(bh) && buffer_dirty(bh) && Not buffer_delay(bh) Then |
| 1844 | lock_buffer(bh) |
| 1846 | Else |
| 1851 | clear_buffer_dirty(bh) |
| 1853 | When (bh = circular list of page's buffers ) != head cycle |
| 1854 | SetPageError(page) |
| 1855 | BUG_ON(Only test-and-set exist for PG_writeback. The unconditional operators are* risky: they bypass page accounting.) |
| 1857 | set_page_writeback(page) |
| 1858 | Do |
| 1860 | If buffer_async_write(bh) Then |
| 1861 | clear_buffer_dirty(bh) |
| 1862 | submit_bh_wbc(REQ_OP_WRITE, write_flags, bh, i_write_hint, wbc) |
| 1864 | nr_underway++ |
| 1869 | Go to done |
| Name | Describe |
|---|---|
| nobh_writepage | bh_writepage() - based on block_full_write_page() except* that it tries to operate without attaching bufferheads to* the page. |
| block_write_full_page | The generic ->writepage function for buffer-backed address_spaces |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |