Filesystem: retire fs_status enum in favor of standard error codes #2054
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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).