Function report |
Source Code:mm\truncate.c |
Create Date:2022-07-28 14:14:32 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:runcate_inode_pages_range - truncate range of pages specified by start & end byte offsets*@mapping: mapping to truncate*@lstart: offset from which to truncate*@lend: offset to which to truncate (inclusive)* Truncate the page cache, removing the pages that
Proto:void truncate_inode_pages_range(struct address_space *mapping, loff_t lstart, loff_t lend)
Type:void
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct address_space * | mapping | |
| loff_t | lstart | |
| loff_t | lend |
| 303 | If nrpages == 0 && nrexceptional == 0 Then Go to out |
| 307 | partial_start = lstart & PAGE_SIZE - 1 |
| 308 | partial_end = lend + 1 & PAGE_SIZE - 1 |
| 316 | start = lstart + PAGE_SIZE - 1 >> PAGE_SHIFT determines the page size |
| 324 | Else end = lend + 1 >> PAGE_SHIFT determines the page size |
| 327 | pagevec_init( & pvec) |
| 339 | pagevec_init( & locked_pvec) |
| 340 | When i < pagevec_count( & pvec) cycle |
| 348 | If xa_is_value() - Determine if an entry is a value.*@entry: XArray entry.* Context: Any context.* Return: True if the entry is a value, false if it is a pointer. Then Continue |
| 351 | If Not Return true if the page was successfully locked Then Continue |
| 353 | WARN_ON(Get index of the page with in radix-tree* (TODO: remove once hugetlb pages will have ->index in PAGE_SIZE) != index) |
| 358 | If See page-flags.h for PAGE_MAPPING_FLAGS != mapping Then |
| 364 | When i < pagevec_count( & locked_pvec) cycle If truncate cannot remove the fs-private metadata from the page, the page* becomes orphaned |
| 370 | pagevec_release( & pvec) |
| 371 | cond_resched() |
| 372 | index++ |
| 374 | If partial_start Then |
| 376 | If page Then |
| 380 | top = partial_end |
| 381 | partial_end = 0 |
| 384 | zero_user_segment(page, partial_start, top) |
| 393 | If partial_end Then |
| 395 | If page Then |
| 397 | zero_user_segment(page, 0, partial_end) |
| 414 | cycle |
| 415 | cond_resched() |
| 428 | pagevec_release( & pvec) |
| 429 | Break |
| 432 | When i < pagevec_count( & pvec) cycle |
| 443 | If xa_is_value() - Determine if an entry is a value.*@entry: XArray entry.* Context: Any context.* Return: True if the entry is a value, false if it is a pointer. Then Continue |
| 447 | WARN_ON(Get index of the page with in radix-tree* (TODO: remove once hugetlb pages will have ->index in PAGE_SIZE) != index) |
| 449 | truncate_inode_page(mapping, page) |
| 453 | pagevec_release( & pvec) |
| 454 | index++ |
| 457 | out : |
| Name | Describe |
|---|---|
| truncate_inode_pages | runcate_inode_pages - truncate *all* the pages from an offset*@mapping: mapping to truncate*@lstart: offset from which to truncate* Called under (and serialised by) inode->i_mutex.* Note: When this function returns, there can be a page in the process of |
| truncate_pagecache_range | runcate_pagecache_range - unmap and remove pagecache that is hole-punched*@inode: inode*@lstart: offset of beginning of hole*@lend: offset of last byte of hole* This function should typically be called before the filesystem |
| shmem_truncate_range | |
| blk_ioctl_zeroout |
| 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 |