函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\zswap.c Create Date:2022-07-27 16:53:39
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:zswap_writeback_entry

函数原型:static int zswap_writeback_entry(struct zpool *pool, unsigned long handle)

返回类型:int

参数:

类型参数名称
struct zpool *pool
unsigned longhandle
852  struct writeback_control wbc = {sync_mode = WB_SYNC_NONE, }
857  zhdr等于zpool_map_handle(pool, handle, ad-only (no copy-out at unmap time) )
858  swpentry等于swpentry
859  tree等于zswap_trees[Extract the `type' field from a swp_entry_t. The swp_entry_t is in* arch-independent format]
860  offset等于Extract the `offset' field from a swp_entry_t. The swp_entry_t is in* arch-independent format
863  加自旋锁
864  entry等于aller must hold the tree lock
865  如果非entry
867  自旋锁解锁
868  zpool_unmap_handle(pool, handle)
869  返回:0
871  自旋锁解锁
872  BUG_ON(offset != the swap offset for the entry. Index into the red-black tree.)
876  :zswap_get_swap_cache_page* This is an adaption of read_swap_cache_async()* This function tries to find a page with the given swap entry* in the swapper_space address space (the swap cache). If the page* is found, it is returned in retpage恒等于ZSWAP_SWAPCACHE_FAIL
877  ret等于负ENOMEM
878  转到:fail
880  :zswap_get_swap_cache_page* This is an adaption of read_swap_cache_async()* This function tries to find a page with the given swap entry* in the swapper_space address space (the swap cache). If the page* is found, it is returned in retpage恒等于ZSWAP_SWAPCACHE_EXIST
882  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
883  ret等于负EEXIST
884  转到:fail
886  :zswap_get_swap_cache_page* This is an adaption of read_swap_cache_async()* This function tries to find a page with the given swap entry* in the swapper_space address space (the swap cache). If the page* is found, it is returned in retpage恒等于ZSWAP_SWAPCACHE_NEW
888  dlen等于PAGE_SIZE
889  src等于zhdrsizeof(structzswap_header)
890  dst等于kmap_atomic(page)
891  tfm等于get_cpu_ptr(tfm)
892  ret等于crypto_comp_decompress(tfm, src, the length in bytes of the compressed page data. Needed during, dst, & dlen)
894  put_cpu_ptr(tfm)
895  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.(dst)
896  BUG_ON(ret)
897  BUG_ON(dlen != PAGE_SIZE)
900  SetPageUptodate(page)
904  PG_readahead is only used for reads; PG_reclaim is only for writes
907  __swap_writepage(page, & wbc, end_swap_bio_write)
908  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
909  Pages written back when pool limit was reached 自加
911  加自旋锁
913  aller must hold the tree lock* remove from the tree and free it, if nobody reference the entry
922  如果entry恒等于ree functionsaller must hold the tree lock* remove from the tree and free it, if nobody reference the entry
924  自旋锁解锁
926  转到:end
935  fail :
936  加自旋锁
937  aller must hold the tree lock* remove from the tree and free it, if nobody reference the entry
938  自旋锁解锁
940  end :
941  zpool_unmap_handle(pool, handle)
942  返回:ret