Skip to content

Apple's open-source XNU kernel on Android phones: its own loader and drivers, Metal on the Adreno. Runs from RAM; a reboot gives the phone back to Android.

C

var_store: the kernel's line says the saver answered, not that the volume went in

vcvkkc3baad13dfb4
diff --git a/userland/src/var_store.c b/userland/src/var_store.c
index 02b6fd7..471f59b 100644
--- a/userland/src/var_store.c
+++ b/userland/src/var_store.c
@@ -1196,14 +1196,16 @@ watch(int seconds)
}
gettimeofday(&tv, NULL);
if (asked || (seconds > 0 && (uint64_t)tv.tv_sec - last >= (uint64_t)seconds)) {
- if (!save_once()) {
+ int ok = save_once();
+
+ if (!ok) {
printf("var_store: this save came to nothing; the store keeps what it had\n");
}
last = (uint64_t)tv.tv_sec;
if (asked) {
- /* the kernel is waiting on this to go back to the loader */
+ /* answered either way: the kernel is waiting on this to go back to the loader */
(void)sysctl_set_int("kern.redwood.var_save", VAR_SAVE_DONE);
- return 1;
+ return ok;
}
}
usleep(100000);
diff --git a/xnu/files/bsd/dev/redwood_ufs.c b/xnu/files/bsd/dev/redwood_ufs.c
index 62e06ee..efa2fda 100644
--- a/xnu/files/bsd/dev/redwood_ufs.c
+++ b/xnu/files/bsd/dev/redwood_ufs.c
@@ -916,7 +916,8 @@ redwood_var_save_on_return(void)
waited += 20;
}
if (ufs_var_save == VAR_SAVE_DONE) {
- printf("var_store: the data volume is in the flash (%llu ms)\n", waited);
+ /* what it made of it is in its own lines: this only says it answered */
+ printf("var_store: the saver has finished after %llu ms\n", waited);
} else {
printf("var_store: the saver did not answer in %u ms: the store keeps what it had\n", ms);
}