From patchwork Thu Jan 12 14:00:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 9513293 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 70E0860710 for ; Thu, 12 Jan 2017 14:02:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D840286B9 for ; Thu, 12 Jan 2017 14:02:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5237F286D9; Thu, 12 Jan 2017 14:02:18 +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 D8B7A286B9 for ; Thu, 12 Jan 2017 14:02:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751178AbdALOCE (ORCPT ); Thu, 12 Jan 2017 09:02:04 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:34025 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750887AbdALOBD (ORCPT ); Thu, 12 Jan 2017 09:01:03 -0500 Received: by mail-wm0-f67.google.com with SMTP id c85so3881230wmi.1 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=UEQgQGpCiXwjHkzcFAw23qB1xS99pa1q4mNIzmlMzC4=; b=lLLVsE1AvhLp+qSzF4WRJb29PnixyNBa9uX5m5JP2W652kofGArs8g/UY1VjQVey4E BleEcND4zy76kyq2ZJyXarst1xIhAkHF1zt6MM4nEcQZv/FoaN20Oanr+BYzwrxy3RBp wZyikUhFam8HYiYntU89w/8TDRzsY1u1y104A8WspeOW5fqqvewfHLY4Q6Xs5jv0x28S nmgRoZjidP+5w595UnfKH+xCXwyOJY9zFQSxYMmZ8QEVLEaxstpAvUz+05dol9yiHhcp HwLpZNSVwpamEeaUPKDyHxlHKiRCzKFDl5UKlQPgR/Xb1Dxav60hERfx6QGHkc+wN+5v ULrg== 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=UEQgQGpCiXwjHkzcFAw23qB1xS99pa1q4mNIzmlMzC4=; b=ENjnFd2TS64NViF6HooAuvSn8MvzDKF0V4f3VpDywJ16nZggPAYVRxLdw+vJ0lQqfb usrgjqWecKAE+AzsUnyh4E6g+tDSUL6dhU/Yi+Cd2YDRbJW9eiqZEwLi7/0Qa2/F3SVl hjDqGMd6x9mKfrSfz0IVQ/crjvhdixgpBQJ+alQELolom418ahbm8d8V44j6G9MUojVf 8LooA9O3bXMZIq+sC659EyJxrMZ8Dha9REgik/CLRJFwOVQW8YHw1etfqZavPTTTHyB/ m46Oox9FNLOD+YU7eW2PJ5Hy6rB8Z2Az4GLMb2fewchcfMpYKwzcTU2PEZDPWEi1Ref1 LEOw== X-Gm-Message-State: AIkVDXKicCOsuwKLOdhxmIfH1dhq51jW/DvN5b2riHsqcmMG920ex96VP/OoOIxLR6AptQ== X-Received: by 10.223.171.65 with SMTP id r1mr8247412wrc.123.1484229662163; Thu, 12 Jan 2017 06:01:02 -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.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Jan 2017 06:01:01 -0800 (PST) From: Nikolay Borisov To: dsterba@suse.com Cc: linux-btrfs@vger.kernel.org, Nikolay Borisov Subject: [PATCH 07/24] btrfs: Make btrfs_del_inode_ref take btrfs_inode Date: Thu, 12 Jan 2017 16:00:33 +0200 Message-Id: <1484229650-24554-8-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 7d441931fc1e..9693f83cfc4b 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -4068,7 +4068,7 @@ static int __btrfs_unlink_inode(struct btrfs_trans_handle *trans, } ret = btrfs_del_inode_ref_in_log(trans, root, name, name_len, - inode, dir_ino); + BTRFS_I(inode), dir_ino); if (ret != 0 && ret != -ENOENT) { btrfs_abort_transaction(trans, ret); goto err; diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 904f12b5ec72..ffe9aad04be5 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -3191,25 +3191,25 @@ int btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans, int btrfs_del_inode_ref_in_log(struct btrfs_trans_handle *trans, struct btrfs_root *root, const char *name, int name_len, - struct inode *inode, u64 dirid) + struct btrfs_inode *inode, u64 dirid) { struct btrfs_fs_info *fs_info = root->fs_info; struct btrfs_root *log; u64 index; int ret; - if (BTRFS_I(inode)->logged_trans < trans->transid) + if (inode->logged_trans < trans->transid) return 0; ret = join_running_log_trans(root); if (ret) return 0; log = root->log_root; - mutex_lock(&BTRFS_I(inode)->log_mutex); + mutex_lock(&inode->log_mutex); - ret = btrfs_del_inode_ref(trans, log, name, name_len, btrfs_ino(BTRFS_I(inode)), + ret = btrfs_del_inode_ref(trans, log, name, name_len, btrfs_ino(inode), dirid, &index); - mutex_unlock(&BTRFS_I(inode)->log_mutex); + mutex_unlock(&inode->log_mutex); if (ret == -ENOSPC) { btrfs_set_log_full_commit(fs_info, trans); ret = 0; diff --git a/fs/btrfs/tree-log.h b/fs/btrfs/tree-log.h index 6c2b316b28e0..bc50f128c6be 100644 --- a/fs/btrfs/tree-log.h +++ b/fs/btrfs/tree-log.h @@ -76,7 +76,7 @@ int btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans, int btrfs_del_inode_ref_in_log(struct btrfs_trans_handle *trans, struct btrfs_root *root, const char *name, int name_len, - struct inode *inode, u64 dirid); + struct btrfs_inode *inode, u64 dirid); void btrfs_end_log_trans(struct btrfs_root *root); int btrfs_pin_log_trans(struct btrfs_root *root); void btrfs_record_unlink_dir(struct btrfs_trans_handle *trans,