@@ -263,54 +263,9 @@ static inline bool folio_try_get(struct folio *folio)
263
263
return folio_ref_add_unless (folio , 1 , 0 );
264
264
}
265
265
266
- static inline bool folio_ref_try_add_rcu (struct folio * folio , int count )
267
- {
268
- #ifdef CONFIG_TINY_RCU
269
- /*
270
- * The caller guarantees the folio will not be freed from interrupt
271
- * context, so (on !SMP) we only need preemption to be disabled
272
- * and TINY_RCU does that for us.
273
- */
274
- # ifdef CONFIG_PREEMPT_COUNT
275
- VM_BUG_ON (!in_atomic () && !irqs_disabled ());
276
- # endif
277
- VM_BUG_ON_FOLIO (folio_ref_count (folio ) == 0 , folio );
278
- folio_ref_add (folio , count );
279
- #else
280
- if (unlikely (!folio_ref_add_unless (folio , count , 0 ))) {
281
- /* Either the folio has been freed, or will be freed. */
282
- return false;
283
- }
284
- #endif
285
- return true;
286
- }
287
-
288
- /**
289
- * folio_try_get_rcu - Attempt to increase the refcount on a folio.
290
- * @folio: The folio.
291
- *
292
- * This is a version of folio_try_get() optimised for non-SMP kernels.
293
- * If you are still holding the rcu_read_lock() after looking up the
294
- * page and know that the page cannot have its refcount decreased to
295
- * zero in interrupt context, you can use this instead of folio_try_get().
296
- *
297
- * Example users include get_user_pages_fast() (as pages are not unmapped
298
- * from interrupt context) and the page cache lookups (as pages are not
299
- * truncated from interrupt context). We also know that pages are not
300
- * frozen in interrupt context for the purposes of splitting or migration.
301
- *
302
- * You can also use this function if you're holding a lock that prevents
303
- * pages being frozen & removed; eg the i_pages lock for the page cache
304
- * or the mmap_lock or page table lock for page tables. In this case,
305
- * it will always succeed, and you could have used a plain folio_get(),
306
- * but it's sometimes more convenient to have a common function called
307
- * from both locked and RCU-protected contexts.
308
- *
309
- * Return: True if the reference count was successfully incremented.
310
- */
311
- static inline bool folio_try_get_rcu (struct folio * folio )
266
+ static inline bool folio_ref_try_add (struct folio * folio , int count )
312
267
{
313
- return folio_ref_try_add_rcu (folio , 1 );
268
+ return folio_ref_add_unless (folio , count , 0 );
314
269
}
315
270
316
271
static inline int page_ref_freeze (struct page * page , int count )
0 commit comments