diff --git a/eden/fs/inodes/FileInode.cpp b/eden/fs/inodes/FileInode.cpp index 1f218549f05fd..771a53aeefe5c 100644 --- a/eden/fs/inodes/FileInode.cpp +++ b/eden/fs/inodes/FileInode.cpp @@ -986,7 +986,7 @@ ImmediateFuture FileInode::stat( } } -void FileInode::updateBlockCount(FOLLY_MAYBE_UNUSED struct stat& st) { +void FileInode::updateBlockCount([[maybe_unused]] struct stat& st) { // win32 does not have stat::st_blocks #ifndef _WIN32 // Compute a value to store in st_blocks based on st_size. diff --git a/eden/fs/inodes/InodeBase.cpp b/eden/fs/inodes/InodeBase.cpp index 6689eea946ee5..09bb13425cc75 100644 --- a/eden/fs/inodes/InodeBase.cpp +++ b/eden/fs/inodes/InodeBase.cpp @@ -42,7 +42,7 @@ InodeBase::InodeBase(EdenMount* mount) InodeBase::InodeBase( InodeNumber ino, mode_t initialMode, - FOLLY_MAYBE_UNUSED const std::optional& initialTimestamps, + [[maybe_unused]] const std::optional& initialTimestamps, TreeInodePtr parent, PathComponentPiece name) : ino_{ino}, @@ -347,7 +347,7 @@ void InodeBase::updateAtime() { #endif } -void InodeBase::updateMtimeAndCtime(FOLLY_MAYBE_UNUSED EdenTimestamp now) { +void InodeBase::updateMtimeAndCtime([[maybe_unused]] EdenTimestamp now) { #ifndef _WIN32 XLOG(DBG9) << "Updating timestamps for : " << ino_; getMount()->getInodeMetadataTable()->modifyOrThrow( diff --git a/eden/fs/inodes/InodeCatalog.h b/eden/fs/inodes/InodeCatalog.h index c1a9e731d78de..3e9553317fff1 100644 --- a/eden/fs/inodes/InodeCatalog.h +++ b/eden/fs/inodes/InodeCatalog.h @@ -170,10 +170,10 @@ class InodeCatalog { * directory when EdenFS is not running. */ virtual InodeNumber scanLocalChanges( - FOLLY_MAYBE_UNUSED std::shared_ptr config, - FOLLY_MAYBE_UNUSED AbsolutePathPiece mountPath, - FOLLY_MAYBE_UNUSED bool windowsSymlinksEnabled, - FOLLY_MAYBE_UNUSED LookupCallback& callback) { + [[maybe_unused]] std::shared_ptr config, + [[maybe_unused]] AbsolutePathPiece mountPath, + [[maybe_unused]] bool windowsSymlinksEnabled, + [[maybe_unused]] LookupCallback& callback) { EDEN_BUG() << "UNIMPLEMENTED"; } diff --git a/eden/fs/inodes/InodeMap.cpp b/eden/fs/inodes/InodeMap.cpp index e264836aca3a4..73855f054def4 100644 --- a/eden/fs/inodes/InodeMap.cpp +++ b/eden/fs/inodes/InodeMap.cpp @@ -828,7 +828,7 @@ void InodeMap::setUnmounted() { } Future InodeMap::shutdown( - FOLLY_MAYBE_UNUSED bool doTakeover) { + [[maybe_unused]] bool doTakeover) { // Record that we are in the process of shutting down. auto future = Future::makeEmpty(); { diff --git a/eden/fs/inodes/Overlay.cpp b/eden/fs/inodes/Overlay.cpp index 0084e41d70e90..eb8295d84770e 100644 --- a/eden/fs/inodes/Overlay.cpp +++ b/eden/fs/inodes/Overlay.cpp @@ -313,8 +313,8 @@ folly::SemiFuture Overlay::initialize( void Overlay::initOverlay( std::shared_ptr config, std::optional mountPath, - FOLLY_MAYBE_UNUSED const OverlayChecker::ProgressCallback& progressCallback, - FOLLY_MAYBE_UNUSED InodeCatalog::LookupCallback& lookupCallback) { + [[maybe_unused]] const OverlayChecker::ProgressCallback& progressCallback, + [[maybe_unused]] InodeCatalog::LookupCallback& lookupCallback) { IORequest req{this}; auto optNextInodeNumber = inodeCatalog_->initOverlay(/*createIfNonExisting=*/true); diff --git a/eden/fs/inodes/TreeInode.cpp b/eden/fs/inodes/TreeInode.cpp index 33824309fb51e..7fb35424dad2c 100644 --- a/eden/fs/inodes/TreeInode.cpp +++ b/eden/fs/inodes/TreeInode.cpp @@ -1104,7 +1104,7 @@ FileInodePtr TreeInode::createImpl( folly::Synchronized::LockedPtr contents, PathComponentPiece name, mode_t mode, - FOLLY_MAYBE_UNUSED ByteRange fileContents, + [[maybe_unused]] ByteRange fileContents, InvalidationRequired invalidate, std::chrono::system_clock::time_point startTime) { #ifndef _WIN32 @@ -3835,7 +3835,7 @@ bool needDecFsRefcount(InodeMap& inodeMap, InodeNumber ino) { folly::Try TreeInode::invalidateChannelEntryCache( TreeInodeState&, PathComponentPiece name, - FOLLY_MAYBE_UNUSED std::optional ino) { + [[maybe_unused]] std::optional ino) { auto faultTry = getMount()->getServerState()->getFaultInjector().checkTry( "invalidateChannelEntryCache", name); if (faultTry.hasException()) { diff --git a/eden/fs/inodes/lmdbcatalog/LMDBInodeCatalog.cpp b/eden/fs/inodes/lmdbcatalog/LMDBInodeCatalog.cpp index 5fd4a734f9649..d40f14de6d77c 100644 --- a/eden/fs/inodes/lmdbcatalog/LMDBInodeCatalog.cpp +++ b/eden/fs/inodes/lmdbcatalog/LMDBInodeCatalog.cpp @@ -87,7 +87,7 @@ InodeNumber LMDBInodeCatalog::scanLocalChanges( std::shared_ptr /*config*/, AbsolutePathPiece /*mountPath*/, bool /*windowsSymlinksEnabled*/, - FOLLY_MAYBE_UNUSED InodeCatalog::LookupCallback& /*callback*/) { + [[maybe_unused]] InodeCatalog::LookupCallback& /*callback*/) { NOT_IMPLEMENTED(); } } // namespace facebook::eden diff --git a/eden/fs/inodes/memcatalog/MemInodeCatalog.cpp b/eden/fs/inodes/memcatalog/MemInodeCatalog.cpp index b9be943c4e557..4759a6c255604 100644 --- a/eden/fs/inodes/memcatalog/MemInodeCatalog.cpp +++ b/eden/fs/inodes/memcatalog/MemInodeCatalog.cpp @@ -181,15 +181,15 @@ InodeNumber MemInodeCatalog::nextInodeNumber() { } std::optional MemInodeCatalog::loadInodeInfo( - FOLLY_MAYBE_UNUSED InodeNumber number) { + [[maybe_unused]] InodeNumber number) { return std::nullopt; } InodeNumber MemInodeCatalog::scanLocalChanges( - FOLLY_MAYBE_UNUSED std::shared_ptr config, - FOLLY_MAYBE_UNUSED AbsolutePathPiece mountPath, - FOLLY_MAYBE_UNUSED bool windowsSymlinksEnabled, - FOLLY_MAYBE_UNUSED InodeCatalog::LookupCallback& callback) { + [[maybe_unused]] std::shared_ptr config, + [[maybe_unused]] AbsolutePathPiece mountPath, + [[maybe_unused]] bool windowsSymlinksEnabled, + [[maybe_unused]] InodeCatalog::LookupCallback& callback) { #ifdef _WIN32 windowsFsckScanLocalChanges( config, diff --git a/eden/fs/inodes/sqlitecatalog/SqliteInodeCatalog.cpp b/eden/fs/inodes/sqlitecatalog/SqliteInodeCatalog.cpp index f69afb392155f..f73da7cab4e76 100644 --- a/eden/fs/inodes/sqlitecatalog/SqliteInodeCatalog.cpp +++ b/eden/fs/inodes/sqlitecatalog/SqliteInodeCatalog.cpp @@ -119,8 +119,8 @@ std::vector SqliteInodeCatalog::getAllParentInodeNumbers() { InodeNumber SqliteInodeCatalog::scanLocalChanges( std::shared_ptr config, AbsolutePathPiece mountPath, - FOLLY_MAYBE_UNUSED bool windowsSymlinksEnabled, - FOLLY_MAYBE_UNUSED InodeCatalog::LookupCallback& callback) { + [[maybe_unused]] bool windowsSymlinksEnabled, + [[maybe_unused]] InodeCatalog::LookupCallback& callback) { #ifdef _WIN32 windowsFsckScanLocalChanges( config, diff --git a/eden/fs/inodes/test/CheckoutTest.cpp b/eden/fs/inodes/test/CheckoutTest.cpp index 822d68e390cce..c41c7a703a2e0 100644 --- a/eden/fs/inodes/test/CheckoutTest.cpp +++ b/eden/fs/inodes/test/CheckoutTest.cpp @@ -74,7 +74,7 @@ inline void PrintTo( namespace { -bool isExecutable(FOLLY_MAYBE_UNUSED int perms) { +bool isExecutable([[maybe_unused]] int perms) { #ifndef _WIN32 return perms & S_IXUSR; #else @@ -156,7 +156,7 @@ void loadInodes( RelativePathPiece path, LoadBehavior loadType, std::optional expectedContents, - FOLLY_MAYBE_UNUSED mode_t expectedPerms) { + [[maybe_unused]] mode_t expectedPerms) { switch (loadType) { case LoadBehavior::NONE: return; @@ -390,7 +390,7 @@ void testModifyFile( } testMount.getClock().advance(10min); - FOLLY_MAYBE_UNUSED auto checkoutStart = testMount.getClock().getTimePoint(); + [[maybe_unused]] auto checkoutStart = testMount.getClock().getTimePoint(); auto executor = testMount.getServerExecutor().get(); auto checkoutResult = testMount.getEdenMount() ->checkout( diff --git a/eden/fs/service/EdenServer.cpp b/eden/fs/service/EdenServer.cpp index 112f8bc0d5b5e..ea6288cd298ef 100644 --- a/eden/fs/service/EdenServer.cpp +++ b/eden/fs/service/EdenServer.cpp @@ -1509,8 +1509,8 @@ void EdenServer::unregisterInodePopulationReportsCallback() { } Future EdenServer::performTakeoverStart( - FOLLY_MAYBE_UNUSED std::shared_ptr edenMount, - FOLLY_MAYBE_UNUSED TakeoverData::MountInfo&& info) { + [[maybe_unused]] std::shared_ptr edenMount, + [[maybe_unused]] TakeoverData::MountInfo&& info) { #ifndef _WIN32 auto mountPath = info.mountPath; @@ -1531,8 +1531,8 @@ Future EdenServer::performTakeoverStart( } Future EdenServer::completeTakeoverStart( - FOLLY_MAYBE_UNUSED std::shared_ptr edenMount, - FOLLY_MAYBE_UNUSED TakeoverData::MountInfo&& info) { + [[maybe_unused]] std::shared_ptr edenMount, + [[maybe_unused]] TakeoverData::MountInfo&& info) { if (auto channelData = std::get_if(&info.channelInfo)) { // Start up the fuse workers. return folly::makeFutureWith( diff --git a/eden/fs/service/EdenServiceHandler.cpp b/eden/fs/service/EdenServiceHandler.cpp index c41a698abc39c..2095d89cbef10 100644 --- a/eden/fs/service/EdenServiceHandler.cpp +++ b/eden/fs/service/EdenServiceHandler.cpp @@ -3161,9 +3161,9 @@ folly::SemiFuture EdenServiceHandler::semifuture_prefetchFiles( } folly::SemiFuture EdenServiceHandler::semifuture_chown( - FOLLY_MAYBE_UNUSED std::unique_ptr mountPoint, - FOLLY_MAYBE_UNUSED int32_t uid, - FOLLY_MAYBE_UNUSED int32_t gid) { + [[maybe_unused]] std::unique_ptr mountPoint, + [[maybe_unused]] int32_t uid, + [[maybe_unused]] int32_t gid) { #ifndef _WIN32 auto handle = lookupMount(mountPoint); return handle.getEdenMount().chown(uid, gid).ensure([handle] {}).semi(); @@ -3765,8 +3765,8 @@ void EdenServiceHandler::debugInodeStatus( } void EdenServiceHandler::debugOutstandingFuseCalls( - FOLLY_MAYBE_UNUSED std::vector& outstandingCalls, - FOLLY_MAYBE_UNUSED std::unique_ptr mountPoint) { + [[maybe_unused]] std::vector& outstandingCalls, + [[maybe_unused]] std::unique_ptr mountPoint) { #ifndef _WIN32 auto helper = INSTRUMENT_THRIFT_CALL(DBG2); @@ -3802,8 +3802,8 @@ void EdenServiceHandler::debugOutstandingNfsCalls( } void EdenServiceHandler::debugOutstandingPrjfsCalls( - FOLLY_MAYBE_UNUSED std::vector& outstandingCalls, - FOLLY_MAYBE_UNUSED std::unique_ptr mountPoint) { + [[maybe_unused]] std::vector& outstandingCalls, + [[maybe_unused]] std::unique_ptr mountPoint) { #ifdef _WIN32 auto helper = INSTRUMENT_THRIFT_CALL(DBG2); @@ -4026,9 +4026,9 @@ int64_t EdenServiceHandler::debugDropAllPendingRequests() { } int64_t EdenServiceHandler::unloadInodeForPath( - FOLLY_MAYBE_UNUSED unique_ptr mountPoint, - FOLLY_MAYBE_UNUSED std::unique_ptr path, - FOLLY_MAYBE_UNUSED std::unique_ptr age) { + [[maybe_unused]] unique_ptr mountPoint, + [[maybe_unused]] std::unique_ptr path, + [[maybe_unused]] std::unique_ptr age) { #ifndef _WIN32 auto helper = INSTRUMENT_THRIFT_CALL(DBG1, *mountPoint, *path); auto mountHandle = lookupMount(mountPoint); @@ -4237,8 +4237,8 @@ void EdenServiceHandler::flushStatsNow() { folly::SemiFuture EdenServiceHandler::semifuture_invalidateKernelInodeCache( - FOLLY_MAYBE_UNUSED std::unique_ptr mountPoint, - FOLLY_MAYBE_UNUSED std::unique_ptr path) { + [[maybe_unused]] std::unique_ptr mountPoint, + [[maybe_unused]] std::unique_ptr path) { auto helper = INSTRUMENT_THRIFT_CALL(DBG2, *mountPoint, *path); auto mountHandle = lookupMount(mountPoint); #ifndef _WIN32 diff --git a/eden/fs/service/StartupLogger.cpp b/eden/fs/service/StartupLogger.cpp index 47235ee86461c..9968bc9b19f1b 100644 --- a/eden/fs/service/StartupLogger.cpp +++ b/eden/fs/service/StartupLogger.cpp @@ -204,7 +204,7 @@ DaemonStartupLogger::ChildHandler::~ChildHandler() { DaemonStartupLogger::ChildHandler DaemonStartupLogger::spawnImpl( StringPiece logPath, - FOLLY_MAYBE_UNUSED PrivHelper* privHelper, + [[maybe_unused]] PrivHelper* privHelper, const std::vector& argv) { XDCHECK(!logPath.empty()); diff --git a/eden/fs/service/ThriftGetObjectImpl.h b/eden/fs/service/ThriftGetObjectImpl.h index 9f437b1c5e4c9..b01eac4ed7804 100644 --- a/eden/fs/service/ThriftGetObjectImpl.h +++ b/eden/fs/service/ThriftGetObjectImpl.h @@ -103,7 +103,7 @@ folly::Try transformToTryMetadata( edenMount->getObjectStore()->renderObjectId(id))}; } -// FOLLY_MAYBE_UNUSED: This specialization is used and nessecary, but clang's +// [[maybe_unused]]: This specialization is used and nessecary, but clang's // maybe unused thing thinks that the templated transformToTryMetadata above // will over shadow this specialization. So clang will think this is unused. // Apparently, clang does not bother trying to instantate a templated thing. @@ -112,7 +112,7 @@ folly::Try transformToTryMetadata( // https://stackoverflow.com/questions/66986718/c-clang-emit-warning-about-unused-template-variable) // Maybe concepts in C++20 will clear this up, but we aren't there yet. template <> -FOLLY_MAYBE_UNUSED folly::Try transformToTryMetadata( +[[maybe_unused]] folly::Try transformToTryMetadata( folly::Try> metadata, std::shared_ptr edenMount, ObjectId id); diff --git a/eden/fs/testharness/TestMount.cpp b/eden/fs/testharness/TestMount.cpp index 3cb82536e0637..3d2cc07d10363 100644 --- a/eden/fs/testharness/TestMount.cpp +++ b/eden/fs/testharness/TestMount.cpp @@ -493,7 +493,7 @@ bool TestMount::hasOverlayDir(InodeNumber ino) const { return edenMount_->getOverlay()->hasOverlayDir(ino); } -bool TestMount::hasMetadata(FOLLY_MAYBE_UNUSED InodeNumber ino) const { +bool TestMount::hasMetadata([[maybe_unused]] InodeNumber ino) const { #ifndef _WIN32 return edenMount_->getInodeMetadataTable()->getOptional(ino).has_value(); #else diff --git a/eden/fs/utils/ProcUtil.cpp b/eden/fs/utils/ProcUtil.cpp index fcdf8b26ac481..2c7617fb0d64c 100644 --- a/eden/fs/utils/ProcUtil.cpp +++ b/eden/fs/utils/ProcUtil.cpp @@ -237,7 +237,7 @@ std::optional calculatePrivateBytes() { #endif } -ProcessList readProcessIdsForPath(FOLLY_MAYBE_UNUSED const AbsolutePath& path) { +ProcessList readProcessIdsForPath([[maybe_unused]] const AbsolutePath& path) { ProcessList pids; #ifdef __APPLE__ // Obtain the number of bytes to allocate for the pids buffer.