From patchwork Fri Feb 17 14:43:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 9580007 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8E232600F6 for ; Fri, 17 Feb 2017 14:45:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E1D6286F4 for ; Fri, 17 Feb 2017 14:45:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7129D286F5; Fri, 17 Feb 2017 14:45:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E486B286F3 for ; Fri, 17 Feb 2017 14:45:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934539AbdBQOpC (ORCPT ); Fri, 17 Feb 2017 09:45:02 -0500 Received: from mail-wr0-f193.google.com ([209.85.128.193]:35112 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934530AbdBQOoN (ORCPT ); Fri, 17 Feb 2017 09:44:13 -0500 Received: by mail-wr0-f193.google.com with SMTP id q39so5487494wrb.2 for ; Fri, 17 Feb 2017 06:44:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fzMeOSgdrad1HLoJ0bYGxBdG0C4/5BJbZsJAKn/PBAc=; b=lLDI5V6NmkjnGU3Xp+z/hUZaCXg2hIIi7BRwNWI9uf6QBTmos/4ZN3AHx3AZ83sXbv VSWMaSwdqSXazrrhzseUmnmaOV0qx3XntpULH2002hINJgTpVEnn5+EQ4rHv3WnChr9S 5Y7EXP/bQAr/Nf2c4UZpeYuw4uHq6spjVeKvFqDBsmZwYnuKwfJFbzf2R3R++IZWXXBH AnFtrKlbv7GNqMAq94ER0eW0ypsp6v6QtWLyUW0VVFs1z5cTVCqex9lGbBBtkp/CcFYx 7QWPWzfPTO1TxQ9QmeEY2D/jYtuNuoHS3RD2mvyI18g2F5SuxjLl5JamZN/+KX2xQ9Lb r+zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=fzMeOSgdrad1HLoJ0bYGxBdG0C4/5BJbZsJAKn/PBAc=; b=c9B/k0G2+0u2gocMUrq4jt/wu79HM1Rp6Df9eYwEkS8wYOM/9msm39zFJWd4xlqkr6 bZczS5CE0Xw1UleJPAyneddiWrK/gq2j6MTH+Vm+rsgzb+1C9z7p5h5r8pE1YM7KilwM A68L+7qVFqpdnozvedOQvfrh8LNwmi5bv0SAlrVAbRUgT3Gap8doYTl4Qt3pN93gtQ0a Nsu8CQepd+e352dwo3XvSHba9b4eBi96HeDBLcG3eWhyctladF1kSPtQDQmVX/s+AhFL X3Qfwa4pdUTJ1X3v2lzui6PBx+kiC3M4Ri0JygkVPzdduWJcKKiGv2dN63OIlawENLWl vU8g== X-Gm-Message-State: AMke39k5GRcWmBIKt88q9XtvW1RcMotgFBtWaf0NzCln0JTkFuA3KOFkg2ecvpPMDQPB3g== X-Received: by 10.223.173.40 with SMTP id p37mr7205997wrc.136.1487342651871; Fri, 17 Feb 2017 06:44:11 -0800 (PST) Received: from fisk.suse.de (ivokamhome.ddns.nbis.net. [87.120.136.31]) by smtp.gmail.com with ESMTPSA id y126sm1932713wmg.19.2017.02.17.06.44.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Feb 2017 06:44:11 -0800 (PST) From: Nikolay Borisov X-Google-Original-From: Nikolay Borisov To: dsterba@suse.com Cc: linux-btrfs@vger.kernel.org, Nikolay Borisov Subject: [PATCH 25/38] btrfs: make check_compressed_csum take btrfs_inode Date: Fri, 17 Feb 2017 16:43:16 +0200 Message-Id: <1487342609-20652-26-git-send-email-nborisov@suse.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487342609-20652-1-git-send-email-nborisov@suse.com> References: <1487342609-20652-1-git-send-email-nborisov@suse.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Nikolay Borisov --- fs/btrfs/compression.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index b8de71abfbd3..9f5e2e222e2a 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c @@ -100,7 +100,7 @@ static struct bio *compressed_bio_alloc(struct block_device *bdev, return btrfs_bio_alloc(bdev, first_byte >> 9, BIO_MAX_PAGES, gfp_flags); } -static int check_compressed_csum(struct inode *inode, +static int check_compressed_csum(struct btrfs_inode *inode, struct compressed_bio *cb, u64 disk_start) { @@ -111,7 +111,7 @@ static int check_compressed_csum(struct inode *inode, u32 csum; u32 *cb_sum = &cb->sums; - if (BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM) + if (inode->flags & BTRFS_INODE_NODATASUM) return 0; for (i = 0; i < cb->nr_pages; i++) { @@ -124,8 +124,8 @@ static int check_compressed_csum(struct inode *inode, kunmap_atomic(kaddr); if (csum != *cb_sum) { - btrfs_print_data_csum_error(BTRFS_I(inode), disk_start, csum, - *cb_sum, cb->mirror_num); + btrfs_print_data_csum_error(inode, disk_start, csum, *cb_sum, + cb->mirror_num); ret = -EIO; goto fail; } @@ -165,7 +165,7 @@ static void end_compressed_bio_read(struct bio *bio) goto out; inode = cb->inode; - ret = check_compressed_csum(inode, cb, + ret = check_compressed_csum(BTRFS_I(inode), cb, (u64)bio->bi_iter.bi_sector << 9); if (ret) goto csum_failed;