-
-
Notifications
You must be signed in to change notification settings - Fork 3k
kernel: use rcu to access allowlist, refactor get allowlist api #3093
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the allow list API to optimize how the superuser count is retrieved. Instead of fetching the entire list of UIDs just to get the count, it introduces a dedicated getSuperuserCount() method that only returns the count. The API changes also introduce a more flexible allow list structure with support for paginated retrieval.
Key changes:
- Replaced direct
allowList.sizeaccess with a newgetSuperuserCount()native method - Refactored the kernel
ksu_get_allow_list_cmdstructure to use a flexible array member and separate count fields - Unified allow/deny list retrieval logic into a common
do_get_list_commonfunction with proper memory management
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| manager/app/src/main/java/me/weishu/kernelsu/ui/util/KsuCli.kt | Updated to call the new getSuperuserCount() method instead of accessing allowList.size |
| manager/app/src/main/java/me/weishu/kernelsu/Natives.kt | Removed the allowList property and added getSuperuserCount() external function |
| manager/app/src/main/cpp/ksu.h | Modified ksu_get_allow_list_cmd structure to use flexible array member and split count fields |
| manager/app/src/main/cpp/jni.cc | Replaced getAllowList() with getSuperuserCount() that only retrieves the total count |
| kernel/supercalls.h | Updated ksu_get_allow_list_cmd structure to match the userspace changes |
| kernel/supercalls.c | Refactored allow/deny list retrieval into common function with dynamic memory allocation |
| kernel/allowlist.h | Updated function signature to accept separate length and total count parameters |
| kernel/allowlist.c | Modified implementation to track both returned items and total count separately |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
991087e to
55f0d69
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 10 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ef91a7d to
8fc71fe
Compare
8fc71fe to
60e79e7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0d2c087 to
a4df977
Compare
No description provided.