vfs: simplify File_io_service::write return values

This patch removes the 'Insufficient_buffer' exception by returning the
WRITE_ERR_WOULD_BLOCK result value instead. It also eliminates the
superfluous WRITE_ERR_AGAIN and WRITE_ERR_INTERRUPT codes.

Issue #4697
This commit is contained in:
Norman Feske
2022-12-06 17:04:26 +01:00
committed by Christian Helmuth
parent d9f5dda322
commit cf87b0fadb
20 changed files with 228 additions and 321 deletions

View File

@ -30,16 +30,8 @@ struct Vfs::File_io_service : Interface
** Write **
***********/
/*
* Exception, thrown when, for example, 'alloc_packet()' or
* 'submit_packet()' failed in the VFS plugin. The caller can try again
* after a previous VFS request is completed.
*/
struct Insufficient_buffer { };
enum Write_result { WRITE_ERR_AGAIN, WRITE_ERR_WOULD_BLOCK,
WRITE_ERR_INVALID, WRITE_ERR_IO,
WRITE_ERR_INTERRUPT, WRITE_OK };
enum Write_result { WRITE_ERR_WOULD_BLOCK, WRITE_ERR_INVALID,
WRITE_ERR_IO, WRITE_OK };
virtual Write_result write(Vfs_handle *vfs_handle,
char const *buf, file_size buf_size,