mirror of
https://github.com/versity/scoutfs.git
synced 2026-01-11 06:00:19 +00:00
Split the existing device_size() into get_device_size() and limit_device_size(). An upcoming command wants to get the device size without applying limiting policy. Signed-off-by: Zach Brown <zab@versity.com>
20 lines
550 B
C
20 lines
550 B
C
#ifndef _DEV_H_
|
|
#define _DEV_H_
|
|
|
|
#include <stdbool.h>
|
|
|
|
#define BASE_SIZE_FMT "%.2f%s"
|
|
#define BASE_SIZE_ARGS(sz) size_flt(sz, 1), size_str(sz, 1)
|
|
|
|
#define SIZE_FMT "%llu (%.2f %s)"
|
|
#define SIZE_ARGS(nr, sz) (nr), size_flt(nr, sz), size_str(nr, sz)
|
|
|
|
int get_device_size(char *path, int fd, u64 *size_ret);
|
|
int limit_device_size(char *path, int fd, u64 min_size, u64 max_size, bool allow_small_size,
|
|
char *use_type, u64 *size_ret);
|
|
float size_flt(u64 nr, unsigned size);
|
|
char *size_str(u64 nr, unsigned size);
|
|
int flush_device(int fd);
|
|
|
|
#endif
|