forked from Mirrors/btrfs-progs
btrfs-progs: define BTRFS_MKFS_SMALL_VOLUME_SIZE for small volume
mkfs cut of size '1024 * 1024 * 1024' to mark dev as small volume so to force mixed group. Use a define for that. Signed-off-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.cz>master
parent
27d61fbcab
commit
fcdd44470d
2
mkfs.c
2
mkfs.c
|
@ -1335,7 +1335,7 @@ int main(int ac, char **av)
|
||||||
break;
|
break;
|
||||||
case 'b':
|
case 'b':
|
||||||
block_count = parse_size(optarg);
|
block_count = parse_size(optarg);
|
||||||
if (block_count <= 1024*1024*1024) {
|
if (block_count <= BTRFS_MKFS_SMALL_VOLUME_SIZE) {
|
||||||
fprintf(stdout,
|
fprintf(stdout,
|
||||||
"SMALL VOLUME: forcing mixed metadata/data groups\n");
|
"SMALL VOLUME: forcing mixed metadata/data groups\n");
|
||||||
mixed = 1;
|
mixed = 1;
|
||||||
|
|
4
utils.c
4
utils.c
|
@ -702,7 +702,7 @@ int btrfs_prepare_device(int fd, char *file, int zero_end, u64 *block_count_ret,
|
||||||
if (max_block_count)
|
if (max_block_count)
|
||||||
block_count = min(block_count, max_block_count);
|
block_count = min(block_count, max_block_count);
|
||||||
|
|
||||||
if (block_count < 1024 * 1024 * 1024 && !(*mixed)) {
|
if (block_count < BTRFS_MKFS_SMALL_VOLUME_SIZE && !(*mixed)) {
|
||||||
printf("SMALL VOLUME: forcing mixed metadata/data groups\n");
|
printf("SMALL VOLUME: forcing mixed metadata/data groups\n");
|
||||||
*mixed = 1;
|
*mixed = 1;
|
||||||
}
|
}
|
||||||
|
@ -2287,7 +2287,7 @@ int is_vol_small(char *file)
|
||||||
close(fd);
|
close(fd);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (size < 1024 * 1024 * 1024) {
|
if (size < BTRFS_MKFS_SMALL_VOLUME_SIZE) {
|
||||||
close(fd);
|
close(fd);
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
|
|
1
utils.h
1
utils.h
|
@ -24,6 +24,7 @@
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
|
||||||
#define BTRFS_MKFS_SYSTEM_GROUP_SIZE (4 * 1024 * 1024)
|
#define BTRFS_MKFS_SYSTEM_GROUP_SIZE (4 * 1024 * 1024)
|
||||||
|
#define BTRFS_MKFS_SMALL_VOLUME_SIZE (1024 * 1024 * 1024)
|
||||||
|
|
||||||
#define BTRFS_SCAN_PROC (1ULL << 0)
|
#define BTRFS_SCAN_PROC (1ULL << 0)
|
||||||
#define BTRFS_SCAN_DEV (1ULL << 1)
|
#define BTRFS_SCAN_DEV (1ULL << 1)
|
||||||
|
|
Loading…
Reference in New Issue