函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:compact_single_buddy

函数原型:static struct z3fold_header *compact_single_buddy(struct z3fold_header *zhdr)

返回类型:struct z3fold_header

参数:

类型参数名称
struct z3fold_header *zhdr
672  pool等于zhdr_to_pool(zhdr)
673  p等于zhdr
674  old_handle等于0
675  sz等于0
676  struct z3fold_header * new_zhdr = NULL
677  first_idx等于Helper function to build the index
678  middle_idx等于Helper function to build the index
679  last_idx等于Helper function to build the index
680  unsigned short * moved_chunks = NULL
686  如果first_chunks* we are using BUDDY_MASK in handle_to_buddy etc. so there should * be enough slots to hold all possible variants[first_idx]则
687  p加等于ZHDR_SIZE_ALIGNED
688  sz等于first_chunks左移CHUNK_SHIFT
689  old_handle = (unsigned long) & * we are using BUDDY_MASK in handle_to_buddy etc. so there should * be enough slots to hold all possible variants[first_idx]
690  moved_chunks等于first_chunks
691  否则如果middle_chunks* we are using BUDDY_MASK in handle_to_buddy etc. so there should * be enough slots to hold all possible variants[middle_idx]则
692  p加等于start_middle左移CHUNK_SHIFT
693  sz等于middle_chunks左移CHUNK_SHIFT
694  old_handle = (unsigned long) & * we are using BUDDY_MASK in handle_to_buddy etc. so there should * be enough slots to hold all possible variants[middle_idx]
695  moved_chunks等于middle_chunks
696  否则如果last_chunks* we are using BUDDY_MASK in handle_to_buddy etc. so there should * be enough slots to hold all possible variants[last_idx]则
697  p加等于PAGE_SIZElast_chunks左移CHUNK_SHIFT位的值
698  sz等于last_chunks左移CHUNK_SHIFT
699  old_handle = (unsigned long) & * we are using BUDDY_MASK in handle_to_buddy etc. so there should * be enough slots to hold all possible variants[last_idx]
700  moved_chunks等于last_chunks
703  如果sz大于0则
704  new_bud等于HEADLESS
705  chunks等于Converts an allocation size in bytes to size in z3fold chunks
708  new_zhdr等于rns _locked_ z3fold page header or NULL
709  如果非new_zhdr则返回:NULL
712  如果WARN_ON(new_zhdr == zhdr)则转到:out_fail
715  如果first_chunks恒等于0则
716  如果middle_chunks不等于0且chunks大于等于start_middle
718  new_bud等于LAST
719  否则
720  new_bud等于FIRST
722  否则如果last_chunks恒等于0则
723  new_bud等于LAST
724  否则如果middle_chunks恒等于0则
725  new_bud等于MIDDLE
727  q等于new_zhdr
729  :new_bud恒等于FIRST
730  first_chunks等于chunks
731  q加等于ZHDR_SIZE_ALIGNED
732  退出
733  :new_bud恒等于MIDDLE
734  middle_chunks等于chunks
737  q加等于start_middle左移CHUNK_SHIFT
738  退出
739  :new_bud恒等于LAST
740  last_chunks等于chunks
741  q加等于PAGE_SIZElast_chunks左移CHUNK_SHIFT位的值
742  退出
743  默认
744  转到:out_fail
746  foreign_handles自加
747  memcpy(q, p, sz)
748  write_lock( & lock)
749  old_handle等于new_zhdrHelper function to build the index
751  如果new_bud恒等于LASTold_handle或等于last_chunks左移BUDDY_SHIFT
754  write_unlock( & lock)
755  Add to the appropriate unbuddied list
756  Unlock a z3fold page
758  moved_chunks等于0
761  返回:new_zhdr
763  out_fail :
764  如果new_zhdr
765  如果kref_put - decrement refcount for object.*@kref: object.*@release: pointer to the function that will clean up the object when the* last reference to the object is released.* This pointer is required, and it is not acceptable to pass kfreeatomic64_dec( & pages_nr)
767  否则
772  返回:NULL
调用者
名称描述
do_compact_page