Lines Matching refs:buddy

72 enum buddy {
94 * @buddy: links the z3fold page into the relevant list in the
99 * @slots: pointer to the structure holding buddy slots
102 * @first_chunks: the size of the first buddy in chunks, 0 if free
103 * @middle_chunks: the size of the middle buddy in chunks, 0 if free
104 * @last_chunks: the size of the last buddy in chunks, 0 if free
109 struct list_head buddy;
344 INIT_LIST_HEAD(&zhdr->buddy);
361 static inline int __idx(struct z3fold_header *zhdr, enum buddy bud)
367 * Encodes the handle of a particular buddy within a z3fold page
372 enum buddy bud)
396 static unsigned long encode_handle(struct z3fold_header *zhdr, enum buddy bud)
416 * correct buddy number.
418 static enum buddy handle_to_buddy(unsigned long handle)
442 WARN_ON(!list_empty(&zhdr->buddy));
452 list_add(&zhdr->buddy, &pool->stale);
474 list_del_init(&zhdr->buddy);
498 struct z3fold_header, buddy);
501 list_del(&zhdr->buddy);
549 list_add(&zhdr->buddy, &unbuddied[freechunks]);
556 static inline enum buddy get_free_buddy(struct z3fold_header *zhdr, int chunks)
558 enum buddy bud = HEADLESS;
628 enum buddy new_bud = HEADLESS;
749 list_del_init(&zhdr->buddy);
801 struct z3fold_header, buddy);
809 struct z3fold_header, buddy)) ||
818 list_del_init(&zhdr->buddy);
856 struct z3fold_header, buddy);
863 list_del_init(&zhdr->buddy);
1006 enum buddy bud;
1096 enum buddy bud;
1169 * Extracts the buddy number from handle and constructs the pointer to the
1179 enum buddy buddy;
1188 buddy = handle_to_buddy(handle);
1189 switch (buddy) {
1201 pr_err("unknown buddy id %d\n", buddy);
1223 enum buddy buddy;
1231 buddy = handle_to_buddy(handle);
1232 if (buddy == MIDDLE)
1272 if (!list_empty(&zhdr->buddy))
1273 list_del_init(&zhdr->buddy);
1317 * z3fold_page_isolate() ensures that new_zhdr->buddy is empty,
1320 INIT_LIST_HEAD(&new_zhdr->buddy);
1353 if (!list_empty(&zhdr->buddy))
1354 list_del_init(&zhdr->buddy);
1358 if (list_empty(&zhdr->buddy))
1428 * there has remaining spaces for its buddy.