diff options
Diffstat (limited to 'services/incremental/ServiceWrappers.cpp')
| -rw-r--r-- | services/incremental/ServiceWrappers.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/services/incremental/ServiceWrappers.cpp b/services/incremental/ServiceWrappers.cpp index eb204c5466e0..7e85f9db70fd 100644 --- a/services/incremental/ServiceWrappers.cpp +++ b/services/incremental/ServiceWrappers.cpp @@ -134,6 +134,10 @@ private: } mLooper; }; +std::string IncFsWrapper::toString(FileId fileId) { + return incfs::toString(fileId); +} + class RealIncFs final : public IncFsWrapper { public: RealIncFs() = default; @@ -173,9 +177,16 @@ public: FileId getFileId(const Control& control, std::string_view path) const final { return incfs::getFileId(control, path); } - std::string toString(FileId fileId) const final { return incfs::toString(fileId); } std::pair<IncFsBlockIndex, IncFsBlockIndex> countFilledBlocks( const Control& control, std::string_view path) const final { + if (incfs::features() & Features::v2) { + const auto counts = incfs::getBlockCount(control, path); + if (!counts) { + return {-errno, -errno}; + } + return {counts->filledDataBlocks + counts->filledHashBlocks, + counts->totalDataBlocks + counts->totalHashBlocks}; + } const auto fileId = incfs::getFileId(control, path); const auto fd = incfs::openForSpecialOps(control, fileId); int res = fd.get(); |