mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-14 13:18:19 +00:00
vfs: remove 'Io_response_handler' interface
The old 'Io_response_handler::io_progress_response' interface has been replaced by the 'Vfs::Env::User::wakeup_vfs_user' (issue #4697). The remaining 'read_ready_response' method is now hosted in the appropriately named 'Read_ready_response_handler'. Issue #4706
This commit is contained in:
committed by
Christian Helmuth
parent
74e6370187
commit
25e4bcefbf
@ -293,8 +293,7 @@ struct Vfs::Lxip_vfs_file_handle final : Vfs::Lxip_vfs_handle
|
|||||||
typedef Genode::Fifo_element<Lxip_vfs_file_handle> Fifo_element;
|
typedef Genode::Fifo_element<Lxip_vfs_file_handle> Fifo_element;
|
||||||
typedef Genode::Fifo<Fifo_element> Fifo;
|
typedef Genode::Fifo<Fifo_element> Fifo;
|
||||||
|
|
||||||
Fifo_element read_ready_elem { *this };
|
Fifo_element read_ready_elem { *this };
|
||||||
Fifo_element io_progress_elem { *this };
|
|
||||||
|
|
||||||
char content_buffer[Lxip::MAX_DATA_LEN];
|
char content_buffer[Lxip::MAX_DATA_LEN];
|
||||||
|
|
||||||
@ -346,12 +345,6 @@ struct Vfs::Lxip_vfs_file_handle final : Vfs::Lxip_vfs_handle
|
|||||||
|
|
||||||
virtual Sync_result sync() override {
|
virtual Sync_result sync() override {
|
||||||
return (file) ? file->sync() : Sync_result::SYNC_ERR_INVALID; }
|
return (file) ? file->sync() : Sync_result::SYNC_ERR_INVALID; }
|
||||||
|
|
||||||
void io_enqueue(Fifo &fifo)
|
|
||||||
{
|
|
||||||
if (!io_progress_elem.enqueued())
|
|
||||||
fifo.enqueue(io_progress_elem);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -379,26 +372,14 @@ struct Vfs::Lxip_vfs_dir_handle final : Vfs::Lxip_vfs_handle
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
static Vfs::Env::User *_vfs_user_ptr;
|
||||||
* Queues of open handles to poll
|
|
||||||
*/
|
|
||||||
static Vfs::Lxip_vfs_file_handle::Fifo *_io_progress_waiters_ptr;
|
|
||||||
static Vfs::Lxip_vfs_file_handle::Fifo *_read_ready_waiters_ptr;
|
static Vfs::Lxip_vfs_file_handle::Fifo *_read_ready_waiters_ptr;
|
||||||
|
|
||||||
|
|
||||||
static void poll_all()
|
static void poll_all()
|
||||||
{
|
{
|
||||||
_io_progress_waiters_ptr->for_each(
|
if (_vfs_user_ptr)
|
||||||
[&] (Vfs::Lxip_vfs_file_handle::Fifo_element &elem) {
|
_vfs_user_ptr->wakeup_vfs_user();
|
||||||
Vfs::Lxip_vfs_file_handle &handle = elem.object();
|
|
||||||
if (handle.file) {
|
|
||||||
if (handle.file->poll()) {
|
|
||||||
/* do not notify again until some I/O queues */
|
|
||||||
_io_progress_waiters_ptr->remove(elem);
|
|
||||||
|
|
||||||
handle.io_progress_response();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
_read_ready_waiters_ptr->for_each(
|
_read_ready_waiters_ptr->for_each(
|
||||||
[&] (Vfs::Lxip_vfs_file_handle::Fifo_element &elem) {
|
[&] (Vfs::Lxip_vfs_file_handle::Fifo_element &elem) {
|
||||||
@ -513,10 +494,9 @@ class Vfs::Lxip_data_file final : public Vfs::Lxip_file
|
|||||||
msghdr msg = create_msghdr(nullptr, 0, len, &iov);
|
msghdr msg = create_msghdr(nullptr, 0, len, &iov);
|
||||||
|
|
||||||
Lxip::ssize_t ret = _sock.ops->recvmsg(&_sock, &msg, len, MSG_DONTWAIT);
|
Lxip::ssize_t ret = _sock.ops->recvmsg(&_sock, &msg, len, MSG_DONTWAIT);
|
||||||
if (ret == -EAGAIN) {
|
if (ret == -EAGAIN)
|
||||||
handle.io_enqueue(*_io_progress_waiters_ptr);
|
|
||||||
throw Would_block();
|
throw Would_block();
|
||||||
}
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -743,7 +723,6 @@ class Vfs::Lxip_connect_file final : public Vfs::Lxip_file
|
|||||||
case Lxip::Io_result::LINUX_EINPROGRESS:
|
case Lxip::Io_result::LINUX_EINPROGRESS:
|
||||||
_connecting = true;
|
_connecting = true;
|
||||||
_write_err = 0;
|
_write_err = 0;
|
||||||
handle.io_enqueue(*_io_progress_waiters_ptr);
|
|
||||||
return len;
|
return len;
|
||||||
|
|
||||||
case Lxip::Io_result::LINUX_EALREADY:
|
case Lxip::Io_result::LINUX_EALREADY:
|
||||||
@ -892,10 +871,9 @@ class Vfs::Lxip_remote_file final : public Vfs::Lxip_file
|
|||||||
sizeof(handle.content_buffer), &iov);
|
sizeof(handle.content_buffer), &iov);
|
||||||
|
|
||||||
int const res = _sock.ops->recvmsg(&_sock, &msg, 0, MSG_DONTWAIT|MSG_PEEK);
|
int const res = _sock.ops->recvmsg(&_sock, &msg, 0, MSG_DONTWAIT|MSG_PEEK);
|
||||||
if (res == -EAGAIN) {
|
if (res == -EAGAIN)
|
||||||
handle.io_enqueue(*_io_progress_waiters_ptr);
|
|
||||||
throw Would_block();
|
throw Would_block();
|
||||||
}
|
|
||||||
if (res < 0) return -1;
|
if (res < 0) return -1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -974,7 +952,6 @@ class Vfs::Lxip_accept_file final : public Vfs::Lxip_file
|
|||||||
return Genode::strlen(dst);
|
return Genode::strlen(dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
handle.io_enqueue(*_io_progress_waiters_ptr);
|
|
||||||
throw Would_block();
|
throw Would_block();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -1928,10 +1905,8 @@ class Vfs::Lxip_file_system : public Vfs::File_system,
|
|||||||
Lxip_vfs_file_handle *file_handle =
|
Lxip_vfs_file_handle *file_handle =
|
||||||
dynamic_cast<Vfs::Lxip_vfs_file_handle*>(handle);
|
dynamic_cast<Vfs::Lxip_vfs_file_handle*>(handle);
|
||||||
|
|
||||||
if (file_handle) {
|
if (file_handle)
|
||||||
_io_progress_waiters_ptr->remove(file_handle->io_progress_elem);
|
|
||||||
_read_ready_waiters_ptr->remove(file_handle->read_ready_elem);
|
_read_ready_waiters_ptr->remove(file_handle->read_ready_elem);
|
||||||
}
|
|
||||||
|
|
||||||
Genode::destroy(handle->alloc(), handle);
|
Genode::destroy(handle->alloc(), handle);
|
||||||
}
|
}
|
||||||
@ -2044,6 +2019,7 @@ struct Lxip_factory : Vfs::File_system_factory
|
|||||||
|
|
||||||
Vfs::File_system *create(Vfs::Env &env, Genode::Xml_node config) override
|
Vfs::File_system *create(Vfs::Env &env, Genode::Xml_node config) override
|
||||||
{
|
{
|
||||||
|
_vfs_user_ptr = &env.user();
|
||||||
static Init inst(env.env(), env.alloc());
|
static Init inst(env.env(), env.alloc());
|
||||||
return new (env.alloc()) Vfs::Lxip_file_system(env, config);
|
return new (env.alloc()) Vfs::Lxip_file_system(env, config);
|
||||||
}
|
}
|
||||||
@ -2052,11 +2028,9 @@ struct Lxip_factory : Vfs::File_system_factory
|
|||||||
|
|
||||||
extern "C" Vfs::File_system_factory *vfs_file_system_factory(void)
|
extern "C" Vfs::File_system_factory *vfs_file_system_factory(void)
|
||||||
{
|
{
|
||||||
static Vfs::Lxip_vfs_file_handle::Fifo io_progress_waiters;
|
|
||||||
static Vfs::Lxip_vfs_file_handle::Fifo read_ready_waiters;
|
static Vfs::Lxip_vfs_file_handle::Fifo read_ready_waiters;
|
||||||
|
|
||||||
_io_progress_waiters_ptr = &io_progress_waiters;
|
_read_ready_waiters_ptr = &read_ready_waiters;
|
||||||
_read_ready_waiters_ptr = &read_ready_waiters;
|
|
||||||
|
|
||||||
static Lxip_factory factory;
|
static Lxip_factory factory;
|
||||||
return &factory;
|
return &factory;
|
||||||
|
@ -94,17 +94,11 @@ class Vfs_audit::File_system : public Vfs::File_system
|
|||||||
audit->seek(Vfs_handle::seek());
|
audit->seek(Vfs_handle::seek());
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle(Vfs_audit::File_system &fs,
|
Handle(Vfs_audit::File_system &fs, Genode::Allocator &alloc,
|
||||||
Genode::Allocator &alloc,
|
int flags, char const *path)
|
||||||
int flags,
|
:
|
||||||
char const *path)
|
Vfs_handle(fs, fs, alloc, flags), path(path)
|
||||||
: Vfs_handle(fs, fs, alloc, flags), path(path) { };
|
{ };
|
||||||
|
|
||||||
void handler(Io_response_handler *rh) override
|
|
||||||
{
|
|
||||||
Vfs_handle::handler(rh);
|
|
||||||
if (audit) audit->handler(rh);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -113,7 +107,7 @@ class Vfs_audit::File_system : public Vfs::File_system
|
|||||||
:
|
:
|
||||||
_audit_log(env.env(), config.attribute_value("label", Genode::String<64>("audit")).string()),
|
_audit_log(env.env(), config.attribute_value("label", Genode::String<64>("audit")).string()),
|
||||||
_root_dir(env.root_dir()),
|
_root_dir(env.root_dir()),
|
||||||
_audit_path(config.attribute_value(
|
_audit_path(config.attribute_value(
|
||||||
"path", Genode::String<Absolute_path::capacity()>()).string())
|
"path", Genode::String<Absolute_path::capacity()>()).string())
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
@ -36,11 +36,11 @@ struct Vfs_gpu::File_system : Single_file_system
|
|||||||
struct Gpu_vfs_handle : Single_vfs_handle
|
struct Gpu_vfs_handle : Single_vfs_handle
|
||||||
{
|
{
|
||||||
bool _complete { false };
|
bool _complete { false };
|
||||||
Genode::Env &_env;
|
Vfs::Env &_env;
|
||||||
Gpu::Connection _gpu_session { _env };
|
Gpu::Connection _gpu_session { _env.env() };
|
||||||
|
|
||||||
Genode::Io_signal_handler<Gpu_vfs_handle> _completion_sigh {
|
Genode::Io_signal_handler<Gpu_vfs_handle> _completion_sigh {
|
||||||
_env.ep(), *this, &Gpu_vfs_handle::_handle_completion };
|
_env.env().ep(), *this, &Gpu_vfs_handle::_handle_completion };
|
||||||
|
|
||||||
using Id_space = Genode::Id_space<Gpu_vfs_handle>;
|
using Id_space = Genode::Id_space<Gpu_vfs_handle>;
|
||||||
Id_space::Element const _elem;
|
Id_space::Element const _elem;
|
||||||
@ -48,16 +48,17 @@ struct Vfs_gpu::File_system : Single_file_system
|
|||||||
void _handle_completion()
|
void _handle_completion()
|
||||||
{
|
{
|
||||||
_complete = true;
|
_complete = true;
|
||||||
io_progress_response();
|
_env.user().wakeup_vfs_user();
|
||||||
}
|
}
|
||||||
|
|
||||||
Gpu_vfs_handle(Genode::Env &env,
|
Gpu_vfs_handle(Vfs::Env &env,
|
||||||
Directory_service &ds,
|
Directory_service &ds,
|
||||||
File_io_service &fs,
|
File_io_service &fs,
|
||||||
Genode::Allocator &alloc,
|
Genode::Allocator &alloc,
|
||||||
Id_space &space)
|
Id_space &space)
|
||||||
: Single_vfs_handle(ds, fs, alloc, 0),
|
:
|
||||||
_env(env), _elem(*this, space)
|
Single_vfs_handle(ds, fs, alloc, 0),
|
||||||
|
_env(env), _elem(*this, space)
|
||||||
{
|
{
|
||||||
_gpu_session.completion_sigh(_completion_sigh);
|
_gpu_session.completion_sigh(_completion_sigh);
|
||||||
}
|
}
|
||||||
@ -110,7 +111,7 @@ struct Vfs_gpu::File_system : Single_file_system
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Gpu_vfs_handle *handle = new (alloc)
|
Gpu_vfs_handle *handle = new (alloc)
|
||||||
Gpu_vfs_handle(_env.env(), *this, *this, alloc, _handle_space);
|
Gpu_vfs_handle(_env, *this, *this, alloc, _handle_space);
|
||||||
|
|
||||||
_last_id = handle->id();
|
_last_id = handle->id();
|
||||||
*out_handle = handle;
|
*out_handle = handle;
|
||||||
|
@ -84,27 +84,28 @@ struct Vfs_pipe::Pipe_handle : Vfs::Vfs_handle, private Pipe_handle_registry_ele
|
|||||||
|
|
||||||
struct Vfs_pipe::Pipe
|
struct Vfs_pipe::Pipe
|
||||||
{
|
{
|
||||||
Genode::Env &env;
|
Genode::Env &env;
|
||||||
|
Vfs::Env::User &vfs_user;
|
||||||
Genode::Allocator &alloc;
|
Genode::Allocator &alloc;
|
||||||
Pipe_space::Element space_elem;
|
|
||||||
Pipe_buffer buffer { };
|
Pipe_space::Element space_elem;
|
||||||
|
Pipe_buffer buffer { };
|
||||||
Pipe_handle_registry registry { };
|
Pipe_handle_registry registry { };
|
||||||
Handle_fifo io_progress_waiters { };
|
|
||||||
Handle_fifo read_ready_waiters { };
|
Handle_fifo read_ready_waiters { };
|
||||||
|
|
||||||
unsigned num_writers = 0;
|
unsigned num_writers = 0;
|
||||||
bool waiting_for_writers = true;
|
bool waiting_for_writers = true;
|
||||||
|
|
||||||
Genode::Io_signal_handler<Pipe> _read_notify_handler
|
Genode::Io_signal_handler<Pipe> _read_notify_handler
|
||||||
{ env.ep(), *this, &Pipe::notify_read };
|
{ env.ep(), *this, &Pipe::notify_read };
|
||||||
|
|
||||||
Genode::Io_signal_handler<Pipe> _write_notify_handler
|
|
||||||
{ env.ep(), *this, &Pipe::notify_write };
|
|
||||||
|
|
||||||
bool new_handle_active { true };
|
bool new_handle_active { true };
|
||||||
|
|
||||||
Pipe(Genode::Env &env, Genode::Allocator &alloc, Pipe_space &space)
|
Pipe(Genode::Env &env, Vfs::Env::User &vfs_user,
|
||||||
|
Genode::Allocator &alloc, Pipe_space &space)
|
||||||
:
|
:
|
||||||
env(env), alloc(alloc), space_elem(*this, space)
|
env(env), vfs_user(vfs_user), alloc(alloc), space_elem(*this, space)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
~Pipe() = default;
|
~Pipe() = default;
|
||||||
@ -121,12 +122,6 @@ struct Vfs_pipe::Pipe
|
|||||||
elem.object().read_ready_response(); });
|
elem.object().read_ready_response(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void notify_write()
|
|
||||||
{
|
|
||||||
io_progress_waiters.dequeue_all([] (Handle_element &elem) {
|
|
||||||
elem.object().io_progress_response(); });
|
|
||||||
}
|
|
||||||
|
|
||||||
void submit_read_signal()
|
void submit_read_signal()
|
||||||
{
|
{
|
||||||
_read_notify_handler.local_submit();
|
_read_notify_handler.local_submit();
|
||||||
@ -134,7 +129,7 @@ struct Vfs_pipe::Pipe
|
|||||||
|
|
||||||
void submit_write_signal()
|
void submit_write_signal()
|
||||||
{
|
{
|
||||||
_write_notify_handler.local_submit();
|
vfs_user.wakeup_vfs_user();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -161,8 +156,6 @@ struct Vfs_pipe::Pipe
|
|||||||
*/
|
*/
|
||||||
void remove(Pipe_handle &handle)
|
void remove(Pipe_handle &handle)
|
||||||
{
|
{
|
||||||
if (handle.io_progress_elem.enqueued())
|
|
||||||
io_progress_waiters.remove(handle.io_progress_elem);
|
|
||||||
if (handle.read_ready_elem.enqueued())
|
if (handle.read_ready_elem.enqueued())
|
||||||
read_ready_waiters.remove(handle.read_ready_elem);
|
read_ready_waiters.remove(handle.read_ready_elem);
|
||||||
}
|
}
|
||||||
@ -183,7 +176,6 @@ struct Vfs_pipe::Pipe
|
|||||||
Genode::warning("flushing non-empty buffer. capacity=", buffer.avail_capacity());
|
Genode::warning("flushing non-empty buffer. capacity=", buffer.avail_capacity());
|
||||||
|
|
||||||
buffer.reset();
|
buffer.reset();
|
||||||
io_progress_waiters.dequeue_all([] (Handle_element &/*elem*/) { });
|
|
||||||
}
|
}
|
||||||
*handle = new (alloc)
|
*handle = new (alloc)
|
||||||
Pipe_handle(fs, alloc, Directory_service::OPEN_MODE_WRONLY, registry, *this);
|
Pipe_handle(fs, alloc, Directory_service::OPEN_MODE_WRONLY, registry, *this);
|
||||||
@ -205,12 +197,11 @@ struct Vfs_pipe::Pipe
|
|||||||
return Open_result::OPEN_ERR_UNACCESSIBLE;
|
return Open_result::OPEN_ERR_UNACCESSIBLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
Write_result write(Pipe_handle &handle,
|
Write_result write(Pipe_handle &,
|
||||||
const char *buf, file_size count,
|
const char *buf, file_size count,
|
||||||
file_size &out_count)
|
file_size &out_count)
|
||||||
{
|
{
|
||||||
file_size out = 0;
|
file_size out = 0;
|
||||||
bool notify = buffer.empty();
|
|
||||||
|
|
||||||
if (buffer.avail_capacity() == 0) {
|
if (buffer.avail_capacity() == 0) {
|
||||||
out_count = 0;
|
out_count = 0;
|
||||||
@ -223,11 +214,9 @@ struct Vfs_pipe::Pipe
|
|||||||
}
|
}
|
||||||
|
|
||||||
out_count = out;
|
out_count = out;
|
||||||
if (out < count)
|
|
||||||
io_progress_waiters.enqueue(handle.io_progress_elem);
|
|
||||||
|
|
||||||
if (notify)
|
if (out > 0)
|
||||||
submit_read_signal();
|
vfs_user.wakeup_vfs_user();
|
||||||
|
|
||||||
return Write_result::WRITE_OK;
|
return Write_result::WRITE_OK;
|
||||||
}
|
}
|
||||||
@ -236,8 +225,6 @@ struct Vfs_pipe::Pipe
|
|||||||
char *buf, file_size count,
|
char *buf, file_size count,
|
||||||
file_size &out_count)
|
file_size &out_count)
|
||||||
{
|
{
|
||||||
bool notify = buffer.avail_capacity() == 0;
|
|
||||||
|
|
||||||
file_size out = 0;
|
file_size out = 0;
|
||||||
while (out < count && !buffer.empty()) {
|
while (out < count && !buffer.empty()) {
|
||||||
*(buf++) = buffer.get();
|
*(buf++) = buffer.get();
|
||||||
@ -245,7 +232,8 @@ struct Vfs_pipe::Pipe
|
|||||||
}
|
}
|
||||||
|
|
||||||
out_count = out;
|
out_count = out;
|
||||||
if (!out) {
|
|
||||||
|
if (out == 0) {
|
||||||
|
|
||||||
/* Send only EOF when at least one writer opened the pipe */
|
/* Send only EOF when at least one writer opened the pipe */
|
||||||
if ((num_writers == 0) && !waiting_for_writers)
|
if ((num_writers == 0) && !waiting_for_writers)
|
||||||
@ -255,8 +243,9 @@ struct Vfs_pipe::Pipe
|
|||||||
return Read_result::READ_QUEUED;
|
return Read_result::READ_QUEUED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (notify)
|
/* new pipe space may unblock the writer */
|
||||||
submit_write_signal();
|
if (out > 0)
|
||||||
|
vfs_user.wakeup_vfs_user();
|
||||||
|
|
||||||
return Read_result::READ_OK;
|
return Read_result::READ_OK;
|
||||||
}
|
}
|
||||||
@ -309,14 +298,15 @@ struct Vfs_pipe::New_pipe_handle : Vfs::Vfs_handle
|
|||||||
{
|
{
|
||||||
Pipe &pipe;
|
Pipe &pipe;
|
||||||
|
|
||||||
New_pipe_handle(Vfs::File_system &fs,
|
New_pipe_handle(Vfs::File_system &fs,
|
||||||
Genode::Env &env,
|
Genode::Env &env,
|
||||||
|
Vfs::Env::User &vfs_user,
|
||||||
Genode::Allocator &alloc,
|
Genode::Allocator &alloc,
|
||||||
unsigned flags,
|
unsigned flags,
|
||||||
Pipe_space &pipe_space)
|
Pipe_space &pipe_space)
|
||||||
:
|
:
|
||||||
Vfs::Vfs_handle(fs, fs, alloc, flags),
|
Vfs::Vfs_handle(fs, fs, alloc, flags),
|
||||||
pipe(*(new (alloc) Pipe(env, alloc, pipe_space)))
|
pipe(*(new (alloc) Pipe(env, vfs_user, alloc, pipe_space)))
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
~New_pipe_handle()
|
~New_pipe_handle()
|
||||||
@ -677,7 +667,7 @@ class Vfs_pipe::Pipe_file_system : public Vfs_pipe::File_system
|
|||||||
if ((OPEN_MODE_ACCMODE & mode) == OPEN_MODE_WRONLY)
|
if ((OPEN_MODE_ACCMODE & mode) == OPEN_MODE_WRONLY)
|
||||||
return OPEN_ERR_NO_PERM;
|
return OPEN_ERR_NO_PERM;
|
||||||
*handle = new (alloc)
|
*handle = new (alloc)
|
||||||
New_pipe_handle(*this, _env.env(), alloc, mode, _pipe_space);
|
New_pipe_handle(*this, _env.env(), _env.user(), alloc, mode, _pipe_space);
|
||||||
return OPEN_OK;
|
return OPEN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -823,7 +813,7 @@ class Vfs_pipe::Fifo_file_system : public Vfs_pipe::File_system
|
|||||||
Path const path { fifo.attribute_value("name", String<MAX_PATH_LEN>()) };
|
Path const path { fifo.attribute_value("name", String<MAX_PATH_LEN>()) };
|
||||||
|
|
||||||
Pipe &pipe = *new (env.alloc())
|
Pipe &pipe = *new (env.alloc())
|
||||||
Pipe(env.env(), env.alloc(), _pipe_space);
|
Pipe(env.env(), env.user(), env.alloc(), _pipe_space);
|
||||||
new (env.alloc())
|
new (env.alloc())
|
||||||
Fifo_item(_items, path, pipe.space_elem.id());
|
Fifo_item(_items, path, pipe.space_elem.id());
|
||||||
});
|
});
|
||||||
|
@ -100,7 +100,7 @@ class Libc::Main_job : public Monitor::Job
|
|||||||
* secondary stack for the application task. Context switching uses
|
* secondary stack for the application task. Context switching uses
|
||||||
* setjmp/longjmp.
|
* setjmp/longjmp.
|
||||||
*/
|
*/
|
||||||
struct Libc::Kernel final : Vfs::Io_response_handler,
|
struct Libc::Kernel final : Vfs::Read_ready_response_handler,
|
||||||
Entrypoint::Io_progress_handler,
|
Entrypoint::Io_progress_handler,
|
||||||
Reset_malloc_heap,
|
Reset_malloc_heap,
|
||||||
Resume,
|
Resume,
|
||||||
@ -681,12 +681,11 @@ struct Libc::Kernel final : Vfs::Io_response_handler,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/****************************************
|
/************************************************
|
||||||
** Vfs::Io_response_handler interface **
|
** Vfs::Read_ready_response_handler interface **
|
||||||
****************************************/
|
************************************************/
|
||||||
|
|
||||||
void read_ready_response() override { _io_progressed = true; }
|
void read_ready_response() override { _io_progressed = true; }
|
||||||
void io_progress_response() override { _io_progressed = true; }
|
|
||||||
|
|
||||||
|
|
||||||
/**********************************************
|
/**********************************************
|
||||||
|
@ -84,14 +84,14 @@ class Libc::Vfs_plugin final : public Plugin
|
|||||||
reference_handle(reference_handle) { }
|
reference_handle(reference_handle) { }
|
||||||
};
|
};
|
||||||
|
|
||||||
Genode::Allocator &_alloc;
|
Genode::Allocator &_alloc;
|
||||||
Vfs::File_system &_root_fs;
|
Vfs::File_system &_root_fs;
|
||||||
Constructible<Genode::Directory> _root_dir { };
|
Constructible<Genode::Directory> _root_dir { };
|
||||||
Vfs::Io_response_handler &_response_handler;
|
Vfs::Read_ready_response_handler &_response_handler;
|
||||||
Update_mtime const _update_mtime;
|
Update_mtime const _update_mtime;
|
||||||
Current_real_time &_current_real_time;
|
Current_real_time &_current_real_time;
|
||||||
bool const _pipe_configured;
|
bool const _pipe_configured;
|
||||||
Registry<Mmap_entry> _mmap_registry;
|
Registry<Mmap_entry> _mmap_registry;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sync a handle
|
* Sync a handle
|
||||||
@ -150,13 +150,13 @@ class Libc::Vfs_plugin final : public Plugin
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Vfs_plugin(Libc::Env &env,
|
Vfs_plugin(Libc::Env &env,
|
||||||
Vfs::Env &vfs_env,
|
Vfs::Env &vfs_env,
|
||||||
Genode::Allocator &alloc,
|
Genode::Allocator &alloc,
|
||||||
Vfs::Io_response_handler &handler,
|
Vfs::Read_ready_response_handler &handler,
|
||||||
Update_mtime update_mtime,
|
Update_mtime update_mtime,
|
||||||
Current_real_time ¤t_real_time,
|
Current_real_time ¤t_real_time,
|
||||||
Xml_node config)
|
Xml_node config)
|
||||||
:
|
:
|
||||||
_alloc(alloc),
|
_alloc(alloc),
|
||||||
_root_fs(env.vfs_env().root_dir()),
|
_root_fs(env.vfs_env().root_dir()),
|
||||||
|
@ -37,6 +37,7 @@ class Libusb_file_system : public Vfs::Single_file_system
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
Genode::Env &_env;
|
Genode::Env &_env;
|
||||||
|
Vfs::Env::User &_vfs_user;
|
||||||
Genode::Allocator_avl _alloc_avl;
|
Genode::Allocator_avl _alloc_avl;
|
||||||
Usb::Connection _usb_connection;
|
Usb::Connection _usb_connection;
|
||||||
|
|
||||||
@ -57,7 +58,7 @@ class Libusb_file_system : public Vfs::Single_file_system
|
|||||||
|
|
||||||
void _handle_ack_avail()
|
void _handle_ack_avail()
|
||||||
{
|
{
|
||||||
io_progress_response();
|
_vfs_user.wakeup_vfs_user();
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -65,13 +66,15 @@ class Libusb_file_system : public Vfs::Single_file_system
|
|||||||
Libusb_vfs_handle(Directory_service &ds,
|
Libusb_vfs_handle(Directory_service &ds,
|
||||||
File_io_service &fs,
|
File_io_service &fs,
|
||||||
Genode::Allocator &alloc,
|
Genode::Allocator &alloc,
|
||||||
Genode::Env &env)
|
Genode::Env &env,
|
||||||
: Single_vfs_handle(ds, fs, alloc, 0),
|
Vfs::Env::User &vfs_user)
|
||||||
_env(env), _alloc_avl(&alloc),
|
:
|
||||||
_usb_connection(_env, &_alloc_avl,
|
Single_vfs_handle(ds, fs, alloc, 0),
|
||||||
"usb_device",
|
_env(env), _vfs_user(vfs_user), _alloc_avl(&alloc),
|
||||||
1024*1024,
|
_usb_connection(_env, &_alloc_avl,
|
||||||
_state_changed_handler)
|
"usb_device",
|
||||||
|
1024*1024,
|
||||||
|
_state_changed_handler)
|
||||||
{
|
{
|
||||||
_usb_connection.tx_channel()->sigh_ack_avail(_ack_avail_handler);
|
_usb_connection.tx_channel()->sigh_ack_avail(_ack_avail_handler);
|
||||||
libusb_genode_usb_connection(&_usb_connection);
|
libusb_genode_usb_connection(&_usb_connection);
|
||||||
@ -127,7 +130,7 @@ class Libusb_file_system : public Vfs::Single_file_system
|
|||||||
return OPEN_ERR_UNACCESSIBLE;
|
return OPEN_ERR_UNACCESSIBLE;
|
||||||
|
|
||||||
*out_handle = new (alloc)
|
*out_handle = new (alloc)
|
||||||
Libusb_vfs_handle(*this, *this, alloc, _env.env());
|
Libusb_vfs_handle(*this, *this, alloc, _env.env(), _env.user());
|
||||||
return OPEN_OK;
|
return OPEN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -438,16 +438,6 @@ struct Lwip::Socket_dir : Lwip::Directory
|
|||||||
read_ready_queue.dequeue_all([] (Lwip_file_handle::Fifo_element &elem) {
|
read_ready_queue.dequeue_all([] (Lwip_file_handle::Fifo_element &elem) {
|
||||||
elem.object().read_ready_response(); });
|
elem.object().read_ready_response(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Notify handles blocked by operations on this PCB / socket
|
|
||||||
*/
|
|
||||||
void process_io()
|
|
||||||
{
|
|
||||||
/* invoke all handles waiting for IO progress */
|
|
||||||
io_progress_queue.dequeue_all([] (Lwip_file_handle::Fifo_element &elem) {
|
|
||||||
elem.object().io_progress_response(); });
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -551,6 +541,7 @@ class Lwip::Protocol_dir_impl final : public Protocol_dir
|
|||||||
|
|
||||||
Genode::Allocator &_alloc;
|
Genode::Allocator &_alloc;
|
||||||
Genode::Entrypoint &_ep;
|
Genode::Entrypoint &_ep;
|
||||||
|
Vfs::Env::User &_vfs_user;
|
||||||
|
|
||||||
Genode::List<SOCKET_DIR> _socket_dirs { };
|
Genode::List<SOCKET_DIR> _socket_dirs { };
|
||||||
|
|
||||||
@ -562,8 +553,8 @@ class Lwip::Protocol_dir_impl final : public Protocol_dir
|
|||||||
friend class Tcp_socket_dir;
|
friend class Tcp_socket_dir;
|
||||||
friend class Udp_socket_dir;
|
friend class Udp_socket_dir;
|
||||||
|
|
||||||
Protocol_dir_impl(Vfs::Env &vfs_env)
|
Protocol_dir_impl(Vfs::Env &env)
|
||||||
: _alloc(vfs_env.alloc()), _ep(vfs_env.env().ep()) { }
|
: _alloc(env.alloc()), _ep(env.env().ep()), _vfs_user(env.user()) { }
|
||||||
|
|
||||||
SOCKET_DIR *lookup(char const *name)
|
SOCKET_DIR *lookup(char const *name)
|
||||||
{
|
{
|
||||||
@ -684,7 +675,7 @@ class Lwip::Protocol_dir_impl final : public Protocol_dir
|
|||||||
}
|
}
|
||||||
|
|
||||||
SOCKET_DIR *new_socket = new (alloc)
|
SOCKET_DIR *new_socket = new (alloc)
|
||||||
SOCKET_DIR(id, *this, alloc, _ep, pcb);
|
SOCKET_DIR(id, *this, alloc, _ep, _vfs_user, pcb);
|
||||||
_socket_dirs.insert(new_socket);
|
_socket_dirs.insert(new_socket);
|
||||||
return *new_socket;
|
return *new_socket;
|
||||||
}
|
}
|
||||||
@ -738,11 +729,9 @@ class Lwip::Protocol_dir_impl final : public Protocol_dir
|
|||||||
return Opendir_result::OPENDIR_ERR_LOOKUP_FAILED;
|
return Opendir_result::OPENDIR_ERR_LOOKUP_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
void notify()
|
void wakeup_vfs_user()
|
||||||
{
|
{
|
||||||
for (SOCKET_DIR *sd = _socket_dirs.first(); sd; sd = sd->next()) {
|
_vfs_user.wakeup_vfs_user();
|
||||||
sd->process_io();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -762,6 +751,8 @@ class Lwip::Udp_socket_dir final :
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
Vfs::Env::User &_vfs_user;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Noncopyable
|
* Noncopyable
|
||||||
*/
|
*/
|
||||||
@ -840,9 +831,12 @@ class Lwip::Udp_socket_dir final :
|
|||||||
Udp_socket_dir(unsigned num, Udp_proto_dir &proto_dir,
|
Udp_socket_dir(unsigned num, Udp_proto_dir &proto_dir,
|
||||||
Genode::Allocator &alloc,
|
Genode::Allocator &alloc,
|
||||||
Genode::Entrypoint &,
|
Genode::Entrypoint &,
|
||||||
|
Vfs::Env::User &vfs_user,
|
||||||
udp_pcb *pcb)
|
udp_pcb *pcb)
|
||||||
: Socket_dir(num, alloc),
|
:
|
||||||
_proto_dir(proto_dir), _pcb(pcb ? pcb : udp_new())
|
Socket_dir(num, alloc),
|
||||||
|
_vfs_user(vfs_user),
|
||||||
|
_proto_dir(proto_dir), _pcb(pcb ? pcb : udp_new())
|
||||||
{
|
{
|
||||||
ip_addr_set_zero(&_to_addr);
|
ip_addr_set_zero(&_to_addr);
|
||||||
|
|
||||||
@ -875,7 +869,7 @@ class Lwip::Udp_socket_dir final :
|
|||||||
pbuf_free(buf);
|
pbuf_free(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
process_io();
|
_vfs_user.wakeup_vfs_user();
|
||||||
process_read_ready();
|
process_read_ready();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1110,6 +1104,7 @@ class Lwip::Tcp_socket_dir final :
|
|||||||
|
|
||||||
Tcp_proto_dir &_proto_dir;
|
Tcp_proto_dir &_proto_dir;
|
||||||
Genode::Entrypoint &_ep;
|
Genode::Entrypoint &_ep;
|
||||||
|
Vfs::Env::User &_vfs_user;
|
||||||
|
|
||||||
typedef Genode::List<Pcb_pending> Pcb_pending_list;
|
typedef Genode::List<Pcb_pending> Pcb_pending_list;
|
||||||
|
|
||||||
@ -1141,9 +1136,12 @@ class Lwip::Tcp_socket_dir final :
|
|||||||
Tcp_socket_dir(unsigned num, Tcp_proto_dir &proto_dir,
|
Tcp_socket_dir(unsigned num, Tcp_proto_dir &proto_dir,
|
||||||
Genode::Allocator &alloc,
|
Genode::Allocator &alloc,
|
||||||
Genode::Entrypoint &ep,
|
Genode::Entrypoint &ep,
|
||||||
|
Vfs::Env::User &vfs_user,
|
||||||
tcp_pcb *pcb)
|
tcp_pcb *pcb)
|
||||||
: Socket_dir(num, alloc), _proto_dir(proto_dir),
|
:
|
||||||
_ep(ep), _pcb(pcb ? pcb : tcp_new()), state(pcb ? READY : NEW)
|
Socket_dir(num, alloc), _proto_dir(proto_dir),
|
||||||
|
_ep(ep), _vfs_user(vfs_user),
|
||||||
|
_pcb(pcb ? pcb : tcp_new()), state(pcb ? READY : NEW)
|
||||||
{
|
{
|
||||||
/* 'this' will be the argument to LwIP callbacks */
|
/* 'this' will be the argument to LwIP callbacks */
|
||||||
tcp_arg(_pcb, this);
|
tcp_arg(_pcb, this);
|
||||||
@ -1189,7 +1187,7 @@ class Lwip::Tcp_socket_dir final :
|
|||||||
tcp_arg(newpcb, elem);
|
tcp_arg(newpcb, elem);
|
||||||
tcp_recv(newpcb, tcp_delayed_recv_callback);
|
tcp_recv(newpcb, tcp_delayed_recv_callback);
|
||||||
|
|
||||||
process_io();
|
_vfs_user.wakeup_vfs_user();
|
||||||
process_read_ready();
|
process_read_ready();
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
@ -1220,10 +1218,15 @@ class Lwip::Tcp_socket_dir final :
|
|||||||
_pcb = NULL;
|
_pcb = NULL;
|
||||||
|
|
||||||
/* churn the application */
|
/* churn the application */
|
||||||
process_io();
|
wakeup_vfs_user();
|
||||||
process_read_ready();
|
process_read_ready();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wakeup_vfs_user()
|
||||||
|
{
|
||||||
|
_vfs_user.wakeup_vfs_user();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Close the connection
|
* Close the connection
|
||||||
*
|
*
|
||||||
@ -1627,7 +1630,7 @@ err_t tcp_connect_callback(void *arg, struct tcp_pcb *pcb, err_t)
|
|||||||
Lwip::Tcp_socket_dir *socket_dir = static_cast<Lwip::Tcp_socket_dir *>(arg);
|
Lwip::Tcp_socket_dir *socket_dir = static_cast<Lwip::Tcp_socket_dir *>(arg);
|
||||||
socket_dir->state = Lwip::Tcp_socket_dir::READY;
|
socket_dir->state = Lwip::Tcp_socket_dir::READY;
|
||||||
|
|
||||||
socket_dir->process_io();
|
socket_dir->wakeup_vfs_user();
|
||||||
socket_dir->process_read_ready();
|
socket_dir->process_read_ready();
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
@ -1662,7 +1665,7 @@ err_t tcp_recv_callback(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t)
|
|||||||
socket_dir->recv(p);
|
socket_dir->recv(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
socket_dir->process_io();
|
socket_dir->wakeup_vfs_user();
|
||||||
socket_dir->process_read_ready();
|
socket_dir->process_read_ready();
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
@ -1705,7 +1708,7 @@ err_t tcp_sent_callback(void *arg, struct tcp_pcb *pcb, u16_t)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Lwip::Tcp_socket_dir *socket_dir = static_cast<Lwip::Tcp_socket_dir *>(arg);
|
Lwip::Tcp_socket_dir *socket_dir = static_cast<Lwip::Tcp_socket_dir *>(arg);
|
||||||
socket_dir->process_io();
|
socket_dir->wakeup_vfs_user();
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1765,10 +1768,10 @@ class Lwip::File_system final : public Vfs::File_system, public Lwip::Directory,
|
|||||||
*/
|
*/
|
||||||
struct Vfs_netif : Lwip::Nic_netif
|
struct Vfs_netif : Lwip::Nic_netif
|
||||||
{
|
{
|
||||||
Vfs::Env::User &_vfs_user;
|
Vfs::Env &_vfs_env;
|
||||||
|
|
||||||
Tcp_proto_dir tcp_dir;
|
Tcp_proto_dir tcp_dir { _vfs_env };
|
||||||
Udp_proto_dir udp_dir;
|
Udp_proto_dir udp_dir { _vfs_env };
|
||||||
|
|
||||||
Nameserver_registry nameserver_handles { };
|
Nameserver_registry nameserver_handles { };
|
||||||
|
|
||||||
@ -1780,8 +1783,7 @@ class Lwip::File_system final : public Vfs::File_system, public Lwip::Directory,
|
|||||||
:
|
:
|
||||||
Lwip::Nic_netif(vfs_env.env(), vfs_env.alloc(), config,
|
Lwip::Nic_netif(vfs_env.env(), vfs_env.alloc(), config,
|
||||||
wakeup_scheduler),
|
wakeup_scheduler),
|
||||||
_vfs_user(vfs_env.user()),
|
_vfs_env(vfs_env)
|
||||||
tcp_dir(vfs_env), udp_dir(vfs_env)
|
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
~Vfs_netif()
|
~Vfs_netif()
|
||||||
@ -1795,10 +1797,7 @@ class Lwip::File_system final : public Vfs::File_system, public Lwip::Directory,
|
|||||||
*/
|
*/
|
||||||
void status_callback() override
|
void status_callback() override
|
||||||
{
|
{
|
||||||
tcp_dir.notify();
|
_vfs_env.user().wakeup_vfs_user();
|
||||||
udp_dir.notify();
|
|
||||||
|
|
||||||
_vfs_user.wakeup_vfs_user();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} _netif;
|
} _netif;
|
||||||
|
@ -629,6 +629,7 @@ class Vfs::Oss_file_system::Data_file_system : public Single_file_system
|
|||||||
Data_file_system &operator = (Data_file_system const &);
|
Data_file_system &operator = (Data_file_system const &);
|
||||||
|
|
||||||
Genode::Entrypoint &_ep;
|
Genode::Entrypoint &_ep;
|
||||||
|
Vfs::Env::User &_vfs_user;
|
||||||
Audio &_audio;
|
Audio &_audio;
|
||||||
|
|
||||||
struct Oss_vfs_handle : public Single_vfs_handle
|
struct Oss_vfs_handle : public Single_vfs_handle
|
||||||
@ -705,41 +706,29 @@ class Vfs::Oss_file_system::Data_file_system : public Single_file_system
|
|||||||
|
|
||||||
void _handle_audio_out_progress()
|
void _handle_audio_out_progress()
|
||||||
{
|
{
|
||||||
if (_audio.handle_out_progress()) {
|
if (_audio.handle_out_progress())
|
||||||
/* at least one stream packet is available */
|
_vfs_user.wakeup_vfs_user();
|
||||||
_handle_registry.for_each([this] (Registered_handle &handle) {
|
|
||||||
if (handle.blocked) {
|
|
||||||
handle.blocked = false;
|
|
||||||
handle.io_progress_response();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _handle_audio_in_progress()
|
void _handle_audio_in_progress()
|
||||||
{
|
{
|
||||||
if (_audio.handle_in_progress()) {
|
if (_audio.handle_in_progress())
|
||||||
/* at least one stream packet is available */
|
_vfs_user.wakeup_vfs_user();
|
||||||
_handle_registry.for_each([this] (Registered_handle &handle) {
|
|
||||||
if (handle.blocked) {
|
|
||||||
handle.blocked = false;
|
|
||||||
handle.io_progress_response();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Data_file_system(Genode::Entrypoint &ep,
|
Data_file_system(Genode::Entrypoint &ep,
|
||||||
|
Vfs::Env::User &vfs_user,
|
||||||
Audio &audio,
|
Audio &audio,
|
||||||
Name const &name)
|
Name const &name)
|
||||||
:
|
:
|
||||||
Single_file_system { Node_type::CONTINUOUS_FILE, name.string(),
|
Single_file_system { Node_type::CONTINUOUS_FILE, name.string(),
|
||||||
Node_rwx::ro(), Genode::Xml_node("<data/>") },
|
Node_rwx::ro(), Genode::Xml_node("<data/>") },
|
||||||
|
|
||||||
_ep { ep },
|
_ep { ep },
|
||||||
_audio { audio }
|
_vfs_user { vfs_user },
|
||||||
|
_audio { audio }
|
||||||
{
|
{
|
||||||
_audio.out_progress_sigh(_audio_out_progress_sigh);
|
_audio.out_progress_sigh(_audio_out_progress_sigh);
|
||||||
_audio.in_progress_sigh(_audio_in_progress_sigh);
|
_audio.in_progress_sigh(_audio_in_progress_sigh);
|
||||||
@ -1008,7 +997,7 @@ struct Vfs::Oss_file_system::Local_factory : File_system_factory
|
|||||||
_label { config.attribute_value("label", Label("")) },
|
_label { config.attribute_value("label", Label("")) },
|
||||||
_name { name(config) },
|
_name { name(config) },
|
||||||
_env { env },
|
_env { env },
|
||||||
_data_fs { _env.env().ep(), _audio, name(config) }
|
_data_fs { _env.env().ep(), env.user(), _audio, name(config) }
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
Vfs::File_system *create(Vfs::Env&, Xml_node node) override
|
Vfs::File_system *create(Vfs::Env&, Xml_node node) override
|
||||||
|
@ -314,7 +314,7 @@ class Vfs::Dir_file_system : public File_system
|
|||||||
vfs_handle.seek(index * sizeof(Dirent));
|
vfs_handle.seek(index * sizeof(Dirent));
|
||||||
|
|
||||||
/* forward the response handler */
|
/* forward the response handler */
|
||||||
dir_vfs_handle->apply_handler([&] (Vfs::Io_response_handler &h) {
|
dir_vfs_handle->apply_handler([&] (Vfs::Read_ready_response_handler &h) {
|
||||||
vfs_handle.handler(&h); });
|
vfs_handle.handler(&h); });
|
||||||
|
|
||||||
result = vfs_handle.fs().queue_read(&vfs_handle, sizeof(Dirent));
|
result = vfs_handle.fs().queue_read(&vfs_handle, sizeof(Dirent));
|
||||||
@ -998,7 +998,7 @@ class Vfs::Dir_file_system : public File_system
|
|||||||
|
|
||||||
auto f = [&result, dir_vfs_handle] (Dir_vfs_handle::Subdir_handle_element &e) {
|
auto f = [&result, dir_vfs_handle] (Dir_vfs_handle::Subdir_handle_element &e) {
|
||||||
/* forward the response handler */
|
/* forward the response handler */
|
||||||
dir_vfs_handle->apply_handler([&] (Io_response_handler &h) {
|
dir_vfs_handle->apply_handler([&] (Read_ready_response_handler &h) {
|
||||||
e.vfs_handle.handler(&h); });
|
e.vfs_handle.handler(&h); });
|
||||||
e.synced = false;
|
e.synced = false;
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include <vfs/directory_service.h>
|
#include <vfs/directory_service.h>
|
||||||
|
|
||||||
namespace Vfs{
|
namespace Vfs{
|
||||||
struct Io_response_handler;
|
struct Read_ready_response_handler;
|
||||||
struct Watch_response_handler;
|
struct Watch_response_handler;
|
||||||
class Vfs_handle;
|
class Vfs_handle;
|
||||||
class Vfs_watch_handle;
|
class Vfs_watch_handle;
|
||||||
@ -33,17 +33,12 @@ namespace Vfs{
|
|||||||
* These responses should be assumed to be called
|
* These responses should be assumed to be called
|
||||||
* during I/O signal dispatch.
|
* during I/O signal dispatch.
|
||||||
*/
|
*/
|
||||||
struct Vfs::Io_response_handler : Genode::Interface
|
struct Vfs::Read_ready_response_handler : Genode::Interface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Respond to a resource becoming readable
|
* Respond to a resource becoming readable
|
||||||
*/
|
*/
|
||||||
virtual void read_ready_response() = 0;
|
virtual void read_ready_response() = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
* Respond to complete pending I/O
|
|
||||||
*/
|
|
||||||
virtual void io_progress_response() = 0;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -64,12 +59,13 @@ class Vfs::Vfs_handle
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Directory_service &_ds;
|
Directory_service &_ds;
|
||||||
File_io_service &_fs;
|
File_io_service &_fs;
|
||||||
Genode::Allocator &_alloc;
|
Genode::Allocator &_alloc;
|
||||||
Io_response_handler *_handler = nullptr;
|
file_size _seek = 0;
|
||||||
file_size _seek = 0;
|
int _status_flags;
|
||||||
int _status_flags;
|
|
||||||
|
Read_ready_response_handler *_handler_ptr = nullptr;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Noncopyable
|
* Noncopyable
|
||||||
@ -143,9 +139,9 @@ class Vfs::Vfs_handle
|
|||||||
/**
|
/**
|
||||||
* Set response handler, unset with nullptr
|
* Set response handler, unset with nullptr
|
||||||
*/
|
*/
|
||||||
virtual void handler(Io_response_handler *handler)
|
virtual void handler(Read_ready_response_handler *handler_ptr)
|
||||||
{
|
{
|
||||||
_handler = handler;
|
_handler_ptr = handler_ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -155,19 +151,13 @@ class Vfs::Vfs_handle
|
|||||||
*/
|
*/
|
||||||
template <typename FUNC>
|
template <typename FUNC>
|
||||||
void apply_handler(FUNC const &func) const {
|
void apply_handler(FUNC const &func) const {
|
||||||
if (_handler) func(*_handler); }
|
if (_handler_ptr) func(*_handler_ptr); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notify application through response handler
|
* Notify application through response handler
|
||||||
*/
|
*/
|
||||||
void read_ready_response() {
|
void read_ready_response() {
|
||||||
if (_handler) _handler->read_ready_response(); }
|
if (_handler_ptr) _handler_ptr->read_ready_response(); }
|
||||||
|
|
||||||
/**
|
|
||||||
* Notify application through response handler
|
|
||||||
*/
|
|
||||||
void io_progress_response() {
|
|
||||||
if (_handler) _handler->io_progress_response(); }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Close handle at backing file-system.
|
* Close handle at backing file-system.
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
namespace Vfs {
|
namespace Vfs {
|
||||||
|
|
||||||
using Vfs::Io_response_handler;
|
using Vfs::Read_ready_response_handler;
|
||||||
|
|
||||||
template <typename> struct Builtin_entry;
|
template <typename> struct Builtin_entry;
|
||||||
struct External_entry;
|
struct External_entry;
|
||||||
|
@ -136,12 +136,10 @@ class Vfs::Fs_file_system : public File_system, private Remote_io
|
|||||||
struct Fs_vfs_handle : Vfs_handle,
|
struct Fs_vfs_handle : Vfs_handle,
|
||||||
private ::File_system::Node,
|
private ::File_system::Node,
|
||||||
private Handle_space::Element,
|
private Handle_space::Element,
|
||||||
private Fs_vfs_handle_queue::Element,
|
|
||||||
private Handle_state
|
private Handle_state
|
||||||
{
|
{
|
||||||
friend Genode::Id_space<::File_system::Node>;
|
friend Genode::Id_space<::File_system::Node>;
|
||||||
friend Fs_vfs_handle_queue;
|
friend Fs_vfs_handle_queue;
|
||||||
using Fs_vfs_handle_queue::Element::enqueued;
|
|
||||||
|
|
||||||
using Handle_state::queued_read_state;
|
using Handle_state::queued_read_state;
|
||||||
using Handle_state::queued_read_packet;
|
using Handle_state::queued_read_packet;
|
||||||
@ -450,18 +448,11 @@ class Vfs::Fs_file_system : public File_system, private Remote_io
|
|||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
Fs_vfs_handle_queue _congested_handles { };
|
|
||||||
|
|
||||||
Write_result _write(Fs_vfs_handle &handle, file_size const seek_offset,
|
Write_result _write(Fs_vfs_handle &handle, file_size const seek_offset,
|
||||||
const char *buf, file_size count, file_size &out_count)
|
const char *buf, file_size count, file_size &out_count)
|
||||||
{
|
{
|
||||||
/*
|
/* reclaim as much space in the packet stream as possible */
|
||||||
* TODO
|
_handle_ack();
|
||||||
* a sustained write loop will congest the packet buffer,
|
|
||||||
* perhaps acks should be processed before submission?
|
|
||||||
*
|
|
||||||
* _handle_ack();
|
|
||||||
*/
|
|
||||||
|
|
||||||
::File_system::Session::Tx::Source &source = *_fs.tx();
|
::File_system::Session::Tx::Source &source = *_fs.tx();
|
||||||
using ::File_system::Packet_descriptor;
|
using ::File_system::Packet_descriptor;
|
||||||
@ -470,9 +461,6 @@ class Vfs::Fs_file_system : public File_system, private Remote_io
|
|||||||
count = min(max_packet_size, count);
|
count = min(max_packet_size, count);
|
||||||
|
|
||||||
if (!source.ready_to_submit()) {
|
if (!source.ready_to_submit()) {
|
||||||
if (!handle.enqueued())
|
|
||||||
_congested_handles.enqueue(handle);
|
|
||||||
|
|
||||||
_write_would_block = true;
|
_write_would_block = true;
|
||||||
return Write_result::WRITE_ERR_WOULD_BLOCK;
|
return Write_result::WRITE_ERR_WOULD_BLOCK;
|
||||||
}
|
}
|
||||||
@ -489,9 +477,6 @@ class Vfs::Fs_file_system : public File_system, private Remote_io
|
|||||||
_submit_packet(packet_in);
|
_submit_packet(packet_in);
|
||||||
}
|
}
|
||||||
catch (::File_system::Session::Tx::Source::Packet_alloc_failed) {
|
catch (::File_system::Session::Tx::Source::Packet_alloc_failed) {
|
||||||
if (!handle.enqueued())
|
|
||||||
_congested_handles.enqueue(handle);
|
|
||||||
|
|
||||||
_write_would_block = true;
|
_write_would_block = true;
|
||||||
return Write_result::WRITE_ERR_WOULD_BLOCK;
|
return Write_result::WRITE_ERR_WOULD_BLOCK;
|
||||||
}
|
}
|
||||||
@ -508,6 +493,8 @@ class Vfs::Fs_file_system : public File_system, private Remote_io
|
|||||||
::File_system::Session::Tx::Source &source = *_fs.tx();
|
::File_system::Session::Tx::Source &source = *_fs.tx();
|
||||||
using ::File_system::Packet_descriptor;
|
using ::File_system::Packet_descriptor;
|
||||||
|
|
||||||
|
bool any_ack_handled = false;
|
||||||
|
|
||||||
while (source.ack_avail()) {
|
while (source.ack_avail()) {
|
||||||
|
|
||||||
Packet_descriptor const packet = source.try_get_acked_packet();
|
Packet_descriptor const packet = source.try_get_acked_packet();
|
||||||
@ -516,8 +503,8 @@ class Vfs::Fs_file_system : public File_system, private Remote_io
|
|||||||
|
|
||||||
Handle_space::Id const id(packet.handle());
|
Handle_space::Id const id(packet.handle());
|
||||||
|
|
||||||
auto handle_read = [&] (Fs_vfs_handle &handle) {
|
auto handle_fn = [&] (Fs_vfs_handle &handle)
|
||||||
|
{
|
||||||
if (!packet.succeeded())
|
if (!packet.succeeded())
|
||||||
Genode::error("packet operation=", (int)packet.operation(), " failed");
|
Genode::error("packet operation=", (int)packet.operation(), " failed");
|
||||||
|
|
||||||
@ -530,29 +517,22 @@ class Vfs::Fs_file_system : public File_system, private Remote_io
|
|||||||
case Packet_descriptor::READ:
|
case Packet_descriptor::READ:
|
||||||
handle.queued_read_packet = packet;
|
handle.queued_read_packet = packet;
|
||||||
handle.queued_read_state = Handle_state::Queued_state::ACK;
|
handle.queued_read_state = Handle_state::Queued_state::ACK;
|
||||||
handle.io_progress_response();
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Packet_descriptor::WRITE:
|
case Packet_descriptor::WRITE:
|
||||||
/*
|
source.release_packet(packet);
|
||||||
* Notify anyone who might have failed on
|
|
||||||
* 'alloc_packet()'
|
|
||||||
*/
|
|
||||||
handle.io_progress_response();
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Packet_descriptor::SYNC:
|
case Packet_descriptor::SYNC:
|
||||||
handle.queued_sync_packet = packet;
|
handle.queued_sync_packet = packet;
|
||||||
handle.queued_sync_state = Handle_state::Queued_state::ACK;
|
handle.queued_sync_state = Handle_state::Queued_state::ACK;
|
||||||
handle.io_progress_response();
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Packet_descriptor::CONTENT_CHANGED:
|
case Packet_descriptor::CONTENT_CHANGED:
|
||||||
/* previously handled */
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Packet_descriptor::WRITE_TIMESTAMP:
|
case Packet_descriptor::WRITE_TIMESTAMP:
|
||||||
/* previously handled */
|
source.release_packet(packet);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -562,34 +542,22 @@ class Vfs::Fs_file_system : public File_system, private Remote_io
|
|||||||
_watch_handle_space.apply<Fs_vfs_watch_handle>(id, [&] (Fs_vfs_watch_handle &handle) {
|
_watch_handle_space.apply<Fs_vfs_watch_handle>(id, [&] (Fs_vfs_watch_handle &handle) {
|
||||||
handle.watch_response(); });
|
handle.watch_response(); });
|
||||||
} else {
|
} else {
|
||||||
_handle_space.apply<Fs_vfs_handle>(id, handle_read);
|
_handle_space.apply<Fs_vfs_handle>(id, handle_fn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Handle_space::Unknown_id) {
|
catch (Handle_space::Unknown_id) {
|
||||||
Genode::warning("ack for unknown File_system handle ", id); }
|
Genode::warning("ack for unknown File_system handle ", id); }
|
||||||
|
|
||||||
if (packet.operation() == Packet_descriptor::WRITE) {
|
if (packet.succeeded())
|
||||||
source.release_packet(packet);
|
any_ack_handled = true;
|
||||||
}
|
|
||||||
|
|
||||||
if (packet.operation() == Packet_descriptor::WRITE_TIMESTAMP) {
|
|
||||||
source.release_packet(packet);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void _handle_signal()
|
if (any_ack_handled)
|
||||||
{
|
_env.user().wakeup_vfs_user();
|
||||||
_handle_ack();
|
|
||||||
|
|
||||||
_congested_handles.dequeue_all([] (Fs_vfs_handle &handle) {
|
|
||||||
handle.io_progress_response(); });
|
|
||||||
|
|
||||||
_env.user().wakeup_vfs_user();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Genode::Io_signal_handler<Fs_file_system> _signal_handler {
|
Genode::Io_signal_handler<Fs_file_system> _signal_handler {
|
||||||
_env.env().ep(), *this, &Fs_file_system::_handle_signal };
|
_env.env().ep(), *this, &Fs_file_system::_handle_ack };
|
||||||
|
|
||||||
static size_t buffer_size(Genode::Xml_node const &config)
|
static size_t buffer_size(Genode::Xml_node const &config)
|
||||||
{
|
{
|
||||||
@ -867,8 +835,6 @@ class Vfs::Fs_file_system : public File_system, private Remote_io
|
|||||||
void close(Vfs_handle *vfs_handle) override
|
void close(Vfs_handle *vfs_handle) override
|
||||||
{
|
{
|
||||||
Fs_vfs_handle *fs_handle = static_cast<Fs_vfs_handle *>(vfs_handle);
|
Fs_vfs_handle *fs_handle = static_cast<Fs_vfs_handle *>(vfs_handle);
|
||||||
if (fs_handle->enqueued())
|
|
||||||
_congested_handles.remove(*fs_handle);
|
|
||||||
|
|
||||||
_fs.close(fs_handle->file_handle());
|
_fs.close(fs_handle->file_handle());
|
||||||
destroy(fs_handle->alloc(), fs_handle);
|
destroy(fs_handle->alloc(), fs_handle);
|
||||||
@ -935,10 +901,7 @@ class Vfs::Fs_file_system : public File_system, private Remote_io
|
|||||||
{
|
{
|
||||||
Fs_vfs_handle *handle = static_cast<Fs_vfs_handle *>(vfs_handle);
|
Fs_vfs_handle *handle = static_cast<Fs_vfs_handle *>(vfs_handle);
|
||||||
|
|
||||||
bool result = handle->queue_read(count);
|
return handle->queue_read(count);
|
||||||
if (!result && !handle->enqueued())
|
|
||||||
_congested_handles.enqueue(*handle);
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Read_result complete_read(Vfs_handle *vfs_handle, char *dst, file_size count,
|
Read_result complete_read(Vfs_handle *vfs_handle, char *dst, file_size count,
|
||||||
@ -948,10 +911,7 @@ class Vfs::Fs_file_system : public File_system, private Remote_io
|
|||||||
|
|
||||||
Fs_vfs_handle *handle = static_cast<Fs_vfs_handle *>(vfs_handle);
|
Fs_vfs_handle *handle = static_cast<Fs_vfs_handle *>(vfs_handle);
|
||||||
|
|
||||||
Read_result result = handle->complete_read(dst, count, out_count);
|
return handle->complete_read(dst, count, out_count);
|
||||||
if (result == READ_QUEUED && !handle->enqueued())
|
|
||||||
_congested_handles.enqueue(*handle);
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool read_ready(Vfs_handle const &vfs_handle) const override
|
bool read_ready(Vfs_handle const &vfs_handle) const override
|
||||||
|
@ -82,7 +82,7 @@ class Vfs::Nic_file_system::Nic_vfs_handle : public Single_vfs_handle
|
|||||||
|
|
||||||
if (_blocked) {
|
if (_blocked) {
|
||||||
_blocked = false;
|
_blocked = false;
|
||||||
io_progress_response();
|
_vfs_user.wakeup_vfs_user();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_notifying) {
|
if (_notifying) {
|
||||||
|
@ -59,7 +59,7 @@ class Vfs::Uplink_file_system::Uplink_vfs_handle : public Single_vfs_handle,
|
|||||||
|
|
||||||
if (_blocked) {
|
if (_blocked) {
|
||||||
_blocked = false;
|
_blocked = false;
|
||||||
io_progress_response();
|
_vfs_user.wakeup_vfs_user();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_notifying) {
|
if (_notifying) {
|
||||||
|
@ -119,7 +119,6 @@ class Vfs::Terminal_file_system::Data_file_system : public Single_file_system
|
|||||||
bool const _raw;
|
bool const _raw;
|
||||||
|
|
||||||
bool notifying = false;
|
bool notifying = false;
|
||||||
bool blocked = false;
|
|
||||||
|
|
||||||
Terminal_vfs_handle(Terminal::Connection &terminal,
|
Terminal_vfs_handle(Terminal::Connection &terminal,
|
||||||
Vfs::Env::User &vfs_user,
|
Vfs::Env::User &vfs_user,
|
||||||
@ -157,10 +156,8 @@ class Vfs::Terminal_file_system::Data_file_system : public Single_file_system
|
|||||||
_fetch_data_from_terminal(_terminal, _read_buffer,
|
_fetch_data_from_terminal(_terminal, _read_buffer,
|
||||||
_interrupt_handler, _raw);
|
_interrupt_handler, _raw);
|
||||||
|
|
||||||
if (_read_buffer.empty()) {
|
if (_read_buffer.empty())
|
||||||
blocked = true;
|
|
||||||
return READ_QUEUED;
|
return READ_QUEUED;
|
||||||
}
|
|
||||||
|
|
||||||
unsigned consumed = 0;
|
unsigned consumed = 0;
|
||||||
for (; consumed < count && !_read_buffer.empty(); consumed++)
|
for (; consumed < count && !_read_buffer.empty(); consumed++)
|
||||||
@ -206,11 +203,6 @@ class Vfs::Terminal_file_system::Data_file_system : public Single_file_system
|
|||||||
_raw);
|
_raw);
|
||||||
|
|
||||||
_handle_registry.for_each([] (Registered_handle &handle) {
|
_handle_registry.for_each([] (Registered_handle &handle) {
|
||||||
if (handle.blocked) {
|
|
||||||
handle.blocked = false;
|
|
||||||
handle.io_progress_response();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (handle.notifying) {
|
if (handle.notifying) {
|
||||||
handle.notifying = false;
|
handle.notifying = false;
|
||||||
handle.read_ready_response();
|
handle.read_ready_response();
|
||||||
|
@ -228,7 +228,7 @@ class Vfs_server::Node : Node_space::Element, Node_queue::Element
|
|||||||
* Super-class for nodes that process read/write packets
|
* Super-class for nodes that process read/write packets
|
||||||
*/
|
*/
|
||||||
class Vfs_server::Io_node : public Vfs_server::Node,
|
class Vfs_server::Io_node : public Vfs_server::Node,
|
||||||
public Vfs::Io_response_handler
|
public Vfs::Read_ready_response_handler
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@ -498,11 +498,6 @@ class Vfs_server::Io_node : public Vfs_server::Node,
|
|||||||
if (_read_ready_state == Read_ready_state::REQUESTED)
|
if (_read_ready_state == Read_ready_state::REQUESTED)
|
||||||
_read_ready_state = Read_ready_state::READY;
|
_read_ready_state = Read_ready_state::READY;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Called by the VFS plugin of this handle
|
|
||||||
*/
|
|
||||||
void io_progress_response() override { }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -78,29 +78,13 @@ class Vfs_block::File
|
|||||||
|
|
||||||
Constructible<Vfs_block::Job> _job { };
|
Constructible<Vfs_block::Job> _job { };
|
||||||
|
|
||||||
struct Io_response_handler : Vfs::Io_response_handler
|
|
||||||
{
|
|
||||||
Signal_context_capability sigh { };
|
|
||||||
|
|
||||||
void read_ready_response() override { }
|
|
||||||
|
|
||||||
void io_progress_response() override
|
|
||||||
{
|
|
||||||
if (sigh.valid()) {
|
|
||||||
Signal_transmitter(sigh).submit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
Io_response_handler _io_response_handler { };
|
|
||||||
|
|
||||||
Block::Session::Info _block_info { };
|
Block::Session::Info _block_info { };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
File(Genode::Allocator &alloc,
|
File(Genode::Allocator &alloc,
|
||||||
Vfs::File_system &vfs,
|
Vfs::File_system &vfs,
|
||||||
Signal_context_capability sigh,
|
File_info const &info)
|
||||||
File_info const &info)
|
|
||||||
:
|
:
|
||||||
_vfs { vfs },
|
_vfs { vfs },
|
||||||
_vfs_handle { nullptr }
|
_vfs_handle { nullptr }
|
||||||
@ -137,9 +121,6 @@ class Vfs_block::File
|
|||||||
.align_log2 = log2(info.block_size),
|
.align_log2 = log2(info.block_size),
|
||||||
.writeable = info.writeable,
|
.writeable = info.writeable,
|
||||||
};
|
};
|
||||||
|
|
||||||
_io_response_handler.sigh = sigh;
|
|
||||||
_vfs_handle->handler(&_io_response_handler);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~File()
|
~File()
|
||||||
@ -313,7 +294,8 @@ struct Block_session_component : Rpc_object<Block::Session>,
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct Main : Rpc_object<Typed_root<Block::Session>>
|
struct Main : Rpc_object<Typed_root<Block::Session>>,
|
||||||
|
private Vfs::Env::User
|
||||||
{
|
{
|
||||||
Env &_env;
|
Env &_env;
|
||||||
|
|
||||||
@ -324,7 +306,7 @@ struct Main : Rpc_object<Typed_root<Block::Session>>
|
|||||||
Attached_rom_dataspace _config_rom { _env, "config" };
|
Attached_rom_dataspace _config_rom { _env, "config" };
|
||||||
|
|
||||||
Vfs::Simple_env _vfs_env { _env, _heap,
|
Vfs::Simple_env _vfs_env { _env, _heap,
|
||||||
_config_rom.xml().sub_node("vfs") };
|
_config_rom.xml().sub_node("vfs"), *this };
|
||||||
|
|
||||||
Constructible<Attached_ram_dataspace> _block_ds { };
|
Constructible<Attached_ram_dataspace> _block_ds { };
|
||||||
Constructible<Vfs_block::File> _block_file { };
|
Constructible<Vfs_block::File> _block_file { };
|
||||||
@ -339,6 +321,13 @@ struct Main : Rpc_object<Typed_root<Block::Session>>
|
|||||||
_block_session->handle_request();
|
_block_session->handle_request();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Vfs::Env::User interface
|
||||||
|
*/
|
||||||
|
void wakeup_vfs_user() override
|
||||||
|
{
|
||||||
|
_request_handler.local_submit();
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Root interface
|
* Root interface
|
||||||
@ -378,8 +367,7 @@ struct Main : Rpc_object<Typed_root<Block::Session>>
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
_block_ds.construct(_env.ram(), _env.rm(), tx_buf_size);
|
_block_ds.construct(_env.ram(), _env.rm(), tx_buf_size);
|
||||||
_block_file.construct(_heap, _vfs_env.root_dir(),
|
_block_file.construct(_heap, _vfs_env.root_dir(), file_info);
|
||||||
_request_handler, file_info);
|
|
||||||
_block_session.construct(_env.rm(), _env.ep(),
|
_block_session.construct(_env.rm(), _env.ep(),
|
||||||
_block_ds->cap(),
|
_block_ds->cap(),
|
||||||
_request_handler, *_block_file,
|
_request_handler, *_block_file,
|
||||||
|
Reference in New Issue
Block a user