From 545b9315d306c154f99cec1702444d49b101fdd0 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Tue, 5 Aug 2014 00:06:31 -0700 Subject: [PATCH] newfs_hammer2 - Set default compression and check modes * When creating a new filesystem, make sure the directory inodes contain proper defaults for the compression and crc check mode. --- sbin/newfs_hammer2/newfs_hammer2.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/sbin/newfs_hammer2/newfs_hammer2.c b/sbin/newfs_hammer2/newfs_hammer2.c index 9203cf8666..7f2bd9fc0b 100644 --- a/sbin/newfs_hammer2/newfs_hammer2.c +++ b/sbin/newfs_hammer2/newfs_hammer2.c @@ -571,9 +571,15 @@ format_hammer2(int fd, hammer2_off_t total_space, hammer2_off_t free_space) * (pfs-create also does the same if the pfs is named "BOOT") */ if (strcasecmp(Label[i], "BOOT") == 0) { - rawip->comp_algo = HAMMER2_COMP_AUTOZERO; + rawip->comp_algo = HAMMER2_ENC_ALGO( + HAMMER2_COMP_AUTOZERO); + rawip->check_algo = HAMMER2_ENC_ALGO( + HAMMER2_CHECK_ISCSI32); } else { - rawip->comp_algo = HAMMER2_COMP_NEWFS_DEFAULT; + rawip->comp_algo = HAMMER2_ENC_ALGO( + HAMMER2_COMP_NEWFS_DEFAULT); + rawip->check_algo = HAMMER2_ENC_ALGO( + HAMMER2_CHECK_ISCSI32); } rawip->pfs_clid = Hammer2_PfsCLID[i]; @@ -628,7 +634,8 @@ format_hammer2(int fd, hammer2_off_t total_space, hammer2_off_t free_space) rawip->name_len = 0; /* super-root is unnamed */ rawip->name_key = 0; - rawip->comp_algo = HAMMER2_COMP_AUTOZERO; + rawip->comp_algo = HAMMER2_ENC_ALGO(HAMMER2_COMP_AUTOZERO); + rawip->check_algo = HAMMER2_ENC_ALGO(HAMMER2_CHECK_ISCSI32); /* * The super-root is flagged as a PFS and typically given its own -- 2.41.0