From patchwork Tue Feb 12 19:39:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Dryomov X-Patchwork-Id: 2130821 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id C8CEBE00D9 for ; Tue, 12 Feb 2013 19:39:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933530Ab3BLTjd (ORCPT ); Tue, 12 Feb 2013 14:39:33 -0500 Received: from mail-ee0-f42.google.com ([74.125.83.42]:39308 "EHLO mail-ee0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933268Ab3BLTj0 (ORCPT ); Tue, 12 Feb 2013 14:39:26 -0500 Received: by mail-ee0-f42.google.com with SMTP id b47so237978eek.29 for ; Tue, 12 Feb 2013 11:39:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=OkfNgG8zXsJ/Ccou7W90VkstjDbFHpbclGRcXmU7SbI=; b=i/bZLfLMFw8htp17i9AR+Xa8QndxK3Chy1XVkXs0/Rp0De4BHXB1yves0QReciVBzN iFZmNejejEZtvWaKb24Ex7JcBZfllR1n5+m1kKqQdfhhf3UsG6jpZcyO/OO+C0m0edAz ZPafP4rIIZ9qa/gzcEnZ9GJwyGAjXFgUdDHy3jo/xZHZXQKDJfvdMgs8Udmt9WuhJPUr Xiw4l97vLiYxgFvIy/HM62KcPnODNBoRZfczs/FPq298EUn4bLLdSF5cgb6CtdjS2jnp uv5R3AudPikbW80yCZZl9OZ2s84SWp+1tjCWi9wr+Wg5zuz85hVP3y/WiNwhHnsXtyxd Y3VA== X-Received: by 10.14.183.67 with SMTP id p43mr65550358eem.10.1360697964486; Tue, 12 Feb 2013 11:39:24 -0800 (PST) Received: from localhost ([109.110.82.161]) by mx.google.com with ESMTPS id u44sm9594141eel.7.2013.02.12.11.39.22 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 12 Feb 2013 11:39:23 -0800 (PST) From: Ilya Dryomov To: linux-btrfs@vger.kernel.org Cc: idryomov@gmail.com Subject: [PATCH] Btrfs-progs: move crc32c optimization init Date: Tue, 12 Feb 2013 21:39:17 +0200 Message-Id: <1360697957-27461-1-git-send-email-idryomov@gmail.com> X-Mailer: git-send-email 1.7.9.1 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Don't call crc32c_optimization_init() until we know that a command is actually going to be invoked. Signed-off-by: Ilya Dryomov --- btrfs.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/btrfs.c b/btrfs.c index 687acec..7752bd6 100644 --- a/btrfs.c +++ b/btrfs.c @@ -261,8 +261,6 @@ int main(int argc, char **argv) { const struct cmd_struct *cmd; - crc32c_optimization_init(); - argc--; argv++; handle_options(&argc, &argv); @@ -278,6 +276,8 @@ int main(int argc, char **argv) handle_help_options_next_level(cmd, argc, argv); + crc32c_optimization_init(); + fixup_argv0(argv, cmd->token); exit(cmd->fn(argc, argv)); }