| Function report | 
| Source Code: fs\buffer.c | Create Date:2022-07-28 20:14:12 | 
| Last Modify:2020-03-18 10:38:29 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:On entry, the page is fully not uptodate.* On exit the page is fully uptodate in the areas outside (from,to)* The filesystem needs to handle block truncation upon failure.
Proto:int nobh_write_begin(struct address_space *mapping, loff_t pos, unsigned len, unsigned flags, struct page **pagep, void **fsdata, get_block_t *get_block)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| struct address_space * | mapping | |
| loff_t | pos | |
| unsigned | len | |
| unsigned | flags | |
| struct page ** | pagep | |
| void ** | fsdata | |
| get_block_t * | get_block | 
| 2589 | nr_reads = 0 | 
| 2590 | ret = 0 | 
| 2591 | is_mapped_to_disk = 1 | 
| 2593 | index = pos >> PAGE_SHIFT determines the page size | 
| 2597 | page = Find or create a page at the given pagecache position. Return the locked* page. This function is specifically for buffered writes. | 
| 2601 | * fsdata = NULL | 
| 2603 | If page_has_buffers(page) Then | 
| 2605 | If Value for the false possibility is greater at compile time(ret) Then Go to out_release | 
| 2607 | Return ret | 
| 2610 | If PageMappedToDisk(page) Then Return 0 | 
| 2622 | head = Create the appropriate buffers when given a page for data area and* the size of each buffer | 
| 2623 | If Not head Then | 
| 2625 | Go to out_release | 
| 2635 | When block_start < PAGE_SIZE cycle | 
| 2640 | block_end = block_start + blocksize | 
| 2641 | buffer state bitmap (see above) = 0 | 
| 2642 | create = 1 | 
| 2643 | If block_start >= to Then create = 0 | 
| 2645 | ret = get_block(inode, block_in_file + block_in_page, bh, create) | 
| 2649 | If Not buffer_mapped(bh) Then is_mapped_to_disk = 0 | 
| 2651 | If buffer_new(bh) Then clean_bdev_bh_alias(bh) | 
| 2653 | If PageUptodate(page) Then | 
| 2657 | If buffer_new(bh) || Not buffer_mapped(bh) Then | 
| 2658 | zero_user_segments(page, block_start, from, to, block_end) | 
| 2660 | Continue | 
| 2664 | If block_start < from || block_end > to Then | 
| 2672 | If nr_reads Then | 
| 2679 | wait_on_buffer(bh) | 
| 2687 | If is_mapped_to_disk Then SetPageMappedToDisk(page) | 
| 2692 | Return 0 | 
| 2694 | failed : | 
| 2706 | out_release : | 
| 2709 | * pagep = NULL | 
| 2711 | Return ret | 
| 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 |