luo_file_finish(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay bestie, welcome to luo_file_finish(9) from the Kernel API Manual β€” the function that completes the lifecycle for all files in a file_set. She is the final-teardown icon, the clean-up main character, and yes, she has receipts for every tracked file. πŸ’…

✨ SYNOPSIS ✨

int luo_file_finish (struct luo_file_set *file_set );

πŸŽ€ ARGUMENTS πŸŽ€

  • file_set β€” the file_set to be finalized. this is the one getting her finishing touches, bestie.

🌸 DESCRIPTION 🌸

This function orchestrates the final teardown of a live update file_set in the new kernel. It should be called after all necessary files have been retrieved and the userspace agent is ready to release the preserved state.

The function iterates through all tracked files. For each file, it performs the following sequence of cleanup actions:

  1. If the file is not yet retrieved, it retrieves it, and calls can_finish on every file in the file_set. If all can_finish return true, continue to finish.
  2. Calls the handler's .finish callback (via luo_file_finish_one) to allow for final resource cleanup within the handler.
  3. Releases LUO's ownership reference on the struct file via fput. This is the counterpart to the get_file call in luo_retrieve_file.
  4. Removes the struct luo_file from the file_set's internal list.
  5. Frees the memory for the struct luo_file instance itself.

After successfully finishing all individual files, it frees the contiguous memory block that was used to transfer the serialized metadata from the previous kernel. bye bye, metadata block, you did your thing 🫢

Error Handling (Atomic Failure): this operation is atomic, periodt. If any handler's .can_finish op fails, the entire function aborts immediately and returns an error. no partial-slay energy here β€” it's all or nothing 😭

πŸ¦‹ CONTEXT πŸ¦‹

Can be called from an ioctl handler in the new kernel. yes bestie, that's the vibe check for where she's allowed to show up. ✨

πŸ”₯ RETURN πŸ”₯

0 on success, or a negative errno on failure. simple, iconic, no cap. πŸ‘‘

🌈 SEE ALSO 🌈


mwah πŸ’‹ β€” this page came from source/version ./kernel/liveupdate, dated October 2026. bye bestie, go finish those files 🫢

πŸ“¦ where this page comes from