Merged
Conversation
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Replace raw pointer parameters (*mut u8) with Option<&[u8]> in loop target I/O functions for improved type safety and clearer semantics: - lo_handle_io_cmd_async(): buf_addr -> buf: Option<&[u8]> - lo_handle_io_cmd_sync(): buf_addr -> buf: Option<&[u8]> - __lo_make_io_sqe(): buf_addr -> buf: Option<&[u8]> Use None for zero-copy mode and Some(slice) for regular buffers. No performance impact - slices are zero-copy views of existing buffers. Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Replace raw pointer parameters (*mut u8) with Option<&[u8]> in null target I/O functions for improved type safety and clearer semantics: - handle_io_cmd(): buf_addr -> buf: Option<&[u8]> Use None for user_copy mode and Some(slice) for regular buffers. No performance impact - slices are zero-copy views of existing buffers. Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Update all target implementations (compress, loop, null, qcow2, zoned, offload) to use the new unified buffer descriptor APIs from libublk: - Replace complete_io_cmd() with complete_io_cmd_unified() - Replace submit_fetch_commands() with submit_fetch_commands_unified() - Replace submit_io_cmd() with submit_io_fetch_cmd() and submit_io_commit_cmd() - Use BufDesc enum variants (Slice, AutoReg, ZonedAppendLba) instead of raw pointers - Use BufDescList for buffer list operations This migration improves type safety and API consistency across all targets. Signed-off-by: Ming Lei <tom.leiming@gmail.com>
- Consolidate handle_queue_tag_async_zc and handle_queue_tag_async into unified __handle_queue_tag_async - Remove redundant zc parameter from lo_handle_io_cmd_async, derive from buf presence - Simplify queue function dispatch logic by using single async handler - Improves code maintainability while preserving zero-copy functionality Signed-off-by: Ming Lei <tom.leiming@gmail.com>
- Consolidate lo_handle_io_cmd_sync and lo_handle_io_cmd_sync_zc into unified __lo_handle_io_cmd_sync - Merge q_fn and q_zc_fn into q_sync_fn with automatic buffer type detection - Simplify queue function dispatch from 3-way to 2-way conditional (async vs sync) - Reduces code duplication while maintaining full backward compatibility
- Consolidate handle_queue_tag_async_null_zc and handle_queue_tag_async_null into unified __handle_queue_tag_async_null - Automatic buffer type detection based on zero-copy support and user_copy mode - Simplify queue function dispatch logic by using single async handler - Reduces code duplication while preserving all functionality Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Update all smol executor usage to use exe.run(async { ... }) instead of
smol::block_on(async { ... }) for proper executor integration.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Add support for --mlock command line flag for locking io buffer pages: - Sets UBLK_DEV_F_MLOCK_IO_BUFFER flag when --mlock used without --zero-copy - Validates that --swap cannot be used with --user-copy (deadlock risk) - Stores device flags in high 32 bits of target_flags for recovery persistence - Restores original device flags during recovery, including mlock functionality - Replaces UBLK_DEV_F_ADD_DEV with UBLK_DEV_F_RECOVER_DEV during recovery This enables ublk devices to be used as swap devices with proper memory locking and recovery support. Signed-off-by: Ming Lei <tom.leiming@gmail.com>
- Add compress feature flag (disabled by default) - Make rocksdb and bincode dependencies optional - Add conditional compilation for compress target - Provide helpful error when compress not available - Reduces build time and binary size when compress not needed - Conditional compress tests Usage: - Default: cargo build (no compress target) - With compress: cargo build --features compress Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Integrate gpu vram target from wuhongzhi's ublk-vram: https://github.com/wuhongzhi/ublk-vram See detailed discussion in: #10 Follows some difference: - replace unconditional mlockall with --swap - ublk rublk's way to dump device - at default, device daemon is run in background, pass --foreground for running the server in foreground - add vram specific sub-command(rublk vram --list-opencl) for list all opencl devices - use generic '--size' command line Signed-off-by: Ming Lei <tom.leiming@gmail.com>
- enable vram at default Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.