mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-31 00:24:51 +00:00
os: avoid ambiguous warnings for vfs/server
between File_system and Vfs::File_system Issue #3022
This commit is contained in:
parent
9bb0e10eec
commit
5572430ba5
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
namespace File_system {
|
namespace File_system {
|
||||||
|
|
||||||
typedef File_system::Session_rpc_object::Tx::Sink Sink;
|
typedef ::File_system::Session_rpc_object::Tx::Sink Sink;
|
||||||
|
|
||||||
class Listener : public Genode::List<Listener>::Element
|
class Listener : public Genode::List<Listener>::Element
|
||||||
{
|
{
|
||||||
|
@ -54,7 +54,7 @@ namespace Vfs_server {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class Vfs_server::Session_component : public File_system::Session_rpc_object,
|
class Vfs_server::Session_component : public ::File_system::Session_rpc_object,
|
||||||
public Session_io_handler
|
public Session_io_handler
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
@ -488,7 +488,7 @@ class Vfs_server::Session_component : public File_system::Session_rpc_object,
|
|||||||
** File_system interface **
|
** File_system interface **
|
||||||
***************************/
|
***************************/
|
||||||
|
|
||||||
Dir_handle dir(File_system::Path const &path, bool create) override
|
Dir_handle dir(::File_system::Path const &path, bool create) override
|
||||||
{
|
{
|
||||||
if (create && (!_writable))
|
if (create && (!_writable))
|
||||||
throw Permission_denied();
|
throw Permission_denied();
|
||||||
@ -546,7 +546,7 @@ class Vfs_server::Session_component : public File_system::Session_rpc_object,
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Node_handle node(File_system::Path const &path) override
|
Node_handle node(::File_system::Path const &path) override
|
||||||
{
|
{
|
||||||
char const *path_str = path.string();
|
char const *path_str = path.string();
|
||||||
|
|
||||||
@ -566,7 +566,7 @@ class Vfs_server::Session_component : public File_system::Session_rpc_object,
|
|||||||
return Node_handle { node->id().value };
|
return Node_handle { node->id().value };
|
||||||
}
|
}
|
||||||
|
|
||||||
Watch_handle watch(File_system::Path const &path) override
|
Watch_handle watch(::File_system::Path const &path) override
|
||||||
{
|
{
|
||||||
char const *path_str = path.string();
|
char const *path_str = path.string();
|
||||||
|
|
||||||
@ -602,12 +602,12 @@ class Vfs_server::Session_component : public File_system::Session_rpc_object,
|
|||||||
{
|
{
|
||||||
try { _apply_node(handle, [&] (Node &node) {
|
try { _apply_node(handle, [&] (Node &node) {
|
||||||
_close(node);
|
_close(node);
|
||||||
}); } catch (File_system::Invalid_handle) { }
|
}); } catch (::File_system::Invalid_handle) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
Status status(Node_handle node_handle) override
|
Status status(Node_handle node_handle) override
|
||||||
{
|
{
|
||||||
File_system::Status fs_stat;
|
::File_system::Status fs_stat;
|
||||||
|
|
||||||
_apply_node(node_handle, [&] (Node &node) {
|
_apply_node(node_handle, [&] (Node &node) {
|
||||||
Directory_service::Stat vfs_stat;
|
Directory_service::Stat vfs_stat;
|
||||||
@ -620,19 +620,19 @@ class Vfs_server::Session_component : public File_system::Session_rpc_object,
|
|||||||
switch (vfs_stat.mode & (
|
switch (vfs_stat.mode & (
|
||||||
Directory_service::STAT_MODE_DIRECTORY |
|
Directory_service::STAT_MODE_DIRECTORY |
|
||||||
Directory_service::STAT_MODE_SYMLINK |
|
Directory_service::STAT_MODE_SYMLINK |
|
||||||
File_system::Status::MODE_FILE)) {
|
::File_system::Status::MODE_FILE)) {
|
||||||
|
|
||||||
case Directory_service::STAT_MODE_DIRECTORY:
|
case Directory_service::STAT_MODE_DIRECTORY:
|
||||||
fs_stat.mode = File_system::Status::MODE_DIRECTORY;
|
fs_stat.mode = ::File_system::Status::MODE_DIRECTORY;
|
||||||
fs_stat.size = _vfs.num_dirent(node.path()) * sizeof(Directory_entry);
|
fs_stat.size = _vfs.num_dirent(node.path()) * sizeof(Directory_entry);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case Directory_service::STAT_MODE_SYMLINK:
|
case Directory_service::STAT_MODE_SYMLINK:
|
||||||
fs_stat.mode = File_system::Status::MODE_SYMLINK;
|
fs_stat.mode = ::File_system::Status::MODE_SYMLINK;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: /* Directory_service::STAT_MODE_FILE */
|
default: /* Directory_service::STAT_MODE_FILE */
|
||||||
fs_stat.mode = File_system::Status::MODE_FILE;
|
fs_stat.mode = ::File_system::Status::MODE_FILE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ namespace Vfs_server {
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
class Vfs_server::Node : public File_system::Node_base,
|
class Vfs_server::Node : public ::File_system::Node_base,
|
||||||
private Node_space::Element
|
private Node_space::Element
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -554,7 +554,7 @@ struct Vfs_server::Directory : Io_node
|
|||||||
size_t read(char *dst, size_t len, seek_off_t seek_offset) override
|
size_t read(char *dst, size_t len, seek_off_t seek_offset) override
|
||||||
{
|
{
|
||||||
Directory_service::Dirent vfs_dirent;
|
Directory_service::Dirent vfs_dirent;
|
||||||
size_t blocksize = sizeof(File_system::Directory_entry);
|
size_t blocksize = sizeof(::File_system::Directory_entry);
|
||||||
|
|
||||||
unsigned index = (seek_offset / blocksize);
|
unsigned index = (seek_offset / blocksize);
|
||||||
|
|
||||||
@ -567,18 +567,18 @@ struct Vfs_server::Directory : Io_node
|
|||||||
(vfs_dirent.type == Vfs::Directory_service::DIRENT_TYPE_END))
|
(vfs_dirent.type == Vfs::Directory_service::DIRENT_TYPE_END))
|
||||||
return len - remains;
|
return len - remains;
|
||||||
|
|
||||||
File_system::Directory_entry *fs_dirent = (Directory_entry *)dst;
|
::File_system::Directory_entry *fs_dirent = (Directory_entry *)dst;
|
||||||
fs_dirent->inode = vfs_dirent.fileno;
|
fs_dirent->inode = vfs_dirent.fileno;
|
||||||
switch (vfs_dirent.type) {
|
switch (vfs_dirent.type) {
|
||||||
case Vfs::Directory_service::DIRENT_TYPE_DIRECTORY:
|
case Vfs::Directory_service::DIRENT_TYPE_DIRECTORY:
|
||||||
fs_dirent->type = File_system::Directory_entry::TYPE_DIRECTORY;
|
fs_dirent->type = ::File_system::Directory_entry::TYPE_DIRECTORY;
|
||||||
break;
|
break;
|
||||||
case Vfs::Directory_service::DIRENT_TYPE_SYMLINK:
|
case Vfs::Directory_service::DIRENT_TYPE_SYMLINK:
|
||||||
fs_dirent->type = File_system::Directory_entry::TYPE_SYMLINK;
|
fs_dirent->type = ::File_system::Directory_entry::TYPE_SYMLINK;
|
||||||
break;
|
break;
|
||||||
case Vfs::Directory_service::DIRENT_TYPE_FILE:
|
case Vfs::Directory_service::DIRENT_TYPE_FILE:
|
||||||
default:
|
default:
|
||||||
fs_dirent->type = File_system::Directory_entry::TYPE_FILE;
|
fs_dirent->type = ::File_system::Directory_entry::TYPE_FILE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
strncpy(fs_dirent->name, vfs_dirent.name, MAX_NAME_LEN);
|
strncpy(fs_dirent->name, vfs_dirent.name, MAX_NAME_LEN);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user