Skip to content

vmem: vmem block funcs now able to lazy init devices#81

Merged
edvardxyz merged 4 commits into
release/2.1from
lazy_init_vmem_block
May 29, 2026
Merged

vmem: vmem block funcs now able to lazy init devices#81
edvardxyz merged 4 commits into
release/2.1from
lazy_init_vmem_block

Conversation

@edvardxyz
Copy link
Copy Markdown
Contributor

Lazy init if vmem_block_init() not called by user

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds lazy initialization of VMEM block devices so that cache read/write/flush operations will trigger device initialization if vmem_block_init() has not been called by the user. The per-device init/print logic is also factored out of vmem_block_init() into a new static helper _vmem_block_init().

Changes:

  • New _vmem_block_init() static helper that prints device info and invokes the device's init callback.
  • cache_flush, cache_write, and cache_read now check drv->device->state == VMEM_BLOCK_STATE_UNKNOWN and call _vmem_block_init() to lazily initialize the device.
  • vmem_block_init() is refactored to call _vmem_block_init() per device and logs an error when initialization fails.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/vmem/vmem_block.c Outdated
Comment thread src/vmem/vmem_block.c Outdated
Comment thread src/vmem/vmem_block.c Outdated
Comment thread src/vmem/vmem_block.c
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread src/vmem/vmem_block.c
Comment thread src/vmem/vmem_block.c
@edvardxyz edvardxyz merged commit e42be55 into release/2.1 May 29, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants