mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-16 22:28:18 +00:00
obscure File_system::Out_of_node_handles exception
Replace the Out_of_node_handles exception with Out_of_metadata. Clients need to know when the server is out of internal resources, but not why. Cleanup and sort the errors at file_system_session.h. Remove 'Size_limit_reached exception' from File_system, which was internal to ram_fs. Issue #1751 Fixes #1909
This commit is contained in:
committed by
Christian Helmuth
parent
58632ab8b5
commit
cb952d2087
@ -167,8 +167,8 @@ class Fs_log::Root_component :
|
||||
} catch (No_space) {
|
||||
PERR("file system out of space");
|
||||
|
||||
} catch (Out_of_node_handles) {
|
||||
PERR("too many open file handles");
|
||||
} catch (Out_of_metadata) {
|
||||
PERR("file system server out of metadata");
|
||||
|
||||
} catch (Invalid_name) {
|
||||
PERR("%s: invalid path", Path(file_name, dir_path).base());
|
||||
|
@ -97,7 +97,6 @@ class File_system::Session_component : public Session_rpc_object
|
||||
_process_packet_op(packet, *node);
|
||||
}
|
||||
catch (Invalid_handle) { PERR("Invalid_handle"); }
|
||||
catch (Size_limit_reached) { PERR("Size_limit_reached"); }
|
||||
|
||||
/*
|
||||
* The 'acknowledge_packet' function cannot block because we
|
||||
|
@ -95,7 +95,6 @@ namespace File_system {
|
||||
_process_packet_op(packet, *node);
|
||||
}
|
||||
catch (Invalid_handle) { PERR("Invalid_handle"); }
|
||||
catch (Size_limit_reached) { PERR("Size_limit_reached"); }
|
||||
|
||||
/*
|
||||
* The 'acknowledge_packet' function cannot block because we
|
||||
|
@ -107,7 +107,6 @@ namespace File_system {
|
||||
_process_packet_op(packet, *node);
|
||||
}
|
||||
catch (Invalid_handle) { PERR("Invalid_handle"); }
|
||||
catch (Size_limit_reached) { PERR("Size_limit_reached"); }
|
||||
|
||||
/*
|
||||
* The 'acknowledge_packet' function cannot block because we
|
||||
|
@ -171,8 +171,10 @@ namespace File_system {
|
||||
if (seek_offset == (seek_off_t)(~0))
|
||||
seek_offset = _chunk.used_size();
|
||||
|
||||
if (seek_offset + len >= Chunk_level_0::SIZE)
|
||||
throw Size_limit_reached();
|
||||
if (seek_offset + len >= Chunk_level_0::SIZE) {
|
||||
len = (Chunk_level_0::SIZE-1) - seek_offset;
|
||||
PERR("%s: size limit %d reached", name(), Chunk_level_0::SIZE);
|
||||
}
|
||||
|
||||
_chunk.write(src, len, (size_t)seek_offset);
|
||||
|
||||
|
@ -700,7 +700,6 @@ class File_system::Session_component : public Session_rpc_object
|
||||
_process_packet_op(packet, *node);
|
||||
}
|
||||
catch (Invalid_handle) { PERR("Invalid_handle"); }
|
||||
catch (Size_limit_reached) { PERR("Size_limit_reached"); }
|
||||
|
||||
/*
|
||||
* The 'acknowledge_packet' function cannot block because we
|
||||
|
@ -67,7 +67,7 @@ namespace File_system {
|
||||
/**
|
||||
* Allocate node handle
|
||||
*
|
||||
* \throw Out_of_node_handles
|
||||
* \throw Out_of_metadata
|
||||
*/
|
||||
int _alloc(Node *node, Mode mode)
|
||||
{
|
||||
@ -80,7 +80,7 @@ namespace File_system {
|
||||
return i;
|
||||
}
|
||||
|
||||
throw Out_of_node_handles();
|
||||
throw Out_of_metadata();
|
||||
}
|
||||
|
||||
bool _in_range(int handle) const
|
||||
|
Reference in New Issue
Block a user