From patchwork Tue Jan 17 22:31: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: 9522037 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 4B1E56020B for ; Tue, 17 Jan 2017 22:39:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E33328426 for ; Tue, 17 Jan 2017 22:39:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 32E0528602; Tue, 17 Jan 2017 22:39:57 +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 CB1F828426 for ; Tue, 17 Jan 2017 22:39:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751359AbdAQWjw (ORCPT ); Tue, 17 Jan 2017 17:39:52 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35882 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751228AbdAQWjv (ORCPT ); Tue, 17 Jan 2017 17:39:51 -0500 Received: by mail-wm0-f65.google.com with SMTP id r126so41992974wmr.3 for ; Tue, 17 Jan 2017 14:39:40 -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=PKNa2yNhhiZZcnlHWhFFuAAiZPPI9Q0xz6YPas5cyVo=; b=W9ZGRSDDkgNGSUzmxgKNSW2Wgw4lbJ7SXPAlrxKoiOJX0WL3+E5Y7Ujtj0AtACfk71 /QCL/ZJg2CXdXf1/0ZW8oDTgoEutZq6IZ/9gSwzb9lz7t4V7x2buoJ5zptyPgb5RbeYL B5J8ZetFxY4qlbwYWYErjIWKIPOyvDL3yH8OEAvzdiEZ/QQp8kBx5tBePDwxINTAb1r1 N7NOY3+V4pG7HyyObIXQSHtgBJd0iezG0/o3/XOPZZNmh9NpKmDhyYu86x7Cn3lgWvST Hym9N6FP5DI0rOLHx3P7PPv1Q97NVxnLMcF8+NfkwXNZJM3VeafK6bwOebMaubr62X4A 9yXQ== 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=PKNa2yNhhiZZcnlHWhFFuAAiZPPI9Q0xz6YPas5cyVo=; b=F9beREgTkSqCXS57q8cQoC3vPzPNCKEdeZXrI+xjwMVKUWqXwFjT7pCMAqne4y8AFC bht94vscawc+XX/l2g043IMprlOmfKjRjuDtWAUFZjNq3b5C2BbJcTPt6CCxDKdEmqYH 7oJ8iSHLWQ25ajX4+V9iEZ50UResfbB136kus7L0DpLDrFeY+pYJt/8w8YIGe+VdIh1w qUIjJADz/ZxxmsW0D4g5Fe5iQ0H8uBi574Vx+UyUqItCfIFkHxb7LS64STge/X0JBHSx K+cAhAx2aAnUzrtfL81tNHJ5922KklgA2eWAUbxLchWuPOgBVZppB5USAywSVJTvno5Q X9VQ== X-Gm-Message-State: AIkVDXJd5gzFX/3pXSdLIpXGaZDSwaxOZs5sJXeU+FLXBIjBK4D9yWWOLvp0U7VJc2pfIg== X-Received: by 10.223.177.134 with SMTP id q6mr11007302wra.83.1484692321868; Tue, 17 Jan 2017 14:32:01 -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.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jan 2017 14:32:01 -0800 (PST) From: Nikolay Borisov To: dsterba@suse.cz Cc: linux-btrfs@vger.kernel.org, Nikolay Borisov Subject: [PATCHv2 01/24] btrfs: Make btrfs_must_commit_transaction take btrfs_inode Date: Wed, 18 Jan 2017 00:31:27 +0200 Message-Id: <1484692310-3987-2-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/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 b814cd7bbe70..a2a822a993af 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -5021,13 +5021,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. @@ -5035,7 +5035,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; } @@ -5084,7 +5084,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; } @@ -5094,7 +5094,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; } @@ -5248,7 +5248,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) @@ -5368,7 +5368,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,