| 815 | bool 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 | |
| 832 | namespace { |
| 833 | template <typename T> |
| 834 | T readNumber(std::ifstream& stream) { |
| 835 | T data; |