Remove always true supports_on_close field
This commit is contained in:
+1
-1
@@ -217,7 +217,7 @@ impl SchemeList {
|
||||
};
|
||||
|
||||
let root_id = SchemeId(SCHEME_LIST_ID.load(Ordering::Relaxed));
|
||||
let inner = Arc::new(UserInner::new(root_id, id, true, context));
|
||||
let inner = Arc::new(UserInner::new(root_id, id, context));
|
||||
let new_scheme = Handle::Scheme(KernelSchemes::User(UserScheme::new(inner)));
|
||||
assert!(handles.insert(id, new_scheme).is_none());
|
||||
Ok(id)
|
||||
|
||||
+1
-23
@@ -45,7 +45,6 @@ use super::{CallerCtx, FileHandle, KernelScheme, OpenResult};
|
||||
pub struct UserInner {
|
||||
root_id: SchemeId,
|
||||
pub scheme_id: SchemeId,
|
||||
supports_on_close: bool,
|
||||
context: Weak<ContextLock>,
|
||||
todo: WaitQueue<Sqe>,
|
||||
|
||||
@@ -151,15 +150,9 @@ impl ParsedCqe {
|
||||
}
|
||||
|
||||
impl UserInner {
|
||||
pub fn new(
|
||||
root_id: SchemeId,
|
||||
scheme_id: SchemeId,
|
||||
new_close: bool,
|
||||
context: Weak<ContextLock>,
|
||||
) -> UserInner {
|
||||
pub fn new(root_id: SchemeId, scheme_id: SchemeId, context: Weak<ContextLock>) -> UserInner {
|
||||
UserInner {
|
||||
root_id,
|
||||
supports_on_close: new_close,
|
||||
scheme_id,
|
||||
context,
|
||||
todo: WaitQueue::new(),
|
||||
@@ -1571,21 +1564,6 @@ impl KernelScheme for UserScheme {
|
||||
}
|
||||
|
||||
fn close(&self, id: usize, token: &mut CleanLockToken) -> Result<()> {
|
||||
let ctx = { context::current().read(token.token()).caller_ctx() };
|
||||
if !self.inner.supports_on_close {
|
||||
self.inner
|
||||
.call(
|
||||
ctx,
|
||||
Vec::new(),
|
||||
Opcode::Close,
|
||||
[id],
|
||||
&mut PageSpan::empty(),
|
||||
token,
|
||||
)?
|
||||
.as_regular()?;
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
self.inner.todo.send(
|
||||
Sqe {
|
||||
opcode: Opcode::CloseMsg as u8,
|
||||
|
||||
Reference in New Issue
Block a user