fs: simplify file descriptor handling by dgruss · Pull Request #320 · isec-tugraz/sweb · GitHub
Skip to content

fs: simplify file descriptor handling - #320

Open
dgruss wants to merge 2 commits into
mainfrom
kernel-file-handles
Open

dgruss wants to merge 2 commits into
mainfrom
kernel-file-handles

Conversation

@dgruss

@dgruss dgruss commented Oct 12, 2026

Copy link
Copy Markdown
Member

The FileDescriptor + global list design goes back to the original file operations from 2005. uSTL was introduced in 2011. That conversion replaced the old PointList with an ustl::list, but kept the original data model.

The new filesystem made FileDescriptor a larger object in 2012. When the old filesystem was restored in 2015, the simple object containing only an fd and a File* came back. The filesystem cleanup in 2021 wrapped the global list in FileDescriptorList, but otherwise kept this design.

Today this is just a mapping from numeric fds to open files. With this PR I would replace the separately allocated pair-like objects and the list with an ustl::map<uint32, KernelFileHandle*>.

Also, to fix #175, I would rename File to KernelFileHandle to make the distinction between the numeric fd exposed to userspace and the corresponding kernel object clearer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rename filedescriptors in the kernel

1 participant