From patchwork Fri Mar 18 15:28:25 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Sterba X-Patchwork-Id: 644211 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2IFSwP3018718 for ; Fri, 18 Mar 2011 15:28:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756859Ab1CRP24 (ORCPT ); Fri, 18 Mar 2011 11:28:56 -0400 Received: from cantor.suse.de ([195.135.220.2]:53126 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756801Ab1CRP24 (ORCPT ); Fri, 18 Mar 2011 11:28:56 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 323B88FEA2; Fri, 18 Mar 2011 16:28:55 +0100 (CET) Received: by ds.suse.cz (Postfix, from userid 10065) id B3A92747D5; Fri, 18 Mar 2011 16:28:54 +0100 (CET) From: David Sterba To: chris.mason@oracle.com Cc: linux-btrfs@vger.kernel.org, adrien.dessemond@gmail.com, David Sterba Subject: [PATCH] btrfs: properly access unaligned checksum buffer Date: Fri, 18 Mar 2011 16:28:25 +0100 Message-Id: <1300462105-30680-1-git-send-email-dsterba@suse.cz> X-Mailer: git-send-email 1.7.4.1.176.g501cc Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 18 Mar 2011 15:28:59 +0000 (UTC) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index e1aa8d6..8065863 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -198,7 +198,11 @@ u32 btrfs_csum_data(struct btrfs_root *root, char *data, u32 seed, size_t len) void btrfs_csum_final(u32 crc, char *result) { +#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS *(__le32 *)result = ~cpu_to_le32(crc); +#else + put_unaligned_le32(~crc, result); +#endif } /*