From patchwork Thu Jan 12 14:00: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: 9513291 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 6F7A260762 for ; Thu, 12 Jan 2017 14:02:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B15B2868C for ; Thu, 12 Jan 2017 14:02:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4FCF3286D9; Thu, 12 Jan 2017 14:02:19 +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 42B802868C for ; Thu, 12 Jan 2017 14:02:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751168AbdALOCC (ORCPT ); Thu, 12 Jan 2017 09:02:02 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35586 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750893AbdALOBD (ORCPT ); Thu, 12 Jan 2017 09:01:03 -0500 Received: by mail-wm0-f65.google.com with SMTP id l2so3918652wml.2 for ; Thu, 12 Jan 2017 06:01:03 -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=mgneZMlgZ3zvrfcokhb79PnzOn5NYn+CyHZ9sli5Q4Y=; b=GrKbguUglnxgvwVE9tlmH0OZanr6Rh6/GQwdB6i24yEYMsAJKFSBZsaPUbsi1MKYCS eQX5ydz14ORinHk9VSE3AvTfsF8S7fR1Kj/WHH4n2Am06NX7TxQ24RVARUNChc4yZDVD B8ZsWMbLzfZiYlpTIprjNmxl5mk88wnlyR7cNwU9HAFd5KTakOugjYrSsrhyn5Cko0r3 Nz+r0mJzamzVsNVmA477wJn6DImCUUQrDUzfmo4hX12XegBdfEBXA7ZY8S4kLvBjF0Hp YAixs0x/+LfUxr9P7PO1eGO7zN5PVEoXzRx4xcwsDkB6ZmmyxWCTDgkCebBXX1sAWa7N cL1A== 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=mgneZMlgZ3zvrfcokhb79PnzOn5NYn+CyHZ9sli5Q4Y=; b=IbhqFwHX8Fo8EwOp6EcdzfrzfmyrkJ9LsP5MsaciJppEe7w/2nUAAYLz2cgyKDvWD4 97XE3kNbVshb7/UerL0yw1Ix976HgVtPNA6DaFcM3t4uNTvB2ORzq6fuoPhs6mvmGtKV i9+HWdJRi7hbMeIo2dAhtg/wm+w5agsLq4m6wmZ/jyEEDwoQ1snWE4FIVUwR5zm11i/5 Q0kL5/fz+rgnUFMWuALFr6UpqtBGsqfo8a+qRFY83vuTrlu0lMM72zENT+oUYpeB5Q8h GuUXU3A8h2HkyPavsEfsCzeDicgoSA0dIpWNXk6mSjUIwggEEkiWftkVkT4zPb4f+Cpg OULg== X-Gm-Message-State: AIkVDXLPhf48Jzzs5VNU7uOoRaGAIxdPJeN/Jp8Vo0cW0nr6XZ3x/Q+PabJtKSd6JbQb+w== X-Received: by 10.194.179.166 with SMTP id dh6mr8722359wjc.187.1484229661009; Thu, 12 Jan 2017 06:01:01 -0800 (PST) Received: from fisk.lan (ivokamhome.ddns.nbis.net. [87.120.136.31]) by smtp.gmail.com with ESMTPSA id y145sm725670wmc.17.2017.01.12.06.01.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Jan 2017 06:01:00 -0800 (PST) From: Nikolay Borisov To: dsterba@suse.com Cc: linux-btrfs@vger.kernel.org, Nikolay Borisov Subject: [PATCH 06/24] btrfs: Make btrfs_del_dir_entries_in_log take btrfs_inode Date: Thu, 12 Jan 2017 16:00:32 +0200 Message-Id: <1484229650-24554-7-git-send-email-n.borisov.lkml@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484229650-24554-1-git-send-email-n.borisov.lkml@gmail.com> References: <1484229650-24554-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 131669ca1f07..7d441931fc1e 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 f37194700f3a..904f12b5ec72 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -3083,7 +3083,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; @@ -3091,16 +3091,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(); @@ -3175,7 +3175,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,