MCPcopy Create free account
hub / github.com/bytedance/bolt / testingIsCowDisabled

Method testingIsCowDisabled

bolt/common/caching/SsdFile.cpp:817–832  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

815bool SsdFile::testingIsCowDisabled() const {
816#ifdef linux
817 int attr{0};
818 const auto res = ioctl(fd_, FS_IOC_GETFLAGS, &attr);
819 BOLT_CHECK_EQ(
820 0,
821 res,
822 "ioctl(FS_IOC_GETFLAGS) failed: {}, {}",
823 res,
824 folly::errnoStr(errno));
825
826 return (attr & FS_NOCOW_FL) == FS_NOCOW_FL;
827#else
828 return false;
829#endif // linux
830}
831
832namespace {
833template <typename T>
834T readNumber(std::ifstream& stream) {
835 T data;

Callers 1

TEST_FFunction · 0.80

Calls

no outgoing calls

Tested by 1

TEST_FFunction · 0.64