Function report | 
Source Code:mm\swapfile.c | 
Create Date:2022-07-28 15:16:20 | 
| Last Modify:2020-03-17 22:19:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:swapon tell device that all the old swap contents can be discarded,* to allow the swap device to optimize its wear-levelling.
Proto:static int discard_swap(struct swap_info_struct *si)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| struct swap_info_struct * | si | 
| 176 | err = 0 | 
| 180 | start_block = start_block + 1 << PAGE_SHIFT determines the page size - 9 | 
| 181 | nr_blocks = nr_pages - 1 << PAGE_SHIFT determines the page size - 9 | 
| 182 | If nr_blocks Then | 
| 183 | err = blkdev_issue_discard(swap device or bdev of swap file , start_block, nr_blocks, GFP_KERNEL, 0) | 
| 187 | cond_resched() | 
| 191 | start_block = start_block << PAGE_SHIFT determines the page size - 9 | 
| 192 | nr_blocks = nr_pages << PAGE_SHIFT determines the page size - 9 | 
| 194 | err = blkdev_issue_discard(swap device or bdev of swap file , start_block, nr_blocks, GFP_KERNEL, 0) | 
| 196 | If err Then Break | 
| 199 | cond_resched() | 
| 201 | Return err | 
| Name | Describe | 
|---|---|
| SYSCALL_DEFINE2 | 
| 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  |