From patchwork Tue Jan 17 22:31:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 9522067 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 0AE126020B for ; Tue, 17 Jan 2017 22:42:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F3E70285A2 for ; Tue, 17 Jan 2017 22:42:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E71A028602; Tue, 17 Jan 2017 22:42:21 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, 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 6D26A285A2 for ; Tue, 17 Jan 2017 22:42:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751352AbdAQWmT (ORCPT ); Tue, 17 Jan 2017 17:42:19 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:33285 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751045AbdAQWmS (ORCPT ); Tue, 17 Jan 2017 17:42:18 -0500 Received: by mail-wm0-f65.google.com with SMTP id r144so41979119wme.0 for ; Tue, 17 Jan 2017 14:42:18 -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=kRtbVKYiG+xaN/5X5oQgkhJPMadOe8azYpOuiMxUye4=; b=N/RO/uDzgUJk1D2kuoLkhU+ZNYBdR7txjtORLMtN8GjJaOCLZRc1j/tdi+PLjggk81 3N50NCV9HSRJVBxGkh+MrABwXgBHrW5cX5D553NJWjSB6TnAhagj1f+2AXWl7p1keImF +uduZKF3QYDmjKxYbNmvE2CptcCvmsHgyw1zF+rZK7+kELvWtNtZ2Cd6MOmzvuif44E2 o8DzS6R8SXXcmptWRnPRB2StcCzX0HLACd7hVMTjam9YljBSGccApW0UeRdsWc7GUEdQ dax4kXMPF4Fna7j09jNlHXo7zEdr0btuDZbyzqpUTnPR5U2blCdc5SNAnQALBGlH2irq RYuQ== 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=kRtbVKYiG+xaN/5X5oQgkhJPMadOe8azYpOuiMxUye4=; b=b9CMlt280vRTi804V4o6W5zXTYhmOl+NLZGD13kXgeEJ6Azt1Y964BaMPniyLGkGog ZE1a8p5BHiw0Wh/ju8vedxDmPQg0ArUqeznmW8WSxBxl2sbBOuXgPooajMh06VJCR8Y3 ucVEvJ9lkkvsYCVOpHzP7EchumUAdkewR2V1mrKLB4r6/eAs5xptefVeO1jUOYvRFVWO L4Jc9J069nh1rCuHOUNoZXyn/IXN7YtjD/qafiJ0dLrQtfFWReQK2DKUvJFYeoPR9BHj uq0O1W06f6rLZXEK8s86oIUpR1Wt3zMESyA1QqV2ALkUHLR3AuxVrlGRUuClURHPIXaV fcsQ== X-Gm-Message-State: AIkVDXLp/YpwGYlzForpEYCwCOxfc6cq6K6K2JVnPLK2ZHxmXLOfWeomTQWDu6pya7YmCw== X-Received: by 10.223.163.75 with SMTP id d11mr10326914wrb.87.1484692330359; Tue, 17 Jan 2017 14:32:10 -0800 (PST) Received: from fisk.lan (ivokamhome.ddns.nbis.net. [87.120.136.31]) by smtp.gmail.com with ESMTPSA id w197sm39980489wmd.11.2017.01.17.14.32.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jan 2017 14:32:09 -0800 (PST) From: Nikolay Borisov To: dsterba@suse.cz Cc: linux-btrfs@vger.kernel.org, Nikolay Borisov Subject: [PATCHv2 06/24] btrfs: Make btrfs_del_dir_entries_in_log take btrfs_inode Date: Wed, 18 Jan 2017 00:31:32 +0200 Message-Id: <1484692310-3987-7-git-send-email-n.borisov.lkml@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484692310-3987-1-git-send-email-n.borisov.lkml@gmail.com> References: <20170117161550.GW12081@twin.jikos.cz> <1484692310-3987-1-git-send-email-n.borisov.lkml@gmail.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/inode.c | 2 +- fs/btrfs/tree-log.c | 10 +++++----- fs/btrfs/tree-log.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 41b1e2ed63b4..ebfeabafe1b1 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -4075,7 +4075,7 @@ static int __btrfs_unlink_inode(struct btrfs_trans_handle *trans, } ret = btrfs_del_dir_entries_in_log(trans, root, name, name_len, - dir, index); + BTRFS_I(dir), index); if (ret == -ENOENT) ret = 0; else if (ret) diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index df822908f2be..caa8d886b4ae 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -3084,7 +3084,7 @@ int btrfs_free_log_root_tree(struct btrfs_trans_handle *trans, int btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans, struct btrfs_root *root, const char *name, int name_len, - struct inode *dir, u64 index) + struct btrfs_inode *dir, u64 index) { struct btrfs_root *log; struct btrfs_dir_item *di; @@ -3092,16 +3092,16 @@ int btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans, int ret; int err = 0; int bytes_del = 0; - u64 dir_ino = btrfs_ino(BTRFS_I(dir)); + u64 dir_ino = btrfs_ino(dir); - if (BTRFS_I(dir)->logged_trans < trans->transid) + if (dir->logged_trans < trans->transid) return 0; ret = join_running_log_trans(root); if (ret) return 0; - mutex_lock(&BTRFS_I(dir)->log_mutex); + mutex_lock(&dir->log_mutex); log = root->log_root; path = btrfs_alloc_path(); @@ -3176,7 +3176,7 @@ int btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans, fail: btrfs_free_path(path); out_unlock: - mutex_unlock(&BTRFS_I(dir)->log_mutex); + mutex_unlock(&dir->log_mutex); if (ret == -ENOSPC) { btrfs_set_log_full_commit(root->fs_info, trans); ret = 0; diff --git a/fs/btrfs/tree-log.h b/fs/btrfs/tree-log.h index 2bcbac7efa9c..6c2b316b28e0 100644 --- a/fs/btrfs/tree-log.h +++ b/fs/btrfs/tree-log.h @@ -72,7 +72,7 @@ int btrfs_log_dentry_safe(struct btrfs_trans_handle *trans, int btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans, struct btrfs_root *root, const char *name, int name_len, - struct inode *dir, u64 index); + struct btrfs_inode *dir, u64 index); int btrfs_del_inode_ref_in_log(struct btrfs_trans_handle *trans, struct btrfs_root *root, const char *name, int name_len,