Lines Matching defs:refs
31 static void hpage_pincount_add(struct page *page, int refs)
36 atomic_add(refs, compound_pincount_ptr(page));
39 static void hpage_pincount_sub(struct page *page, int refs)
44 atomic_sub(refs, compound_pincount_ptr(page));
47 /* Equivalent to calling put_page() @refs times. */
48 static void put_page_refs(struct page *page, int refs)
51 if (VM_WARN_ON_ONCE_PAGE(page_ref_count(page) < refs, page))
59 if (refs > 1)
60 page_ref_sub(page, refs - 1);
68 static inline struct page *try_get_compound_head(struct page *page, int refs)
74 if (unlikely(!page_cache_add_speculative(head, refs)))
87 put_page_refs(head, refs);
114 int refs,
118 return try_get_compound_head(page, refs);
120 int orig_refs = refs;
134 page = try_get_compound_head(page, refs);
147 hpage_pincount_add(page, refs);
149 page_ref_add(page, refs * (GUP_PIN_COUNTING_BIAS - 1));
161 static void put_compound_head(struct page *page, int refs, unsigned int flags)
165 refs);
168 hpage_pincount_sub(page, refs);
170 refs *= GUP_PIN_COUNTING_BIAS;
173 put_page_refs(page, refs);
204 int refs = 1;
214 refs = GUP_PIN_COUNTING_BIAS;
222 page_ref_add(page, refs);
2368 int refs;
2384 refs = record_subpages(page, addr, end, pages + *nr);
2386 head = try_grab_compound_head(head, refs, flags);
2391 put_compound_head(head, refs, flags);
2395 *nr += refs;
2431 int refs;
2444 refs = record_subpages(page, addr, end, pages + *nr);
2446 head = try_grab_compound_head(pmd_page(orig), refs, flags);
2451 put_compound_head(head, refs, flags);
2455 *nr += refs;
2465 int refs;
2478 refs = record_subpages(page, addr, end, pages + *nr);
2480 head = try_grab_compound_head(pud_page(orig), refs, flags);
2485 put_compound_head(head, refs, flags);
2489 *nr += refs;
2498 int refs;
2507 refs = record_subpages(page, addr, end, pages + *nr);
2509 head = try_grab_compound_head(pgd_page(orig), refs, flags);
2514 put_compound_head(head, refs, flags);
2518 *nr += refs;