From patchwork Thu Jan 12 14:00: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: 9513247 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 F22B660710 for ; Thu, 12 Jan 2017 14:01:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E25E2286B9 for ; Thu, 12 Jan 2017 14:01:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D74CE286D9; Thu, 12 Jan 2017 14:01:01 +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 6BD09286D5 for ; Thu, 12 Jan 2017 14:01:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750849AbdALOA7 (ORCPT ); Thu, 12 Jan 2017 09:00:59 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:36332 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750761AbdALOA6 (ORCPT ); Thu, 12 Jan 2017 09:00:58 -0500 Received: by mail-lf0-f67.google.com with SMTP id h65so1924419lfi.3 for ; Thu, 12 Jan 2017 06:00:57 -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=4IFB+YmhhY0yAn1GAJMJ0w+6u/L9kuN2yocFgUez4c8=; b=oOia3V31StBPrvGEHGcLQfpxfrmLNsG5wkRHMF8aC1rk8uW4exi7c2tdKNUBgkfyWZ dkFNErz6kc2MGng4R84JXDswbnxovK9q8qOItNWVyYMTx+PJ1pyh5P4TWx0V0892i3sg XtADig4914746x4oRdVAL7NeIEftG9fxyfxB7Zc55vXuaB66SDB3kcsUWmO+iXMY2h6S ryZff7N3iiZvO3DOIdUwhXvVceq9Ryi15ajuD1WXeyrGgDGTeBDp+7iED2Sn15b1HMBC Ge9A79GzW5Ahkjfum/d83djsuLgmEozbA7MoXsuIoAEF5nVleSWo+UvhVeGR7zQY0lUU V5pg== 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=4IFB+YmhhY0yAn1GAJMJ0w+6u/L9kuN2yocFgUez4c8=; b=kfd3tcSeEn259lNZS7Ag/0y/uSUpqTxdks5j8xdnCNR+PLSE4FaqKjrFMpQNYk67A9 JmJUv3Y1UX0dS419tcLc9DOQi4EYAKnPU8jUyp58Rm2rXBjJE5A/bTKrMfdHsKxWz9lb Q+HEXuYkJAEhIn0XYmQzVVdcSZtxwIZsdY7ijKI0kwQwK4VKEXdvBGa8TmtAicRCiR4o 0Lvsy2mzYEj4CrI3UGV+RgcZSCCwwZ3SyZ+FbELdbL5iCsgVpwpz9762gFuEFb/sgGFo tx9MvO3QQnR8jmKesZk5NWt9IqZjqfCyYaE/+GyAdpD8ori9ru1M7mzR/c4KHQ5nnaOh Wvfw== X-Gm-Message-State: AIkVDXL70DNWkAJkUt2UfZiLCBCOzcldy6waSfx9Dgebci5iZq404KkZu8NNbmKDp8q6Lw== X-Received: by 10.194.86.104 with SMTP id o8mr8493662wjz.196.1484229656542; Thu, 12 Jan 2017 06:00:56 -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.00.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Jan 2017 06:00:56 -0800 (PST) From: Nikolay Borisov To: dsterba@suse.com Cc: linux-btrfs@vger.kernel.org, Nikolay Borisov Subject: [PATCH 01/24] btrfs: Make btrfs_must_commit_transaction take btrfs_inode Date: Thu, 12 Jan 2017 16:00:27 +0200 Message-Id: <1484229650-24554-2-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/tree-log.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 4e6f081512ab..f6de921e28b0 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -5014,13 +5014,13 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans, * we logged the inode or it might have also done the unlink). */ static bool btrfs_must_commit_transaction(struct btrfs_trans_handle *trans, - struct inode *inode) + struct btrfs_inode *inode) { - struct btrfs_fs_info *fs_info = BTRFS_I(inode)->root->fs_info; + struct btrfs_fs_info *fs_info = inode->root->fs_info; bool ret = false; - mutex_lock(&BTRFS_I(inode)->log_mutex); - if (BTRFS_I(inode)->last_unlink_trans > fs_info->last_trans_committed) { + mutex_lock(&inode->log_mutex); + if (inode->last_unlink_trans > fs_info->last_trans_committed) { /* * Make sure any commits to the log are forced to be full * commits. @@ -5028,7 +5028,7 @@ static bool btrfs_must_commit_transaction(struct btrfs_trans_handle *trans, btrfs_set_log_full_commit(fs_info, trans); ret = true; } - mutex_unlock(&BTRFS_I(inode)->log_mutex); + mutex_unlock(&inode->log_mutex); return ret; } @@ -5077,7 +5077,7 @@ static noinline int check_parent_dirs_for_sync(struct btrfs_trans_handle *trans, BTRFS_I(inode)->logged_trans = trans->transid; smp_mb(); - if (btrfs_must_commit_transaction(trans, inode)) { + if (btrfs_must_commit_transaction(trans, BTRFS_I(inode))) { ret = 1; break; } @@ -5087,7 +5087,7 @@ static noinline int check_parent_dirs_for_sync(struct btrfs_trans_handle *trans, if (IS_ROOT(parent)) { inode = d_inode(parent); - if (btrfs_must_commit_transaction(trans, inode)) + if (btrfs_must_commit_transaction(trans, BTRFS_I(inode))) ret = 1; break; } @@ -5241,7 +5241,7 @@ static int log_new_dir_dentries(struct btrfs_trans_handle *trans, ret = btrfs_log_inode(trans, root, di_inode, log_mode, 0, LLONG_MAX, ctx); if (!ret && - btrfs_must_commit_transaction(trans, di_inode)) + btrfs_must_commit_transaction(trans, BTRFS_I(di_inode))) ret = 1; iput(di_inode); if (ret) @@ -5361,7 +5361,7 @@ static int btrfs_log_all_parents(struct btrfs_trans_handle *trans, ret = btrfs_log_inode(trans, root, dir_inode, LOG_INODE_ALL, 0, LLONG_MAX, ctx); if (!ret && - btrfs_must_commit_transaction(trans, dir_inode)) + btrfs_must_commit_transaction(trans, BTRFS_I(dir_inode))) ret = 1; if (!ret && ctx && ctx->log_new_dentries) ret = log_new_dir_dentries(trans, root,