luo_retrieve_file(9)
π luo_retrieve_file(9) β Kernel API Manual β¨
okay so bestie, gather round, because this one is literally the glow-up function of the whole live update situation. We're talking luo_retrieve_file β the icon, the main character, the one that brings your preserved file back from the void π«Ά
πΈ NAME πΈ
luo_retrieve_file β restores a preserved file out of a file_set by its token. that's it. that's the vibe check. π
β¨ SYNOPSIS β¨
int luo_retrieve_file (struct luo_file_set *file_set , u64 token ,
struct file **filep );
like yes, three args, she's not complicated, she's just effective π
π¦ ARGUMENTS π¦
file_setβ thefile_setyou're pulling the file out of. your source of truth, your origin story, your whole personality for this call ngl.tokenβ the unique token that IDs exactly which file is getting restored. it's giving VIP wristband. no token, no entry πfilepβ an output parameter!! on success this gets populated with a pointer to the newly retrievedstruct file. so like, it starts empty and leaves iconic. that's growth π±β¨
π DESCRIPTION π
so this function is the primary mechanism for recreating a file in the new kernel after a live update. the whole point. the assignment. and she understands it π«‘
here's what she does: she searches the file_set's list of deserialized files for an entry matching the token you handed her. little detective moment. magnifying glass out. π
and the best part? the operation is idempotent. say it with me β idempotent. if a file has already been successfully retrieved, this function will simply return a pointer to the existing operation. no drama, no double-restoring, no chaos. she's not doing the work twice, she's smarter than that π
this is handled by checking the 'retrieved' flag under a lock. yes bestie, there's a lock. there's always a lock. safety first, slay second πβ¨
also!! file retrieval can happen in any order β it is not bound by the order of preservation. so you don't have to retrieve things in the same sequence they were preserved in. freedom. flexibility. she contains multitudes π
π CONTEXT π
can be called from an ioctl or other in-kernel code in the new kernel. so like, in-kernel besties only. she's not taking calls from userspace randos π
π₯ RETURN π₯
0on success β the good ending π₯³- a negative errno on failure, specifically:
-ENOENTif no file with the matching token is found. tragic. the token led nowhere. we've all been there π
- and also, any error code returned by the handler's
.retrieveop β because sometimes the handler has opinions and we respect them π
π SEE ALSO π
- Kernel file
./kernel/liveupdate/luo_file.c LUO File Descriptors(9)struct luo_file(9)luo_preserve_file(9)luo_file_unpreserve_files(9)luo_file_freeze(9)luo_file_unfreeze(9)luo_file_finish(9)luo_file_deserialize(9)liveupdate_register_file_handler(9)liveupdate_unregister_file_handler(9)
the whole friend group fr fr, go read them all, iykyk π§π
lowkey a reminder bestie: idempotency here depends on that 'retrieved' flag being checked under the lock β that's the mechanism the page describes, so don't go reinventing it, mwah π
and that's the page!! brought to you by ./kernel/liveupdate, dated October 2026 β she's serving version-and-date realness and honestly? iconic. bye bestie, go retrieve some files πβ¨ππ
π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms