Lines Matching refs:buddy

79 enum buddy {
101 * @buddy: links the z3fold page into the relevant list in the
106 * @slots: pointer to the structure holding buddy slots
109 * @first_chunks: the size of the first buddy in chunks, 0 if free
110 * @middle_chunks: the size of the middle buddy in chunks, 0 if free
111 * @last_chunks: the size of the last buddy in chunks, 0 if free
116 struct list_head buddy;
141 * added buddy.
428 INIT_LIST_HEAD(&zhdr->buddy);
446 static inline int __idx(struct z3fold_header *zhdr, enum buddy bud)
452 * Encodes the handle of a particular buddy within a z3fold page
457 enum buddy bud)
481 static unsigned long encode_handle(struct z3fold_header *zhdr, enum buddy bud)
501 * correct buddy number.
503 static enum buddy handle_to_buddy(unsigned long handle)
527 WARN_ON(!list_empty(&zhdr->buddy));
539 list_add(&zhdr->buddy, &pool->stale);
567 list_del_init(&zhdr->buddy);
581 struct z3fold_header, buddy);
584 list_del(&zhdr->buddy);
630 list_add(&zhdr->buddy, &unbuddied[freechunks]);
637 static inline enum buddy get_free_buddy(struct z3fold_header *zhdr, int chunks)
639 enum buddy bud = HEADLESS;
709 enum buddy new_bud = HEADLESS;
834 list_del_init(&zhdr->buddy);
889 struct z3fold_header, buddy);
898 struct z3fold_header, buddy)) ||
907 list_del_init(&zhdr->buddy);
945 struct z3fold_header, buddy);
952 list_del_init(&zhdr->buddy);
1095 enum buddy bud;
1131 struct z3fold_header, buddy);
1138 list_del(&zhdr->buddy);
1216 enum buddy bud;
1278 list_del_init(&zhdr->buddy);
1397 list_del_init(&zhdr->buddy);
1497 * Extracts the buddy number from handle and constructs the pointer to the
1507 enum buddy buddy;
1516 buddy = handle_to_buddy(handle);
1517 switch (buddy) {
1529 pr_err("unknown buddy id %d\n", buddy);
1551 enum buddy buddy;
1559 buddy = handle_to_buddy(handle);
1560 if (buddy == MIDDLE)
1601 if (!list_empty(&zhdr->buddy))
1602 list_del_init(&zhdr->buddy);
1650 * z3fold_page_isolate() ensures that new_zhdr->buddy is empty,
1653 INIT_LIST_HEAD(&new_zhdr->buddy);
1691 if (!list_empty(&zhdr->buddy))
1692 list_del_init(&zhdr->buddy);