1
0
mirror of https://github.com/falk-werner/webfuse synced 2024-10-27 20:34:10 +00:00

readdir: removed parameter "handle"

This commit is contained in:
Falk Werner 2023-01-01 18:49:59 +01:00
parent 815a03545f
commit eb5419ecf4
10 changed files with 12 additions and 12 deletions

View File

@ -135,7 +135,7 @@ public:
return -ENOENT;
}
int readdir(std::string const & path, std::vector<std::string> & entries, uint64_t handle) override
int readdir(std::string const & path, std::vector<std::string> & entries) override
{
auto const full_path = get_full_path(path);
std::cout << "readdir: " << full_path << std::endl;

View File

@ -364,7 +364,7 @@ int filesystem::mkdir(std::string const & path, mode_t mode)
}
}
int filesystem::readdir(std::string const & path, std::vector<std::string> & entries, uint64_t handle)
int filesystem::readdir(std::string const & path, std::vector<std::string> & entries)
{
try
{
@ -380,7 +380,7 @@ int filesystem::readdir(std::string const & path, std::vector<std::string> & ent
}
catch(...)
{
return fallback.readdir(path, entries, handle);
return fallback.readdir(path, entries);
}
}

View File

@ -42,7 +42,7 @@ public:
int write(std::string const & path, char const * buffer, size_t buffer_size, uint64_t offset, uint64_t handle) override;
int mkdir(std::string const & path, mode_t mode) override;
int readdir(std::string const & path, std::vector<std::string> & entries, uint64_t handle) override;
int readdir(std::string const & path, std::vector<std::string> & entries) override;
int rmdir(std::string const & path) override;
int statfs(std::string const & path, struct statvfs * statistics) override;

View File

@ -115,7 +115,7 @@ int empty_filesystem::mkdir(std::string const & path, mode_t mode)
return -EPERM;
}
int empty_filesystem::readdir(std::string const & path, std::vector<std::string> & entries, uint64_t handle)
int empty_filesystem::readdir(std::string const & path, std::vector<std::string> & entries)
{
if (path == "/")
{

View File

@ -35,7 +35,7 @@ public:
int write(std::string const & path, char const * buffer, size_t buffer_size, uint64_t offset, uint64_t handle) override;
int mkdir(std::string const & path, mode_t mode) override;
int readdir(std::string const & path, std::vector<std::string> & entries, uint64_t handle) override;
int readdir(std::string const & path, std::vector<std::string> & entries) override;
int rmdir(std::string const & path) override;
int statfs(std::string const & path, struct statvfs * statistivs) override;

View File

@ -42,7 +42,7 @@ public:
virtual int write(std::string const & path, char const * buffer, size_t buffer_size, uint64_t offset, uint64_t handle) = 0;
virtual int mkdir(std::string const & path, mode_t mode) = 0;
virtual int readdir(std::string const & path, std::vector<std::string> & entries, uint64_t handle) = 0;
virtual int readdir(std::string const & path, std::vector<std::string> & entries) = 0;
virtual int rmdir(std::string const & path) = 0;
virtual int statfs(std::string const & path, struct statvfs * statistics) = 0;

View File

@ -184,7 +184,7 @@ static int fs_readdir(char const * path, void * buffer,
auto * const fs = fs_get_filesystem();
auto handle = fs_get_handle(info);
std::vector<std::string> names;
auto const result = fs->readdir(path, names, handle);
auto const result = fs->readdir(path, names);
if (0 == result)
{
filler(buffer, ".", nullptr, 0, static_cast<fuse_fill_dir_flags>(0));

View File

@ -139,7 +139,7 @@ private:
auto const path = reader.read_str();
std::vector<std::string> entries;
auto const result = fs_.readdir(path, entries, static_cast<uint64_t>(-1));
auto const result = fs_.readdir(path, entries);
writer.write_i32(result);
if (0 == result)
{

View File

@ -33,7 +33,7 @@ TEST(readdir, existing_dir)
return -ENOENT;
}
}));
EXPECT_CALL(fs, readdir("/some_dir",_,_)).WillOnce(Invoke([](auto const & path, auto & entries, auto handle) {
EXPECT_CALL(fs, readdir("/some_dir",_)).WillOnce(Invoke([](auto const & path, auto & entries) {
entries.push_back("foo");
return 0;
}));
@ -85,7 +85,7 @@ TEST(readdir, non_existing_dir)
return -ENOENT;
}
}));
EXPECT_CALL(fs, readdir("/some_dir",_,_)).Times(0);
EXPECT_CALL(fs, readdir("/some_dir",_)).Times(0);
webfuse::fixture fixture(fs);
auto const path = fixture.get_path() + "/some_dir";

View File

@ -36,7 +36,7 @@ public:
MOCK_METHOD(int, write, (std::string const & path, char const * buffer, size_t buffer_size, uint64_t offset, uint64_t handle));
MOCK_METHOD(int, mkdir, (std::string const & path, mode_t mode));
MOCK_METHOD(int, readdir, (std::string const & path, std::vector<std::string> & entries, uint64_t handle));
MOCK_METHOD(int, readdir, (std::string const & path, std::vector<std::string> & entries));
MOCK_METHOD(int, rmdir, (std::string const & path));
MOCK_METHOD(int, statfs, (std::string const & path, struct statvfs * statistics));