mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-25 15:42:23 +00:00
btrfs-progs: make checksum type explicit in mkfs context structure
Add checksum type to the definition structure for a new filesystem, this will be used in following patches. Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
669f561775
commit
779ada6edd
@ -1158,6 +1158,7 @@ static int do_convert(const char *devname, u32 convert_flags, u32 nodesize,
|
||||
printf("\tfeatures: %s\n", features_buf);
|
||||
|
||||
memset(&mkfs_cfg, 0, sizeof(mkfs_cfg));
|
||||
mkfs_cfg.csum_type = BTRFS_CSUM_TYPE_CRC32;
|
||||
mkfs_cfg.label = cctx.volume_name;
|
||||
mkfs_cfg.num_bytes = total_bytes;
|
||||
mkfs_cfg.nodesize = nodesize;
|
||||
|
4
ctree.h
4
ctree.h
@ -165,7 +165,9 @@ struct btrfs_free_space_ctl;
|
||||
#define BTRFS_CSUM_SIZE 32
|
||||
|
||||
/* csum types */
|
||||
#define BTRFS_CSUM_TYPE_CRC32 0
|
||||
enum btrfs_csum_type {
|
||||
BTRFS_CSUM_TYPE_CRC32 = 0,
|
||||
};
|
||||
|
||||
/* four bytes for CRC32 */
|
||||
static int btrfs_csum_sizes[] = { 4 };
|
||||
|
@ -53,6 +53,8 @@ struct btrfs_mkfs_config {
|
||||
u64 features;
|
||||
/* Size of the filesystem in bytes */
|
||||
u64 num_bytes;
|
||||
/* checksum algorithm to use */
|
||||
enum btrfs_csum_type csum_type;
|
||||
|
||||
/* Output fields, set during creation */
|
||||
|
||||
|
@ -1169,6 +1169,7 @@ int BOX_MAIN(mkfs)(int argc, char **argv)
|
||||
warning("metadata has lower redundancy than data!\n");
|
||||
}
|
||||
|
||||
mkfs_cfg.csum_type = BTRFS_CSUM_TYPE_CRC32;
|
||||
mkfs_cfg.label = label;
|
||||
memcpy(mkfs_cfg.fs_uuid, fs_uuid, sizeof(mkfs_cfg.fs_uuid));
|
||||
mkfs_cfg.num_bytes = dev_block_count;
|
||||
|
Loading…
Reference in New Issue
Block a user