luo_retrieve_file(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 β€” the file_set you'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 retrieved struct 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 πŸ”₯

  • 0 on success β€” the good ending πŸ₯³
  • a negative errno on failure, specifically:
    • -ENOENT if 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 .retrieve op β€” because sometimes the handler has opinions and we respect them πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘

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