Function report |
Source Code:mm\zswap.c |
Create Date:2022-07-28 15:23:18 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:attempts to compress and store an single page
Proto:static int zswap_frontswap_store(unsigned type, unsigned long offset, struct page *page)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| unsigned | type | |
| unsigned long | offset | |
| struct page * | page |
| 990 | tree = zswap_trees[type] |
| 998 | struct zswap_header zhdr = {swpentry = Store a type+offset into a swp_entry_t in an arch-independent format} |
| 1007 | If Not Enable/disable zswap (disabled by default) || Not tree Then |
| 1013 | If zswap_is_full() Then |
| 1032 | entry = zswap_entry_cache_alloc(GFP_KERNEL) |
| 1033 | If Not entry Then |
| 1036 | Go to reject |
| 1040 | src = kmap_atomic(page) |
| 1041 | If zswap_is_page_same_filled(src, & value) Then |
| 1054 | If Not the zswap_pool the entry's data is in Then |
| 1060 | dst = Must be an lvalue. Since @var must be a simple identifier,* we force a syntax error here if it isn't.(per-cpu code) |
| 1061 | tfm = get_cpu_ptr(tfm) |
| 1062 | src = kmap_atomic(page) |
| 1064 | Prevent people trying to call kunmap_atomic() as if it were kunmap()* kunmap_atomic() should get the return value of kmap_atomic, not the page.(src) |
| 1065 | put_cpu_ptr(tfm) |
| 1066 | If ret Then |
| 1068 | Go to put_dstmem |
| 1072 | hlen = If zpool_evictable(zpool) Then size of zhdr Else 0 |
| 1074 | If zpool_malloc_support_movable(zpool) Then gfp |= __GFP_HIGHMEM | ZONE_MOVABLE allowed |
| 1079 | Go to put_dstmem |
| 1081 | If ret Then |
| 1083 | Go to put_dstmem |
| 1085 | buf = zpool_map_handle(zpool, handle, rmal read-write mapping ) |
| 1086 | No 3D Now!(buf, & zhdr, hlen) |
| 1087 | No 3D Now!(buf + hlen, dst, dlen) |
| 1088 | zpool_unmap_handle(zpool, handle) |
| 1089 | The weird & is necessary because sparse considers (void)(var) to be* a direct dereference of percpu variable (var).(per-cpu code) |
| 1096 | insert_entry : |
| 1099 | Do |
| 1108 | spin_unlock( & lock) |
| 1112 | zswap_update_total_size() |
| 1114 | Return 0 |
| 1116 | put_dstmem : |
| 1117 | The weird & is necessary because sparse considers (void)(var) to be* a direct dereference of percpu variable (var).(per-cpu code) |
| 1119 | freepage : |
| 1120 | zswap_entry_cache_free(entry) |
| 1121 | reject : |
| 1122 | 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 |