From f334e760bbe48ea02767b9ad84deb3049a17dd95 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Fri, 6 Feb 2026 21:56:58 +0100 Subject: [PATCH] Remove ens field from Context It is no longer used due to the capability rework. --- src/context/context.rs | 2 -- src/main.rs | 1 - src/scheme/proc.rs | 6 ++---- src/scheme/sys/context.rs | 5 +---- 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/context/context.rs b/src/context/context.rs index ea502f7ea2..8396469757 100644 --- a/src/context/context.rs +++ b/src/context/context.rs @@ -141,7 +141,6 @@ pub struct Context { pub owner_proc_id: Option, // TODO: Temporary replacement for existing kernel logic, replace with capabilities! - pub ens: SchemeNamespace, pub euid: u32, pub egid: u32, pub pid: usize, @@ -197,7 +196,6 @@ impl Context { being_sigkilled: false, owner_proc_id, - ens: 0.into(), euid: 0, egid: 0, pid: 0, diff --git a/src/main.rs b/src/main.rs index 78fdfa2ac5..0a33109341 100644 --- a/src/main.rs +++ b/src/main.rs @@ -196,7 +196,6 @@ fn kmain(bootstrap: Bootstrap) -> ! { context.name.push_str("[bootstrap]"); // TODO: Remove these from kernel - context.ens = SchemeNamespace::from(1); context.euid = 0; context.egid = 0; } diff --git a/src/scheme/proc.rs b/src/scheme/proc.rs index 088d9e33ef..1b8cc06da6 100644 --- a/src/scheme/proc.rs +++ b/src/scheme/proc.rs @@ -1229,7 +1229,6 @@ impl ContextHandle { guard.name.push_str(debug_name); guard.pid = info.pid as usize; - guard.ens = (info.ens as usize).into(); guard.euid = info.euid; guard.egid = info.egid; Ok(size_of::()) @@ -1421,15 +1420,14 @@ impl ContextHandle { ContextHandle::Attr => { let mut debug_name = [0; 32]; let c = &context.read(token.token()); - let (euid, egid, ens, pid, name) = - (c.euid, c.egid, c.ens.get() as u32, c.pid as u32, c.name); + let (euid, egid, pid, name) = (c.euid, c.egid, c.pid as u32, c.name); let min = name.len().min(debug_name.len()); debug_name[..min].copy_from_slice(&name.as_bytes()[..min]); buf.copy_common_bytes_from_slice(&ProcSchemeAttrs { pid, euid, egid, - ens, + ens: 0, debug_name, }) } diff --git a/src/scheme/sys/context.rs b/src/scheme/sys/context.rs index cdda2f1129..556b4e811a 100644 --- a/src/scheme/sys/context.rs +++ b/src/scheme/sys/context.rs @@ -98,7 +98,6 @@ pub fn resource(token: &mut CleanLockToken) -> Result> { context.pid, context.euid, context.egid, - context.ens.get(), stat_string, cpu_string, affinity, @@ -114,7 +113,6 @@ pub fn resource(token: &mut CleanLockToken) -> Result> { pid, euid, egid, - ens, stat_string, cpu_string, affinity, @@ -125,11 +123,10 @@ pub fn resource(token: &mut CleanLockToken) -> Result> { { let _ = writeln!( string, - "{:<6}{:<6}{:<6}{:<6}{:<6}{:<6}{:<11}{:<12}{:<8}{}", + "{:<6}{:<6}{:<6}{:<6}{:<6}{:<11}{:<12}{:<8}{}", pid, euid, egid, - ens, stat_string, cpu_string, affinity,