xref: /openbmc/estoraged/include/util.hpp (revision 5d799bb9)
1 #pragma once
2 #include <string>
3 
4 namespace estoraged
5 {
6 namespace util
7 {
8 
9 /** @brief finds the size of the linux block device in bytes
10  *  @param[in] devpath - the name of the linux block device
11  *  @return size of a block device using the devPath
12  */
13 uint64_t findSizeOfBlockDevice(const std::string& devPath);
14 
15 /** @brief finds the predicted life left for a eMMC device
16  *  @param[in] sysfsPath - The path to the linux sysfs interface
17  *  @return the life remaing for the emmc, as a percentage.
18  */
19 uint8_t findPredictedMediaLifeLeftPercent(const std::string& sysfsPath);
20 
21 } // namespace util
22 
23 } // namespace estoraged
24