STRUCT LUO_FILE(9)
π struct luo_file β NAME π
okay bestie, welcome to the struct luo_file(9) glow-up β¨ this is the kernel-API page for struct luo_file, and it's literally just: Represents a single preserved file instance. That's it, that's the vibe π
πΈ SYNOPSIS πΈ
struct luo_file {
struct liveupdate_file_handler *fh;
struct file *file;
u64 serialized_data;
void *private_data;
int retrieve_status;
struct mutex mutex;
struct list_head list;
u64 token;
};
no cap, that's the whole shape of it π¦
π Members π
fhβ pointer to thestruct liveupdate_file_handlerthat manages this type of file. like, the handler that owns this whole situation πββοΈfileβ pointer to the kernel'sstruct filethat's being preserved. β οΈ it'sNULLin the new kernel until the file is successfully retrieved β so don't go dereferencing it early, bestie πserialized_dataβ the opaqueu64handle to the serialized state of the file. this handle gets passed back to the handler's.freeze,.retrieve, and.finishcallbacks, so the handler can track and update its serialized state across phases π₯private_dataβ pointer to the private data for the file, used to hold runtime state that is not preserved. it's set by the handler's.preservecallback, and it must be freed in the handler's.unpreservecallback π«Ά (yes, that's you, free it)retrieve_statusβ status code telling you whether a user/kernel in the new kernel has successfully called retrieve on this file. it's giving gatekeeper: it prevents multiple retrieval attempts π so the values are:0β a retrieve has not been attempted- a positive value β the retrieve was successful β¨
- a negative value β the retrieve failed, and that value is the error code of the call π
mutexβ a mutex that protects the fields of this specific instance (e.g.,retrieved,file), keeping stuff like retrieving or finishing a file atomic. iconic locking behaviour, we stan πlistβ thelist_headthat links this instance into its parent file_set's list of preserved files πtokenβ the user-provided unique token used to identify this file. iykyk π
π§ Description π§
this structure is the core in-kernel representation of a single file being managed through a live update. main character energy fr fr π
an instance gets created by luo_preserve_file, and it links a 'struct file' to its corresponding handler, a user-provided token, and the serialized state handle returned by the handler's .preserve operation. three things, one struct, slay π«Ά
these instances are tracked in a per-file_set list. the serialized_data field β which holds a handle to the file's serialized state β may be updated during the .freeze callback before being serialized for the next kernel. then after reboot, these structures get recreated by luo_file_deserialize π« and are finally cleaned up by luo_file_finish. full lifecycle, no loose ends β¨
π SEE ALSO π
- Kernel file
./kernel/liveupdate/luo_file.c LUO File Descriptors(9)luo_preserve_file(9)luo_file_unpreserve_files(9)luo_file_freeze(9)luo_file_unfreeze(9)luo_retrieve_file(9)luo_file_finish(9)luo_file_deserialize(9)liveupdate_register_file_handler(9)liveupdate_unregister_file_handler(9)
go read them, bestie, they're all linked in the group chat π¦
and that's the page!! ππ source/version: ./kernel/liveupdate Β· dated October 2026 Β· manual struct luo_file(9) β mwah, periodt π
π«Ά
π¦ 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