mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-21 03:55:04 +00:00
Remove Packet_ref from File_system::Packet_descriptor
The intention of Packet_ref was to allow clients to place opaque references into the packet descriptor itself, which could be observed on packet completion. Currently no component in our sources uses this feature and beyond that it is questionable if it should be used at all: If the server tampers with the ref the client may easily be confused into observing an incorrect or invalid context. It seems better to remove the opaque context from the descriptor and leave the actual implementation to the client and its needs.
This commit is contained in:
parent
9212fc0dc6
commit
24b1f269be
@ -121,7 +121,6 @@ namespace File_system {
|
||||
|
||||
Packet_descriptor
|
||||
packet(source.alloc_packet(curr_packet_size),
|
||||
0,
|
||||
node_handle,
|
||||
File_system::Packet_descriptor::READ,
|
||||
curr_packet_size,
|
||||
@ -178,7 +177,6 @@ namespace File_system {
|
||||
|
||||
Packet_descriptor
|
||||
packet(source.alloc_packet(curr_packet_size),
|
||||
0,
|
||||
node_handle,
|
||||
File_system::Packet_descriptor::WRITE,
|
||||
curr_packet_size,
|
||||
|
@ -28,15 +28,6 @@ namespace File_system {
|
||||
struct Dir_handle;
|
||||
struct Symlink_handle;
|
||||
|
||||
/**
|
||||
* Type of client context embedded in each packet descriptor
|
||||
*
|
||||
* Using the opaque refererence, the client is able to attribute incoming
|
||||
* packet acknowledgements to a context that is meaningful for the client.
|
||||
* It has no meaning at the server side.
|
||||
*/
|
||||
struct Packet_ref;
|
||||
|
||||
typedef Genode::uint64_t seek_off_t;
|
||||
typedef Genode::uint64_t file_size_t;
|
||||
|
||||
@ -123,8 +114,6 @@ class File_system::Packet_descriptor : public Genode::Packet_descriptor
|
||||
seek_off_t _position; /* seek offset in bytes */
|
||||
size_t _length; /* transaction length in bytes */
|
||||
bool _success; /* indicates success of operation */
|
||||
Packet_ref *_ref; /* opaque reference used at the client side
|
||||
for recognizing acknowledgements */
|
||||
|
||||
public:
|
||||
|
||||
@ -141,14 +130,13 @@ class File_system::Packet_descriptor : public Genode::Packet_descriptor
|
||||
*
|
||||
* \param position seek offset in bytes (by default, append)
|
||||
*/
|
||||
Packet_descriptor(Packet_descriptor p, Packet_ref *ref,
|
||||
Packet_descriptor(Packet_descriptor p,
|
||||
Node_handle handle, Opcode op, size_t length,
|
||||
seek_off_t position = ~0)
|
||||
:
|
||||
Genode::Packet_descriptor(p.offset(), p.size()),
|
||||
_handle(handle), _op(op),
|
||||
_position(position), _length(length), _success(false),
|
||||
_ref(ref)
|
||||
_position(position), _length(length), _success(false)
|
||||
{ }
|
||||
|
||||
Node_handle handle() const { return _handle; }
|
||||
@ -156,7 +144,6 @@ class File_system::Packet_descriptor : public Genode::Packet_descriptor
|
||||
seek_off_t position() const { return _position; }
|
||||
size_t length() const { return _length; }
|
||||
bool succeeded() const { return _success; }
|
||||
Packet_ref *ref() const { return _ref; }
|
||||
|
||||
/*
|
||||
* Accessors called at the server side
|
||||
|
@ -100,7 +100,6 @@ class Vfs::Fs_file_system : public File_system
|
||||
|
||||
::File_system::Packet_descriptor const
|
||||
packet_in(source.alloc_packet(clipped_count),
|
||||
0,
|
||||
node_handle,
|
||||
::File_system::Packet_descriptor::READ,
|
||||
clipped_count,
|
||||
@ -137,7 +136,6 @@ class Vfs::Fs_file_system : public File_system
|
||||
|
||||
::File_system::Packet_descriptor
|
||||
packet(source.alloc_packet(count),
|
||||
0,
|
||||
node_handle,
|
||||
::File_system::Packet_descriptor::WRITE,
|
||||
count,
|
||||
@ -217,7 +215,6 @@ class Vfs::Fs_file_system : public File_system
|
||||
|
||||
::File_system::Packet_descriptor
|
||||
packet(source.alloc_packet(count),
|
||||
0,
|
||||
file,
|
||||
::File_system::Packet_descriptor::READ,
|
||||
count,
|
||||
@ -298,7 +295,6 @@ class Vfs::Fs_file_system : public File_system
|
||||
|
||||
::File_system::Packet_descriptor
|
||||
packet(source.alloc_packet(DIRENT_SIZE),
|
||||
0,
|
||||
dir_handle,
|
||||
::File_system::Packet_descriptor::READ,
|
||||
DIRENT_SIZE,
|
||||
|
@ -74,7 +74,6 @@ class Fs_log::Log_file : public List<Log_file>::Element
|
||||
|
||||
File_system::Packet_descriptor
|
||||
packet(raw_packet,
|
||||
0, /* The result struct. */
|
||||
_handle, File_system::Packet_descriptor::WRITE,
|
||||
msg_len, _offset);
|
||||
|
||||
@ -88,4 +87,4 @@ class Fs_log::Log_file : public List<Log_file>::Element
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user