diff --git a/.travis.yml b/.travis.yml index dcf3226..f29feeb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,5 +2,5 @@ language: rust rust: - nightly script: - - cargo build --bin mksfs --features "std" + - cargo build - cargo test --verbose -- --test-threads=1 \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 8cb7f81..d22438a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,18 +1,5 @@ -[package] -name = "simple-filesystem" -version = "0.1.0" -authors = ["WangRunji ", "Ben Pig Chu "] -edition = "2018" - -[[bin]] -name = "mksfs" -path = "src/bin/mksfs.rs" -required-features = ["std"] - -[dependencies] -bit-vec = { default-features = false, git = "https://github.com/AltSysrq/bit-vec.git" } # default-features contains 'std' -static_assertions = "0.3" -spin = "0.4" - -[features] -std = [] \ No newline at end of file +[workspace] +members = [ + "rcore-fs", + "rcore-fs-fuse" +] \ No newline at end of file diff --git a/rcore-fs-fuse/Cargo.toml b/rcore-fs-fuse/Cargo.toml index 5709123..23ba98f 100644 --- a/rcore-fs-fuse/Cargo.toml +++ b/rcore-fs-fuse/Cargo.toml @@ -11,4 +11,4 @@ log = "0.4" fuse = "0.3" structopt = "0.2" env_logger = "0.3" -simple-filesystem = { path = "..", features = ["std"] } +rcore-fs = { path = "../rcore-fs", features = ["std"] } diff --git a/rcore-fs-fuse/src/main.rs b/rcore-fs-fuse/src/main.rs index dcfe50b..410c3c8 100644 --- a/rcore-fs-fuse/src/main.rs +++ b/rcore-fs-fuse/src/main.rs @@ -10,7 +10,7 @@ use log::*; use structopt::StructOpt; use time::Timespec; -use simple_filesystem::{sfs, vfs}; +use rcore_fs::{sfs, vfs}; const TTL: Timespec = Timespec { sec: 1, nsec: 0 }; // 1 second diff --git a/rcore-fs-ucore/Cargo.toml b/rcore-fs-ucore/Cargo.toml index 12f4103..9bb6d03 100644 --- a/rcore-fs-ucore/Cargo.toml +++ b/rcore-fs-ucore/Cargo.toml @@ -13,7 +13,7 @@ panic = 'abort' # prevent `_Unwind_Resume` link error [dependencies] bitflags = "1.0" static_assertions = "0.3" -simple-filesystem = { path = ".." } +rcore-fs = { path = "../rcore-fs" } spin = "0.4" lazy_static = { version = "1.2", features = ["spin_no_std"] } diff --git a/rcore-fs-ucore/src/lib.rs b/rcore-fs-ucore/src/lib.rs index 1a64588..2cdc42c 100644 --- a/rcore-fs-ucore/src/lib.rs +++ b/rcore-fs-ucore/src/lib.rs @@ -22,7 +22,7 @@ use core::alloc::{GlobalAlloc, Layout}; use core::mem; use core::ops::Deref; use core::slice; -use simple_filesystem::{sfs, vfs}; +use rcore_fs::{sfs, vfs}; use spin::Mutex; /// Lang items for bare lib diff --git a/rcore-fs/Cargo.toml b/rcore-fs/Cargo.toml new file mode 100644 index 0000000..f4be60e --- /dev/null +++ b/rcore-fs/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "rcore-fs" +version = "0.1.0" +authors = ["WangRunji ", "Ben Pig Chu "] +edition = "2018" + +[[bin]] +name = "mksfs" +path = "src/bin/mksfs.rs" +required-features = ["std"] + +[dependencies] +bit-vec = { default-features = false, git = "https://github.com/AltSysrq/bit-vec.git" } # default-features contains 'std' +static_assertions = "0.3" +spin = "0.4" + +[features] +std = [] \ No newline at end of file diff --git a/src/bin/mksfs.rs b/rcore-fs/src/bin/mksfs.rs similarity index 98% rename from src/bin/mksfs.rs rename to rcore-fs/src/bin/mksfs.rs index 63ccf46..ec8910e 100644 --- a/src/bin/mksfs.rs +++ b/rcore-fs/src/bin/mksfs.rs @@ -4,7 +4,7 @@ use std::io::{Read, Write, Result}; use std::path::Path; use std::mem::uninitialized; use std::sync::Arc; -use simple_filesystem::*; +use rcore_fs::{sfs::SimpleFileSystem, vfs::*}; fn main() -> Result<()> { let args: Vec<_> = env::args().collect(); diff --git a/src/blocked_device.rs b/rcore-fs/src/blocked_device.rs similarity index 100% rename from src/blocked_device.rs rename to rcore-fs/src/blocked_device.rs diff --git a/src/dirty.rs b/rcore-fs/src/dirty.rs similarity index 100% rename from src/dirty.rs rename to rcore-fs/src/dirty.rs diff --git a/src/file.rs b/rcore-fs/src/file.rs similarity index 100% rename from src/file.rs rename to rcore-fs/src/file.rs diff --git a/src/lib.rs b/rcore-fs/src/lib.rs similarity index 100% rename from src/lib.rs rename to rcore-fs/src/lib.rs diff --git a/src/sfs.rs b/rcore-fs/src/sfs.rs similarity index 100% rename from src/sfs.rs rename to rcore-fs/src/sfs.rs diff --git a/src/structs.rs b/rcore-fs/src/structs.rs similarity index 100% rename from src/structs.rs rename to rcore-fs/src/structs.rs diff --git a/src/tests.rs b/rcore-fs/src/tests.rs similarity index 97% rename from src/tests.rs rename to rcore-fs/src/tests.rs index 24a0abf..4624ab2 100644 --- a/src/tests.rs +++ b/rcore-fs/src/tests.rs @@ -41,11 +41,17 @@ fn create_file() -> Result<()> { let file1 = root.create("file1", FileType::File)?; assert_eq!(file1.info()?, FileInfo { + inode: 5, size: 0, type_: FileType::File, - mode: 0, + mode: 0o777, blocks: 0, + atime: Timespec { sec: 0, nsec: 0 }, + mtime: Timespec { sec: 0, nsec: 0 }, nlinks: 1, + uid: 0, + ctime: Timespec { sec: 0, nsec: 0 }, + gid: 0 }); sfs.sync()?; diff --git a/src/util.rs b/rcore-fs/src/util.rs similarity index 100% rename from src/util.rs rename to rcore-fs/src/util.rs diff --git a/src/vfs.rs b/rcore-fs/src/vfs.rs similarity index 100% rename from src/vfs.rs rename to rcore-fs/src/vfs.rs