From patchwork Fri Feb 17 14:43:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 9580009 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 5348F600F6 for ; Fri, 17 Feb 2017 14:45:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4359B286F3 for ; Fri, 17 Feb 2017 14:45:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 38365286F5; Fri, 17 Feb 2017 14:45:06 +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 7BE0E286F3 for ; Fri, 17 Feb 2017 14:45:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934466AbdBQOpB (ORCPT ); Fri, 17 Feb 2017 09:45:01 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:36565 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934320AbdBQOoN (ORCPT ); Fri, 17 Feb 2017 09:44:13 -0500 Received: by mail-wr0-f196.google.com with SMTP id z61so4717741wrc.3 for ; Fri, 17 Feb 2017 06:44:08 -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=5zVNtciVCCQPthTHIS+vUdw+qmC4hzMWcCwDrL7xbps=; b=C7A/TNtmk4Y/Q53qEDfUlrNNecq64PTehyieU3c/3Bw2q6NlvXADeYigQgAFR6blDu JHJWXxBGH5J+ldrrqu+m9LTEt5JttAg/NQRge54pbUeH0XBbqr1ibFJcz331Ib9u2c9n Evlpx4gcEa+IP6h3jvVmggeo6nI4Fl4vBcYbxAyWO2oWBaFRn3CxbY397FIuBuMRkOf5 Tfn1iAEhT74+bWJI7XJB6pGSwvcHC0MksE5/dclvc6HFR8dtA05iK8icBtI0PW1WsGJG eiAwWF5m5Vsj7pKBYwya7F2/i7hBol4lw2QROszCgXQavCr1+W68e6RF/rmh/QvizK0Q ODBQ== 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=5zVNtciVCCQPthTHIS+vUdw+qmC4hzMWcCwDrL7xbps=; b=EfI6+eiuyYOcCWg6lyVhMY3UEHQAtC9QkBB3jv+rVs0x2OJDIPm7Byruuv1zLt2MA9 Wrb/7FOlm+AICBPnso/kJbtlYSAmqzIoMAC7TkYW6V8r+WgTKVvpE5A9fZtBv9fKJCKw Atu/RC94YrmfWLYm8Cqos2yIAwn2wsqCXPKZF5tRdU3nlnQp6U4DC/thpEKsb0r2AFm/ ghHsh73zNFfetlVhlROQlBYQlMRbEVGKFclhMAFVPMAs4ISHGyA6kcTtXaNZH46hXxh8 X4RZcULCWbOiaksPjxl0dm9IG03/ksZnC7SB3/jl6k9m3D9d+tPVILSkDy1R6JVS/s+X Z4CQ== X-Gm-Message-State: AMke39kGSBkHj3socog/+BVtGAEzg+Pi7c3jSfpUh0vegqI02FmpwAGb/RAZMxoQ49n51Q== X-Received: by 10.223.161.194 with SMTP id v2mr6382440wrv.144.1487342642308; Fri, 17 Feb 2017 06:44:02 -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.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Feb 2017 06:44:01 -0800 (PST) From: Nikolay Borisov X-Google-Original-From: Nikolay Borisov To: dsterba@suse.com Cc: linux-btrfs@vger.kernel.org, Nikolay Borisov , Nikolay Borisov Subject: [PATCH 15/38] btrfs: Make btrfs_requeue_inode_defrag take btrfs_inode Date: Fri, 17 Feb 2017 16:43:06 +0200 Message-Id: <1487342609-20652-16-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 From: Nikolay Borisov Signed-off-by: Nikolay Borisov --- fs/btrfs/file.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 26ebb7608b92..18edcc74150c 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -194,10 +194,10 @@ int btrfs_add_inode_defrag(struct btrfs_trans_handle *trans, * the same inode in the tree, we will merge them together (by * __btrfs_add_inode_defrag()) and free the one that we want to requeue. */ -static void btrfs_requeue_inode_defrag(struct inode *inode, +static void btrfs_requeue_inode_defrag(struct btrfs_inode *inode, struct inode_defrag *defrag) { - struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); + struct btrfs_fs_info *fs_info = btrfs_sb(inode->vfs_inode.i_sb); int ret; if (!__need_auto_defrag(fs_info)) @@ -208,7 +208,7 @@ static void btrfs_requeue_inode_defrag(struct inode *inode, * them together. */ spin_lock(&fs_info->defrag_inodes_lock); - ret = __btrfs_add_inode_defrag(BTRFS_I(inode), defrag); + ret = __btrfs_add_inode_defrag(inode, defrag); spin_unlock(&fs_info->defrag_inodes_lock); if (ret) goto out; @@ -334,7 +334,7 @@ static int __btrfs_run_defrag_inode(struct btrfs_fs_info *fs_info, */ if (num_defrag == BTRFS_DEFRAG_BATCH) { defrag->last_offset = range.start; - btrfs_requeue_inode_defrag(inode, defrag); + btrfs_requeue_inode_defrag(BTRFS_I(inode), defrag); } else if (defrag->last_offset && !defrag->cycled) { /* * we didn't fill our defrag batch, but @@ -343,7 +343,7 @@ static int __btrfs_run_defrag_inode(struct btrfs_fs_info *fs_info, */ defrag->last_offset = 0; defrag->cycled = 1; - btrfs_requeue_inode_defrag(inode, defrag); + btrfs_requeue_inode_defrag(BTRFS_I(inode), defrag); } else { kmem_cache_free(btrfs_inode_defrag_cachep, defrag); }