xref: /linux/rust/helpers/binder.c (revision 4f38da1f027ea2c9f01bb71daa7a299c191b6940)
1*eafedbc7SAlice Ryhl // SPDX-License-Identifier: GPL-2.0
2*eafedbc7SAlice Ryhl 
3*eafedbc7SAlice Ryhl /*
4*eafedbc7SAlice Ryhl  * Copyright (C) 2025 Google LLC.
5*eafedbc7SAlice Ryhl  */
6*eafedbc7SAlice Ryhl 
7*eafedbc7SAlice Ryhl #include <linux/list_lru.h>
8*eafedbc7SAlice Ryhl #include <linux/task_work.h>
9*eafedbc7SAlice Ryhl 
10*eafedbc7SAlice Ryhl unsigned long rust_helper_list_lru_count(struct list_lru *lru)
11*eafedbc7SAlice Ryhl {
12*eafedbc7SAlice Ryhl 	return list_lru_count(lru);
13*eafedbc7SAlice Ryhl }
14*eafedbc7SAlice Ryhl 
15*eafedbc7SAlice Ryhl unsigned long rust_helper_list_lru_walk(struct list_lru *lru,
16*eafedbc7SAlice Ryhl 					list_lru_walk_cb isolate, void *cb_arg,
17*eafedbc7SAlice Ryhl 					unsigned long nr_to_walk)
18*eafedbc7SAlice Ryhl {
19*eafedbc7SAlice Ryhl 	return list_lru_walk(lru, isolate, cb_arg, nr_to_walk);
20*eafedbc7SAlice Ryhl }
21*eafedbc7SAlice Ryhl 
22*eafedbc7SAlice Ryhl void rust_helper_init_task_work(struct callback_head *twork,
23*eafedbc7SAlice Ryhl 				task_work_func_t func)
24*eafedbc7SAlice Ryhl {
25*eafedbc7SAlice Ryhl 	init_task_work(twork, func);
26*eafedbc7SAlice Ryhl }
27