Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38CCEC07542 for ; Mon, 27 May 2019 04:50:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 053A32075E for ; Mon, 27 May 2019 04:50:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725822AbfE0Eqf (ORCPT ); Mon, 27 May 2019 00:46:35 -0400 Received: from mx2.suse.de ([195.135.220.15]:56146 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725767AbfE0Eqf (ORCPT ); Mon, 27 May 2019 00:46:35 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 4CA98ABD0 for ; Mon, 27 May 2019 04:46:34 +0000 (UTC) From: Qu Wenruo To: linux-btrfs@vger.kernel.org Subject: [PATCH] btrfs-progs: Enable crc32 optimization probe for convert and mkfs Date: Mon, 27 May 2019 12:46:27 +0800 Message-Id: <20190527044627.31588-1-wqu@suse.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Although moderm hardware is fast enough and crc32 calculation is not a hotspot, doing such optimization won't hurt anyway. Signed-off-by: Qu Wenruo --- convert/main.c | 2 ++ mkfs/main.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/convert/main.c b/convert/main.c index 68f76f716be9..31e54a5c000e 100644 --- a/convert/main.c +++ b/convert/main.c @@ -101,6 +101,7 @@ #include "mkfs/common.h" #include "convert/common.h" #include "convert/source-fs.h" +#include "kernel-lib/crc32c.h" #include "fsfeatures.h" extern const struct btrfs_convert_operations ext2_convert_ops; @@ -1845,6 +1846,7 @@ int main(int argc, char *argv[]) return 1; } + crc32c_optimization_init(); if (rollback) { ret = do_rollback(file); } else { diff --git a/mkfs/main.c b/mkfs/main.c index 1d03ec52ddd6..5727d61df2d7 100644 --- a/mkfs/main.c +++ b/mkfs/main.c @@ -42,6 +42,7 @@ #include "rbtree-utils.h" #include "mkfs/common.h" #include "mkfs/rootdir.h" +#include "kernel-lib/crc32c.h" #include "fsfeatures.h" static int verbose = 1; @@ -1121,6 +1122,8 @@ int main(int argc, char **argv) dev_cnt--; + crc32c_optimization_init(); + /* * Open without O_EXCL so that the problem should not occur by the * following operation in kernel: -- 2.21.0