newfs_hammer2 - Set default compression and check modes
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 5 Aug 2014 07:06:31 +0000 (00:06 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 5 Aug 2014 07:06:31 +0000 (00:06 -0700)
* 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

index 9203cf8..7f2bd9f 100644 (file)
@@ -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