From patchwork Fri Feb 17 14:43:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 9579985 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 24C26600F6 for ; Fri, 17 Feb 2017 14:44:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 152E5286F3 for ; Fri, 17 Feb 2017 14:44:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A6D0286F7; Fri, 17 Feb 2017 14:44:31 +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 ADC5D286F3 for ; Fri, 17 Feb 2017 14:44:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934382AbdBQOo0 (ORCPT ); Fri, 17 Feb 2017 09:44:26 -0500 Received: from mail-wr0-f194.google.com ([209.85.128.194]:33765 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934558AbdBQOoX (ORCPT ); Fri, 17 Feb 2017 09:44:23 -0500 Received: by mail-wr0-f194.google.com with SMTP id i10so5521093wrb.0 for ; Fri, 17 Feb 2017 06:44:23 -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=g+fi8pWL1n84Vgm1WNgdtQ8OSWXYbSfeRCylz7dqCE8=; b=O8LyaWAwnnlYglCES5SPqFNJuuYttK1neoIzvoQmO7dUDQRTzyzl2+fyiQCL/ImwJ4 JrITlmtygSz4YjfoE+nZdbx47kzNframVHKX0+Db0tTRHzmEzKknus+yHIWeASLB1oeM QaTAEoNCHxoK8rLaWNI7Ul0TkMaCzAxs/zoRk8GJ5lK7nHd4Xpw4Q98nD5wul4zu5+M/ OhJtw9K1dIOfipZQNrMemurYn/c74hGqnlVJhE93hqm76Egi32x438c7kIZwc92uBDNT 3yUOvx26qOFSVWUQb/icIBLuBe5MczujEIKL7xbwGRVfLLmk6gh1LtEVnnEjGCkxUzn5 axxw== 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=g+fi8pWL1n84Vgm1WNgdtQ8OSWXYbSfeRCylz7dqCE8=; b=J/3bQUyRBWKkElzlxyCOpeukJm0p+nUw+c6WMnVEf0nBGgtJ8EznmiT4TADD5pDfIn LDS6vqRqstWci2G9tNwX0Mgp7ifK9INE9nI6MZihY2pvFUezOz0ss5vGv08YDtxYjT0b j3MxzVT7Pe6m2rvWoQ7RlU07jTC3wRSRlFKZ3LGGVMAVQq/7vuXZVWdi964aSB24NIYM X4JO+lWIPhZ4DdcdZYyIqIQzyY1RiCM5G70oM6AKMfm4FOSMSmeVCsx3N13PMKqlDFMr Z7cKrRFcxAMhActu4bYGqpzt59/gcX2aNmUPIRIBrbymdEPFpmMdVQGyx51vfOatEJX5 y87A== X-Gm-Message-State: AMke39mY40gFNp7sNq7wg6LUeFZjbL3jnFzxIZcaBkLmWBPwgRctBbLMaE6K5IRY6Z9MKw== X-Received: by 10.28.135.82 with SMTP id j79mr3859031wmd.19.1487342662392; Fri, 17 Feb 2017 06:44:22 -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.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Feb 2017 06:44:21 -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 36/38] btrfs: Make check_extent_to_block take btrfs_inode Date: Fri, 17 Feb 2017 16:43:27 +0200 Message-Id: <1487342609-20652-37-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/scrub.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index bdf58b0eaef8..9a747ed9116d 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -4236,7 +4236,7 @@ static void copy_nocow_pages_worker(struct btrfs_work *work) scrub_pending_trans_workers_dec(sctx); } -static int check_extent_to_block(struct inode *inode, u64 start, u64 len, +static int check_extent_to_block(struct btrfs_inode *inode, u64 start, u64 len, u64 logical) { struct extent_state *cached_state = NULL; @@ -4246,10 +4246,10 @@ static int check_extent_to_block(struct inode *inode, u64 start, u64 len, u64 lockstart = start, lockend = start + len - 1; int ret = 0; - io_tree = &BTRFS_I(inode)->io_tree; + io_tree = &inode->io_tree; lock_extent_bits(io_tree, lockstart, lockend, &cached_state); - ordered = btrfs_lookup_ordered_range(BTRFS_I(inode), lockstart, len); + ordered = btrfs_lookup_ordered_range(inode, lockstart, len); if (ordered) { btrfs_put_ordered_extent(ordered); ret = 1; @@ -4325,7 +4325,7 @@ static int copy_nocow_pages_for_inode(u64 inum, u64 offset, u64 root, io_tree = &BTRFS_I(inode)->io_tree; nocow_ctx_logical = nocow_ctx->logical; - ret = check_extent_to_block(inode, offset, len, nocow_ctx_logical); + ret = check_extent_to_block(BTRFS_I(inode), offset, len, nocow_ctx_logical); if (ret) { ret = ret > 0 ? 0 : ret; goto out; @@ -4372,7 +4372,7 @@ static int copy_nocow_pages_for_inode(u64 inum, u64 offset, u64 root, } } - ret = check_extent_to_block(inode, offset, len, + ret = check_extent_to_block(BTRFS_I(inode), offset, len, nocow_ctx_logical); if (ret) { ret = ret > 0 ? 0 : ret;