Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filesystem: retire fs_status enum in favor of standard error codes #2054

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

francescolavra
Copy link
Member

Having filesystem-specific error codes requires conversion between filesystem codes and POSIX standard codes every time a filesystem- related error is reported to userspace. For the 9P filesystem, in some cases a double conversion (from a standard code to a filesystem code and then back to a standard code) may need to be done.
This change removes the fs_status enum that declares the filesystem error codes, and uses standard POSIX codes to report filesystem errors; this allows eliminating the above conversions. Standard error codes are defined in the new kernel/errno.h header file; in order to prevent this file from being included from userspace code, the kernel directory is being removed from the include paths in the relevant Makefiles; this required some adjustments to other header files so that they can be included by both kernel and non- kernel code.
For the 9P filesystem, the p9_create() callback function is being modified so that EOPNOTSUPP is returned instead or EINVAL if the user program tries to open a file with the O_TMPFILE flag (#2051).

@aleasims
Copy link

Checked it locally, everything regarding error codes for O_TMPFILEs works perfect, thanks!

Having filesystem-specific error codes requires conversion between
filesystem codes and POSIX standard codes every time a filesystem-
related error is reported to userspace. For the 9P filesystem, in
some cases a double conversion (from a standard code to a
filesystem code and then back to a standard code) may need to be
done.
This change removes the fs_status enum that declares the filesystem
error codes, and uses standard POSIX codes to report filesystem
errors; this allows eliminating the above conversions. Standard
error codes are defined in the new kernel/errno.h header file; in
order to prevent this file from being included from userspace code,
the kernel directory is being removed from the include paths in
the relevant Makefiles; this required some adjustments to other
header files so that they can be included by both kernel and non-
kernel code.
For the 9P filesystem, the p9_create() callback function is being
modified so that EOPNOTSUPP is returned instead or EINVAL if the
user program tries to open a file with the O_TMPFILE flag (#2051).
@francescolavra francescolavra merged commit 721d2b9 into master Aug 26, 2024
5 checks passed
@francescolavra francescolavra deleted the fix/9p_tmpfile branch August 26, 2024 10:46
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.

2 participants