Revert "kernel: throne_tracker: offload to kthread tiann #2632"
This reverts commit d5d2bb35d2.
This commit is contained in:
@@ -17,13 +17,8 @@
|
||||
#include "dynamic_manager.h"
|
||||
#include "throne_comm.h"
|
||||
|
||||
#include <linux/kthread.h>
|
||||
#include <linux/sched.h>
|
||||
|
||||
uid_t ksu_manager_uid = KSU_INVALID_UID;
|
||||
|
||||
static struct task_struct *throne_thread;
|
||||
|
||||
#define KSU_UID_LIST_PATH "/data/misc/user_uid/uid_list"
|
||||
#define USER_DATA_PATH "/data/user_de/0"
|
||||
#define USER_DATA_PATH_LEN 256
|
||||
@@ -515,7 +510,7 @@ void search_manager(const char *path, int depth, struct list_head *uid_data)
|
||||
struct file *file;
|
||||
|
||||
if (!stop) {
|
||||
file = ksu_filp_open_compat(pos->dirpath, O_RDONLY | O_NOFOLLOW | O_DIRECTORY, 0);
|
||||
file = ksu_filp_open_compat(pos->dirpath, O_RDONLY | O_NOFOLLOW, 0);
|
||||
if (IS_ERR(file)) {
|
||||
pr_err("Failed to open directory: %s, err: %ld\n", pos->dirpath, PTR_ERR(file));
|
||||
goto skip_iterate;
|
||||
@@ -574,7 +569,7 @@ static bool is_uid_exist(uid_t uid, char *package, void *data)
|
||||
return exist;
|
||||
}
|
||||
|
||||
static void track_throne_function()
|
||||
void track_throne()
|
||||
{
|
||||
struct list_head uid_list;
|
||||
INIT_LIST_HEAD(&uid_list);
|
||||
@@ -655,37 +650,6 @@ out:
|
||||
}
|
||||
}
|
||||
|
||||
static int throne_tracker_thread(void *data)
|
||||
{
|
||||
pr_info("%s: pid: %d started\n", __func__, current->pid);
|
||||
track_throne_function();
|
||||
throne_thread = NULL;
|
||||
smp_mb();
|
||||
pr_info("%s: pid: %d exit!\n", __func__, current->pid);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void track_throne()
|
||||
{
|
||||
#ifndef CONFIG_KSU_THRONE_TRACKER_ALWAYS_THREADED
|
||||
static bool throne_tracker_first_run __read_mostly = true;
|
||||
if (unlikely(throne_tracker_first_run)) {
|
||||
track_throne_function();
|
||||
throne_tracker_first_run = false;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
smp_mb();
|
||||
if (throne_thread != NULL) // single instance lock
|
||||
return;
|
||||
|
||||
throne_thread = kthread_run(throne_tracker_thread, NULL, "throne_tracker");
|
||||
if (IS_ERR(throne_thread)) {
|
||||
throne_thread = NULL;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void ksu_throne_tracker_init()
|
||||
{
|
||||
// nothing to do
|
||||
|
||||
Reference in New Issue
Block a user