Function report |
Source Code:mm\z3fold.c |
Create Date:2022-07-28 16:29:36 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:compact_single_buddy
Proto:static struct z3fold_header *compact_single_buddy(struct z3fold_header *zhdr)
Type:struct z3fold_header
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct z3fold_header * | zhdr |
| 672 | pool = zhdr_to_pool(zhdr) |
| 674 | old_handle = 0 |
| 675 | sz = 0 |
| 676 | struct z3fold_header * new_zhdr = NULL |
| 680 | unsigned short * moved_chunks = NULL |
| 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 |
| 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 |
| 697 | p += PAGE_SIZE - (last_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 | If sz > 0 Then |
| 709 | If Not new_zhdr Then Return NULL |
| 715 | If first_chunks == 0 Then |
| 716 | If middle_chunks != 0 && chunks >= start_middle Then |
| 719 | Else |
| 722 | Else if last_chunks == 0 Then |
| 724 | Else if middle_chunks == 0 Then |
| 734 | middle_chunks = chunks |
| 735 | start_middle = first_chunks + ZHDR_CHUNKS |
| 737 | q += start_middle << CHUNK_SHIFT |
| 738 | Break |
| 743 | Default |
| 744 | Go to out_fail |
| 746 | foreign_handles++ |
| 748 | write_lock( & lock) |
| 751 | If new_bud == LAST Then old_handle |= last_chunks << BUDDY_SHIFT |
| 754 | write_unlock( & lock) |
| 758 | moved_chunks = 0 |
| 761 | Return new_zhdr |
| 763 | out_fail : |
| 764 | If new_zhdr Then |
| 767 | Else |
| 772 | Return NULL |
| Name | Describe |
|---|---|
| do_compact_page |
| 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 |