Function report |
Source Code:mm\swapfile.c |
Create Date:2022-07-28 15:19:38 |
| Last Modify:2020-03-17 22:19:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:setup_swap_map_and_extents
Proto:static int setup_swap_map_and_extents(struct swap_info_struct *p, union swap_header *swap_header, unsigned char *swap_map, struct swap_cluster_info *cluster_info, unsigned long maxpages, sector_t *span)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct swap_info_struct * | p | |
| union swap_header * | swap_header | |
| unsigned char * | swap_map | |
| struct swap_cluster_info * | cluster_info | |
| unsigned long | maxpages | |
| sector_t * | span |
| 3024 | nr_clusters = DIV_ROUND_UP(maxpages, SWAPFILE_CLUSTER) |
| 3028 | nr_good_pages = maxpages - 1 |
| 3030 | cluster_list_init( & clusters list ) |
| 3031 | cluster_list_init( & discard clusters list ) |
| 3033 | When i < nr_badpages cycle |
| 3052 | If nr_good_pages Then |
| 3059 | xtent of the swap_map = maxpages |
| 3062 | If nr_extents < 0 Then Return nr_extents |
| 3066 | If Not nr_good_pages Then |
| 3071 | If Not cluster_info Then Return nr_extents |
| 3079 | When k < SWAP_CLUSTER_COLS cycle |
| 3080 | j = (k + col) % SWAP_CLUSTER_COLS |
| 3081 | When i < DIV_ROUND_UP(nr_clusters, SWAP_CLUSTER_COLS) cycle |
| 3082 | idx = i * SWAP_CLUSTER_COLS + j |
| 3083 | If idx >= nr_clusters Then Continue |
| 3085 | If cluster_count( & cluster_info[idx]) Then Continue |
| 3087 | cluster_set_flag( & cluster_info[idx], This cluster is free ) |
| 3088 | cluster_list_add_tail( & clusters list , cluster_info, idx) |
| 3092 | Return nr_extents |
| 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 |