From patchwork Wed Jan 29 21:06:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Filipe Manana X-Patchwork-Id: 3554671 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id ADAFAC02DC for ; Wed, 29 Jan 2014 21:06:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8C864201B4 for ; Wed, 29 Jan 2014 21:06:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A1587200E1 for ; Wed, 29 Jan 2014 21:06:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751532AbaA2VGR (ORCPT ); Wed, 29 Jan 2014 16:06:17 -0500 Received: from mail-wg0-f50.google.com ([74.125.82.50]:47112 "EHLO mail-wg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750851AbaA2VGQ (ORCPT ); Wed, 29 Jan 2014 16:06:16 -0500 Received: by mail-wg0-f50.google.com with SMTP id l18so4723477wgh.5 for ; Wed, 29 Jan 2014 13:06:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=Ox+zHKecrs7jVG6HiRIzFA0rxyskA2PaeZjiVNmb6MY=; b=vX4O2pYFcWTmIhli2VbX4T5HR51VXecRBCl2jjpHdNbh0ZrF6Iwq9Je9P3wqaUXHwp KROyfw6fyHOKSVgqhxEN+1GKwJvNiJ32+4amhFLbdOCF2MHBeOwjYHSP/sjmIyjJzxPk bcIT3wwn4x/tFANrSzMRRMrqftG82LL9WlPepYEzWDSEmvXOn+dSlyQZHtYM+RPeXC9R TD3MHWCEAAvPG6LbPqtJxs5P87p+UwEhOw/lte2UkM7prvYQZOsNeXzUc9DJZOOhgppU F+9QmBe07BB8EYtNFLJ642KvufMRajyi91BanrxforiR9guhhsjTQABEwxTtLom8pJzO ryTw== X-Received: by 10.194.87.5 with SMTP id t5mr60399wjz.68.1391029575296; Wed, 29 Jan 2014 13:06:15 -0800 (PST) Received: from storm-desktop.lan (bl10-140-184.dsl.telepac.pt. [85.243.140.184]) by mx.google.com with ESMTPSA id y13sm7426400wjr.8.2014.01.29.13.06.14 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 29 Jan 2014 13:06:14 -0800 (PST) From: Filipe David Borba Manana To: linux-btrfs@vger.kernel.org Cc: jbacik@fb.com, clm@fb.com, Filipe David Borba Manana Subject: [PATCH] Btrfs: use btrfs_crc32c everywhere instead of libcrc32c Date: Wed, 29 Jan 2014 21:06:04 +0000 Message-Id: <1391029564-24160-1-git-send-email-fdmanana@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP After the commit titled "Btrfs: fix btrfs boot when compiled as built-in", LIBCRC32C requirement was removed from btrfs' Kconfig. This made it not possible to build a kernel with btrfs enabled (either as module or built-in) if libcrc32c is not enabled as well. So just replace all uses of libcrc32c with the equivalent function in btrfs hash.h - btrfs_crc32c. Signed-off-by: Filipe David Borba Manana --- fs/btrfs/check-integrity.c | 4 ++-- fs/btrfs/disk-io.c | 4 ++-- fs/btrfs/send.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c index 160fb50..39bfd56 100644 --- a/fs/btrfs/check-integrity.c +++ b/fs/btrfs/check-integrity.c @@ -92,11 +92,11 @@ #include #include #include -#include #include #include #include "ctree.h" #include "disk-io.h" +#include "hash.h" #include "transaction.h" #include "extent_io.h" #include "volumes.h" @@ -1823,7 +1823,7 @@ static int btrfsic_test_for_metadata(struct btrfsic_state *state, size_t sublen = i ? PAGE_CACHE_SIZE : (PAGE_CACHE_SIZE - BTRFS_CSUM_SIZE); - crc = crc32c(crc, data, sublen); + crc = btrfs_crc32c(crc, data, sublen); } btrfs_csum_final(crc, csum); if (memcmp(csum, h->csum, state->csum_size)) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 7619147..3903bd3 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -35,6 +34,7 @@ #include #include "ctree.h" #include "disk-io.h" +#include "hash.h" #include "transaction.h" #include "btrfs_inode.h" #include "volumes.h" @@ -244,7 +244,7 @@ out: u32 btrfs_csum_data(char *data, u32 seed, size_t len) { - return crc32c(seed, data, len); + return btrfs_crc32c(seed, data, len); } void btrfs_csum_final(u32 crc, char *result) diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 04c07ed..31b76d0 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -24,12 +24,12 @@ #include #include #include -#include #include #include #include "send.h" #include "backref.h" +#include "hash.h" #include "locking.h" #include "disk-io.h" #include "btrfs_inode.h" @@ -620,7 +620,7 @@ static int send_cmd(struct send_ctx *sctx) hdr->len = cpu_to_le32(sctx->send_size - sizeof(*hdr)); hdr->crc = 0; - crc = crc32c(0, (unsigned char *)sctx->send_buf, sctx->send_size); + crc = btrfs_crc32c(0, (unsigned char *)sctx->send_buf, sctx->send_size); hdr->crc = cpu_to_le32(crc); ret = write_buf(sctx->send_filp, sctx->send_buf, sctx->send_size,