mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
resize-fs: add helper that checks if the specified fs can do online grow/shrink
There's only one that can do this (btrfs), but let's abstract that fact, a bit in case the other file systems learn this too one day.
This commit is contained in:
@@ -119,3 +119,8 @@ uint64_t minimal_size_by_fs_name(const char *name) {
|
||||
|
||||
return UINT64_MAX;
|
||||
}
|
||||
|
||||
/* Returns true for the only fs that can online shrink *and* grow */
|
||||
bool fs_can_online_shrink_and_grow(statfs_f_type_t magic) {
|
||||
return magic == (statfs_f_type_t) BTRFS_SUPER_MAGIC;
|
||||
}
|
||||
|
||||
@@ -13,3 +13,5 @@ int resize_fs(int fd, uint64_t sz, uint64_t *ret_size);
|
||||
|
||||
uint64_t minimal_size_by_fs_magic(statfs_f_type_t magic);
|
||||
uint64_t minimal_size_by_fs_name(const char *str);
|
||||
|
||||
bool fs_can_online_shrink_and_grow(statfs_f_type_t magic);
|
||||
|
||||
Reference in New Issue
Block a user