增加epoll机制 (#455)

* ## 增加epoll机制
- 增加epoll机制
- 添加事件等待队列,提升socket性能
- 优化poll,删除不能poll的文件系统中的poll方法

* 添加细节注释

* 修复文件关闭后epoll还持有对应描述符的文件弱引用的bug

* 将EPollEvent设计为POSIX标准

* 修改s到us转换的计算错误
This commit is contained in:
GnoCiYeH
2023-12-25 18:08:12 +08:00
committed by GitHub
parent 070e991008
commit 406099704e
27 changed files with 1667 additions and 228 deletions

View File

@ -21,7 +21,7 @@ use self::callback::{KernCallbackData, KernFSCallback, KernInodePrivateData};
use super::vfs::{
core::generate_inode_id, file::FileMode, syscall::ModeType, FilePrivateData, FileSystem,
FileType, FsInfo, IndexNode, InodeId, Metadata, PollStatus,
FileType, FsInfo, IndexNode, InodeId, Metadata,
};
pub mod callback;
@ -293,11 +293,6 @@ impl IndexNode for KernFSInode {
return Ok(keys);
}
fn poll(&self) -> Result<PollStatus, SystemError> {
// todo: 根据inode的具体attribute返回PollStatus
return Ok(PollStatus::READ | PollStatus::WRITE);
}
fn read_at(
&self,
offset: usize,