Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
Signed-off-by: Akira Hayakawa <ruby.wktk@gmail.com>
  • Loading branch information
akiradeveloper committed May 8, 2024
1 parent 8f88c49 commit 256a89b
Show file tree
Hide file tree
Showing 13 changed files with 5 additions and 580 deletions.
4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
[workspace]
members = [
"nbd",
"nbd-ramdisk",
"abuse",
"abuse-ramdisk",
"abusectl",
"abuse-ramdisk",
]
3 changes: 3 additions & 0 deletions abuse/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,16 @@ pub async fn run_on(config: Config, engine: impl StorageEngine) {
let page_address = io_vec.address as i64;
let map_len = io_vec.offset as usize + io_vec.len as usize;
println!("pfn={}, len={} bytes", page_address >> 9, map_len);

let mut prot_flags = ProtFlags::empty();
prot_flags.insert(ProtFlags::PROT_READ);
prot_flags.insert(ProtFlags::PROT_WRITE);

let mut map_flags = MapFlags::empty();
map_flags.insert(MapFlags::MAP_SHARED);
map_flags.insert(MapFlags::MAP_POPULATE);
map_flags.insert(MapFlags::MAP_NONBLOCK);

// Last argument page_offset should be a multiple of page size
// This passes to xxx_mmap as vma.pg_off after 9 right shift.
let p = unsafe { mmap(p0, map_len, prot_flags, map_flags, fd, page_address) }.expect("failed to mmap");
Expand Down
2 changes: 1 addition & 1 deletion abusectl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
clap = "3.0.0-beta.2"
clap = "4"
nix = "0.19"
13 changes: 0 additions & 13 deletions nbd-ramdisk/Cargo.toml

This file was deleted.

29 changes: 0 additions & 29 deletions nbd-ramdisk/README.md

This file was deleted.

57 changes: 0 additions & 57 deletions nbd-ramdisk/src/main.rs

This file was deleted.

14 changes: 0 additions & 14 deletions nbd/Cargo.toml

This file was deleted.

48 changes: 0 additions & 48 deletions nbd/src/lib.rs

This file was deleted.

165 changes: 0 additions & 165 deletions nbd/src/transport/mod.rs

This file was deleted.

Loading

0 comments on commit 256a89b

Please # to comment.