From bbed25538c81a0db65583f076a9dfc454155382a Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Sat, 22 Sep 2018 09:37:14 -0700 Subject: [PATCH] remove unused member --- src/cryfs/filesystem/fsblobstore/DirBlob.cpp | 8 ++++---- src/cryfs/filesystem/fsblobstore/DirBlob.h | 5 ++--- src/cryfs/filesystem/fsblobstore/FsBlobStore.cpp | 4 ++-- src/cryfs/filesystem/fsblobstore/FsBlobStore.h | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/cryfs/filesystem/fsblobstore/DirBlob.cpp b/src/cryfs/filesystem/fsblobstore/DirBlob.cpp index dfeb77e4..2f92cdb8 100644 --- a/src/cryfs/filesystem/fsblobstore/DirBlob.cpp +++ b/src/cryfs/filesystem/fsblobstore/DirBlob.cpp @@ -26,8 +26,8 @@ namespace fsblobstore { constexpr fspp::num_bytes_t DirBlob::DIR_LSTAT_SIZE; -DirBlob::DirBlob(FsBlobStore *fsBlobStore, unique_ref blob, std::function getLstatSize) : - FsBlob(std::move(blob)), _fsBlobStore(fsBlobStore), _getLstatSize(getLstatSize), _entries(), _mutex(), _changed(false) { +DirBlob::DirBlob(unique_ref blob, std::function getLstatSize) : + FsBlob(std::move(blob)), _getLstatSize(getLstatSize), _entries(), _mutex(), _changed(false) { ASSERT(baseBlob().blobType() == FsBlobView::BlobType::DIR, "Loaded blob is not a directory"); _readEntriesFromBlob(); } @@ -43,9 +43,9 @@ void DirBlob::flush() { baseBlob().flush(); } -unique_ref DirBlob::InitializeEmptyDir(FsBlobStore *fsBlobStore, unique_ref blob, const blockstore::BlockId &parent, std::function getLstatSize) { +unique_ref DirBlob::InitializeEmptyDir(unique_ref blob, const blockstore::BlockId &parent, std::function getLstatSize) { InitializeBlob(blob.get(), FsBlobView::BlobType::DIR, parent); - return make_unique_ref(fsBlobStore, std::move(blob), getLstatSize); + return make_unique_ref(std::move(blob), getLstatSize); } void DirBlob::_writeEntriesToBlob() { diff --git a/src/cryfs/filesystem/fsblobstore/DirBlob.h b/src/cryfs/filesystem/fsblobstore/DirBlob.h index 25385f61..1546059c 100644 --- a/src/cryfs/filesystem/fsblobstore/DirBlob.h +++ b/src/cryfs/filesystem/fsblobstore/DirBlob.h @@ -18,11 +18,11 @@ namespace cryfs { public: constexpr static fspp::num_bytes_t DIR_LSTAT_SIZE = fspp::num_bytes_t(4096); - static cpputils::unique_ref InitializeEmptyDir(FsBlobStore *fsBlobStore, cpputils::unique_ref blob, + static cpputils::unique_ref InitializeEmptyDir(cpputils::unique_ref blob, const blockstore::BlockId &parent, std::function getLstatSize); - DirBlob(FsBlobStore *fsBlobStore, cpputils::unique_ref blob, std::function getLstatSize); + DirBlob(cpputils::unique_ref blob, std::function getLstatSize); ~DirBlob(); @@ -82,7 +82,6 @@ namespace cryfs { cpputils::unique_ref releaseBaseBlob() override; - FsBlobStore *_fsBlobStore; std::function _getLstatSize; DirEntryList _entries; mutable std::mutex _mutex; diff --git a/src/cryfs/filesystem/fsblobstore/FsBlobStore.cpp b/src/cryfs/filesystem/fsblobstore/FsBlobStore.cpp index 60b0b0ee..6d116358 100644 --- a/src/cryfs/filesystem/fsblobstore/FsBlobStore.cpp +++ b/src/cryfs/filesystem/fsblobstore/FsBlobStore.cpp @@ -22,7 +22,7 @@ boost::optional> FsBlobStore::load(const blockstore::BlockId if (blobType == FsBlobView::BlobType::FILE) { return unique_ref(make_unique_ref(std::move(*blob))); } else if (blobType == FsBlobView::BlobType::DIR) { - return unique_ref(make_unique_ref(this, std::move(*blob), _getLstatSize())); + return unique_ref(make_unique_ref(std::move(*blob), _getLstatSize())); } else if (blobType == FsBlobView::BlobType::SYMLINK) { return unique_ref(make_unique_ref(std::move(*blob))); } else { @@ -49,7 +49,7 @@ boost::optional> FsBlobStore::load(const blockstore::BlockId void FsBlobStore::_migrate(unique_ref node, const blockstore::BlockId &parentId) { FsBlobView::migrate(node.get(), parentId); if (FsBlobView::blobType(*node) == FsBlobView::BlobType::DIR) { - DirBlob dir(this, std::move(node), _getLstatSize()); + DirBlob dir(std::move(node), _getLstatSize()); vector children; dir.AppendChildrenTo(&children); for (const auto &child : children) { diff --git a/src/cryfs/filesystem/fsblobstore/FsBlobStore.h b/src/cryfs/filesystem/fsblobstore/FsBlobStore.h index 647f650c..48c6909a 100644 --- a/src/cryfs/filesystem/fsblobstore/FsBlobStore.h +++ b/src/cryfs/filesystem/fsblobstore/FsBlobStore.h @@ -56,7 +56,7 @@ namespace cryfs { inline cpputils::unique_ref FsBlobStore::createDirBlob(const blockstore::BlockId &parent) { auto blob = _baseBlobStore->create(); - return DirBlob::InitializeEmptyDir(this, std::move(blob), parent, _getLstatSize()); + return DirBlob::InitializeEmptyDir(std::move(blob), parent, _getLstatSize()); } inline cpputils::unique_ref FsBlobStore::createSymlinkBlob(const boost::filesystem::path &target, const blockstore::BlockId &parent) {