Skip to content

Commit

Permalink
fs: fixed clang-16 compilation warnings
Browse files Browse the repository at this point in the history
* Fixed mismatching 'class' / 'struct' declarations.
* Removed '=default' copy constructor declaration for the 'ZBDSnapshot'
  as it violates the "rule of 5".
* Eliminated dead code in 'ZoneFile::RecoverSparseExtents()'.

Signed-off-by: Yura Sorokin <[email protected]>
  • Loading branch information
percona-ysorokin authored and yhr committed Jun 8, 2023
1 parent 7e0fac2 commit cea45ab
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion fs/fs_zenfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace ROCKSDB_NAMESPACE {
class ZoneSnapshot;
class ZoneFileSnapshot;
class ZenFSSnapshot;
class ZenFSSnapshotOptions;
struct ZenFSSnapshotOptions;

class Superblock {
uint32_t magic_ = 0;
Expand Down
2 changes: 0 additions & 2 deletions fs/io_zenfs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,6 @@ IOStatus ZoneFile::RecoverSparseExtents(uint64_t start, uint64_t end,
int f = zbd_->GetReadFD();
uint64_t next_extent_start = start;
char* buffer;
int recovered_segments = 0;
int ret;

ret = posix_memalign((void**)&buffer, sysconf(_SC_PAGESIZE), block_sz);
Expand All @@ -639,7 +638,6 @@ IOStatus ZoneFile::RecoverSparseExtents(uint64_t start, uint64_t end,
s = IOStatus::IOError("Unexexpeted extent length while recovering");
break;
}
recovered_segments++;

zone->used_capacity_ += extent_length;
extents_.push_back(new ZoneExtent(next_extent_start + SPARSE_HEADER_SIZE,
Expand Down
2 changes: 1 addition & 1 deletion fs/metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace ROCKSDB_NAMESPACE {

class ZenFSMetricsGuard;
class ZenFSSnapshot;
class ZenFSSnapshotOptions;
struct ZenFSSnapshotOptions;

// Types of Reporter that may be used for statistics.
enum ZenFSMetricsReporterType : uint32_t {
Expand Down
1 change: 0 additions & 1 deletion fs/snapshot.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class ZBDSnapshot {

public:
ZBDSnapshot() = default;
ZBDSnapshot(const ZBDSnapshot&) = default;
ZBDSnapshot(ZonedBlockDevice& zbd)
: free_space(zbd.GetFreeSpace()),
used_space(zbd.GetUsedSpace()),
Expand Down
2 changes: 1 addition & 1 deletion fs/zbd_zenfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace ROCKSDB_NAMESPACE {

class ZonedBlockDevice;
class ZoneSnapshot;
class ZenFSSnapshotOptions;
struct ZenFSSnapshotOptions;

class Zone {
ZonedBlockDevice *zbd_;
Expand Down

0 comments on commit cea45ab

Please sign in to comment.