Skip to content

Commit

Permalink
Yay! It loads a file! Closes #30
Browse files Browse the repository at this point in the history
  • Loading branch information
JackKelly committed Feb 8, 2024
1 parent 196a6b0 commit 749ea5c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/io_uring_local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,17 @@ fn create_sq_entry_for_get_op(
let filesize_bytes = get_filesize_bytes(location);

// Allocate vector:
*buffer = Some(Ok(Vec::with_capacity(filesize_bytes as _)));
// TODO: Don't initialise to all-zeros.
*buffer = Some(Ok(vec![0; filesize_bytes as _]));

// Create squeue::Entry
// TODO: Open file using io_uring. See issue #1
*fd = Some(
fs::OpenOptions::new()
.read(true)
.custom_flags(libc::O_DIRECT)
// TODO: Use DIRECT mode to open files. And allow the user to choose.
// I'll worry about DIRECT mode after we open file using io_uring. Issue #1.
// .custom_flags(libc::O_DIRECT)
.open(location)
.unwrap(),
);
Expand Down

0 comments on commit 749ea5c

Please sign in to comment.