-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hierarchical Namespace Naming Update (#255)
* Switch init to use new runtime. * Cleanup tests. * Reorg. * Added secure gate naming library * reverted changes * refactored naming service * removed changes in main * did fmt * removed unnecessary dependency * updated naming service * added naming support to etl system * fixed bug with using twzid instead of path * changed naming to twizzler vec * Implement dynamic gate lookup. * Implement dynamic gate calling. * Move pager init and add pager dynamic gate lookup. * Added runtime naming support * Added std::fs support for etl_twizzler * cargo fmt * added preliminary changes for namespace * namespaces v0.2 * namespace v0.3 * updated naming-srv * weird bug in code * removed warnings * Added more tests * Fix kernel dep, update ABI. * Fix kernel dep, update ABI. * Added create to runtime * removed warnings * finished naming? * added api for initializing namespace from object --------- Co-authored-by: Daniel Bittman <[email protected]>
- Loading branch information
1 parent
6613dec
commit b12a4d5
Showing
19 changed files
with
1,054 additions
and
249 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[package] | ||
name = "ls" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
clap = { version = "4.5.26", features = ["derive"] } | ||
naming = { path = "../../lib/naming" } |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
use std::{cmp::Ordering, path::PathBuf}; | ||
|
||
use clap::Parser; | ||
use naming::{static_naming_factory, EntryType, StaticNamingHandle}; | ||
|
||
#[derive(Parser, Debug)] | ||
#[command(version, about, long_about = None)] | ||
struct Args { | ||
#[arg(short, long)] | ||
recursive: bool, | ||
path: Option<String>, | ||
} | ||
|
||
fn recurse(handle: &mut StaticNamingHandle, foo: &mut PathBuf) { | ||
let mut names = handle.enumerate_names().unwrap(); | ||
names.sort_by(|a, b| { | ||
if a.entry_type == EntryType::Namespace { | ||
Ordering::Greater | ||
} else if b.entry_type == EntryType::Namespace { | ||
Ordering::Less | ||
} else { | ||
a.name.cmp(&b.name) | ||
} | ||
}); | ||
|
||
println!("{}:", foo.display()); | ||
for x in &names { | ||
foo.push(x.name); | ||
print!("{} ", x.name); | ||
foo.pop(); | ||
} | ||
println!("\n"); | ||
for x in &names { | ||
if x.entry_type != EntryType::Namespace { | ||
break; | ||
} | ||
foo.push(x.name); | ||
handle.change_namespace(&x.name).unwrap(); | ||
recurse(handle, foo); | ||
handle.change_namespace("..").unwrap(); | ||
foo.pop(); | ||
} | ||
} | ||
|
||
fn main() { | ||
let args = Args::parse(); | ||
|
||
let mut namer = static_naming_factory().unwrap(); | ||
|
||
if args.recursive { | ||
let mut path = PathBuf::new(); | ||
path.push("."); | ||
recurse(&mut namer, &mut path); | ||
} else { | ||
let mut names = namer | ||
.enumerate_names_relative(&args.path.unwrap_or("/".to_string())) | ||
.unwrap(); | ||
names.sort_by(|a, b| { | ||
if a.entry_type == EntryType::Namespace { | ||
Ordering::Greater | ||
} else if b.entry_type == EntryType::Namespace { | ||
Ordering::Less | ||
} else { | ||
a.name.cmp(&b.name) | ||
} | ||
}); | ||
for x in &names { | ||
print!("{} ", x.name); | ||
} | ||
println!("") | ||
} | ||
} |
This file contains 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
Oops, something went wrong.