include/linux/liveupdate.h
Source file repositories/reference/linux-study-clean/include/linux/liveupdate.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/liveupdate.h- Extension
.h- Size
- 11155 bytes
- Lines
- 297
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bug.hlinux/compiler.hlinux/kho/abi/luo.hlinux/list.hlinux/mutex.hlinux/refcount.hlinux/rwsem.hlinux/types.huapi/linux/liveupdate.h
Detected Declarations
struct liveupdate_file_handlerstruct liveupdate_flbstruct liveupdate_sessionstruct filestruct liveupdate_file_op_argsstruct liveupdate_file_opsstruct liveupdate_file_handlerstruct liveupdate_flb_op_argsstruct liveupdate_flb_opsstruct luo_flb_private_statestruct luo_flb_privatestruct liveupdate_flbfunction liveupdate_enabledfunction liveupdate_rebootfunction liveupdate_register_file_handlerfunction liveupdate_unregister_file_handlerfunction liveupdate_unregister_flbfunction liveupdate_flb_put_incoming
Annotated Snippet
struct liveupdate_file_op_args {
struct liveupdate_file_handler *handler;
int retrieve_status;
struct file *file;
u64 serialized_data;
void *private_data;
};
/**
* struct liveupdate_file_ops - Callbacks for live-updatable files.
* @can_preserve: Required. Lightweight check to see if this handler is
* compatible with the given file.
* @preserve: Required. Performs state-saving for the file.
* @unpreserve: Required. Cleans up any resources allocated by @preserve.
* @freeze: Optional. Final actions just before kernel transition.
* @unfreeze: Optional. Undo freeze operations.
* @retrieve: Required. Restores the file in the new kernel.
* @can_finish: Optional. Check if this FD can finish, i.e. all restoration
* pre-requirements for this FD are satisfied. Called prior to
* finish, in order to do successful finish calls for all
* resources in the session.
* @finish: Required. Final cleanup in the new kernel.
* @get_id: Optional. Returns a unique identifier for the file.
* @owner: Module reference
*
* All operations (except can_preserve) receive a pointer to a
* 'struct liveupdate_file_op_args' containing the necessary context.
*/
struct liveupdate_file_ops {
bool (*can_preserve)(struct liveupdate_file_handler *handler,
struct file *file);
int (*preserve)(struct liveupdate_file_op_args *args);
void (*unpreserve)(struct liveupdate_file_op_args *args);
int (*freeze)(struct liveupdate_file_op_args *args);
void (*unfreeze)(struct liveupdate_file_op_args *args);
int (*retrieve)(struct liveupdate_file_op_args *args);
bool (*can_finish)(struct liveupdate_file_op_args *args);
void (*finish)(struct liveupdate_file_op_args *args);
unsigned long (*get_id)(struct file *file);
struct module *owner;
};
/**
* struct liveupdate_file_handler - Represents a handler for a live-updatable file type.
* @ops: Callback functions
* @compatible: The compatibility string (e.g., "memfd-v1", "vfiofd-v1")
* that uniquely identifies the file type this handler
* supports. This is matched against the compatible string
* associated with individual &struct file instances.
*
* Modules that want to support live update for specific file types should
* register an instance of this structure. LUO uses this registration to
* determine if a given file can be preserved and to find the appropriate
* operations to manage its state across the update.
*/
struct liveupdate_file_handler {
const struct liveupdate_file_ops *ops;
const char compatible[LIVEUPDATE_HNDL_COMPAT_LENGTH];
/* private: */
/*
* Used for linking this handler instance into a global list of
* registered file handlers.
*/
struct list_head __private list;
/* A list of FLB dependencies. */
struct list_head __private flb_list;
};
/**
* struct liveupdate_flb_op_args - Arguments for FLB operation callbacks.
* @flb: The global FLB instance for which this call is performed.
* @data: For .preserve(): [OUT] The callback sets this field.
* For .unpreserve(): [IN] The handle from .preserve().
* For .retrieve(): [IN] The handle from .preserve().
* @obj: For .preserve(): [OUT] Sets this to the live object.
* For .retrieve(): [OUT] Sets this to the live object.
* For .finish(): [IN] The live object from .retrieve().
*
* This structure bundles all parameters for the FLB operation callbacks.
*/
struct liveupdate_flb_op_args {
struct liveupdate_flb *flb;
u64 data;
void *obj;
};
/**
* struct liveupdate_flb_ops - Callbacks for global File-Lifecycle-Bound data.
Annotation
- Immediate include surface: `linux/bug.h`, `linux/compiler.h`, `linux/kho/abi/luo.h`, `linux/list.h`, `linux/mutex.h`, `linux/refcount.h`, `linux/rwsem.h`, `linux/types.h`.
- Detected declarations: `struct liveupdate_file_handler`, `struct liveupdate_flb`, `struct liveupdate_session`, `struct file`, `struct liveupdate_file_op_args`, `struct liveupdate_file_ops`, `struct liveupdate_file_handler`, `struct liveupdate_flb_op_args`, `struct liveupdate_flb_ops`, `struct luo_flb_private_state`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.