17 #ifndef __XFS_UTILS_HPP__ 18 #define __XFS_UTILS_HPP__ 31 #if HAVE_XFS_XFS_TYPES_H 32 #include <xfs/xfs_types.h> 54 : blockCount((bytes.bytes() + BASIC_BLOCK_SIZE - 1) / BASIC_BLOCK_SIZE) {}
57 : blockCount(_blockCount) {}
61 return blockCount == that.blockCount;
66 return blockCount != that.blockCount;
69 uint64_t
blocks()
const {
return blockCount; }
75 static constexpr
unsigned BASIC_BLOCK_SIZE = 512;
114 const std::string& path,
119 const std::string& path,
126 const std::string& path,
132 const std::string& path,
137 const std::string& directory);
141 const std::string& directory,
146 const std::string& directory);
152 #endif // __XFS_UTILS_HPP__
BasicBlocks(const Bytes &bytes)
Definition: utils.hpp:53
Result< QuotaInfo > getProjectQuota(const std::string &path, prid_t projectId)
Try< std::string > getDeviceForPath(const std::string &path)
Bytes bytes() const
Definition: utils.hpp:70
Bytes used
Definition: utils.hpp:43
bool operator==(const BasicBlocks &that) const
Definition: utils.hpp:59
bool operator==(const QuotaInfo &left, const QuotaInfo &right)
Definition: utils.hpp:86
Try< Nothing > setProjectQuota(const std::string &path, prid_t projectId, Bytes softLimit, Bytes hardLimit)
Try< Nothing > clearProjectQuota(const std::string &path, prid_t projectId)
Result< prid_t > getProjectId(const std::string &directory)
QuotaPolicy
Definition: utils.hpp:79
Definition: attributes.hpp:24
bool isPathXfs(const std::string &path)
Bytes softLimit
Definition: utils.hpp:41
uint64_t blocks() const
Definition: utils.hpp:69
Try< bool > isQuotaEnabled(const std::string &path)
Bytes hardLimit
Definition: utils.hpp:42
bool operator!=(const BasicBlocks &that) const
Definition: utils.hpp:64
Try< Nothing > clearProjectId(const std::string &directory)
constexpr BasicBlocks(uint64_t _blockCount)
Definition: utils.hpp:56
Try< Nothing > setProjectId(const std::string &directory, prid_t projectId)
Option< Error > validateProjectIds(const IntervalSet< prid_t > &projectRange)