mirror of
https://github.com/choff/anbox-modules.git
synced 2025-04-12 23:33:12 +08:00
Fix for kernel 6.13+
This commit is contained in:
parent
ee4c25f064
commit
d2f89a2b8a
@ -3128,7 +3128,9 @@ static void binder_transaction(struct binder_proc *proc,
|
||||
u32 secid;
|
||||
size_t added_size;
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 13, 0)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)
|
||||
security_cred_getsecid(proc->cred, &secid);
|
||||
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 13, 0)
|
||||
security_task_getsecid_obj(proc->tsk, &secid);
|
||||
#else
|
||||
security_task_getsecid(proc->tsk, &secid);
|
||||
|
@ -1055,6 +1055,13 @@ err_get_alloc_mutex_failed:
|
||||
return LRU_SKIP;
|
||||
}
|
||||
|
||||
enum lru_status binder_alloc_free_page_no_lock(struct list_head *item,
|
||||
struct list_lru_one *lru,
|
||||
void *cb_arg)
|
||||
{
|
||||
return binder_alloc_free_page(item, lru, NULL, cb_arg);
|
||||
}
|
||||
|
||||
static unsigned long
|
||||
binder_shrink_count(struct shrinker *shrink, struct shrink_control *sc)
|
||||
{
|
||||
@ -1066,9 +1073,13 @@ static unsigned long
|
||||
binder_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
|
||||
{
|
||||
unsigned long ret;
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0))
|
||||
ret = list_lru_walk(&binder_alloc_lru, binder_alloc_free_page_no_lock,
|
||||
NULL, sc->nr_to_scan);
|
||||
#else
|
||||
ret = list_lru_walk(&binder_alloc_lru, binder_alloc_free_page,
|
||||
NULL, sc->nr_to_scan);
|
||||
NULL, sc->nr_to_scan);
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -117,6 +117,8 @@ static inline void binder_selftest_alloc(struct binder_alloc *alloc) {}
|
||||
enum lru_status binder_alloc_free_page(struct list_head *item,
|
||||
struct list_lru_one *lru,
|
||||
spinlock_t *lock, void *cb_arg);
|
||||
enum lru_status binder_alloc_free_page_no_lock(struct list_head *item,
|
||||
struct list_lru_one *lru, void *cb_arg);
|
||||
extern struct binder_buffer *binder_alloc_new_buf(struct binder_alloc *alloc,
|
||||
size_t data_size,
|
||||
size_t offsets_size,
|
||||
|
Loading…
Reference in New Issue
Block a user