gramineproject / graphene

Graphene / Graphene-SGX - a library OS for Linux multi-process applications, with Intel SGX support
https://grapheneproject.io
GNU Lesser General Public License v3.0
771 stars 260 forks source link

[LibOS] Refactor pseudo filesystems #2453

Closed pwmarcz closed 3 years ago

pwmarcz commented 3 years ago

Description of the changes

See commit message for details.

I need this rewrite now, because it's really hard to change anything FS-related while tripping over all this boilerplate code in /proc, /dev and /sys. Now, shim_fs_pseudo.c provides an extra abstraction layer: when I'm refactoring, hopefully I won't need to touch these individual filesystems again, just shim_fs_pseudo.

Also, hopefully code for individual filesystems is much nicer now.

I realize it's a huge change. The problem is that it's hard to split: I could submit a change that rewrites just, say, /dev, but then there would be two shim_fs_pseudo implementations: old one, and new one; and some names might collide (when I was working on it, I did exactly that, and had to change some function names to pseudo2_*).

Fixes issues with /proc (fixes #2385, fixes #948).

How to test this PR?


This change is Reviewable