From patchwork Tue Jan 17 22:31:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 9522027 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 EAC7E6020B for ; Tue, 17 Jan 2017 22:39:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD59E28426 for ; Tue, 17 Jan 2017 22:39:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D23D728602; Tue, 17 Jan 2017 22:39:20 +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 5D0EB28426 for ; Tue, 17 Jan 2017 22:39:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751324AbdAQWjS (ORCPT ); Tue, 17 Jan 2017 17:39:18 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:34258 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751139AbdAQWjQ (ORCPT ); Tue, 17 Jan 2017 17:39:16 -0500 Received: by mail-wm0-f67.google.com with SMTP id c85so9423064wmi.1 for ; Tue, 17 Jan 2017 14:39:15 -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=TULrVOUFUUS3F/jSpgaUukntudkjwA3bUwNOYQt6Sjo=; b=VwmXgrJqwWud7PRScMf0E46iZy3x7Y4FSZCfliz+OpAqV2SRS+XrUM/0mPpDqYBYJi ApfFtBaS+MgD9wdgDM/m1DHf3RYa3s6wCemiNJRO8R4hIXed/tWXCE14Jgmk0zhnk8xT kkvalbeLO0cuy0sbrDslX/evoPYlM7bYrgpF8kw+8GTbVMa2v2HMPffjwg878c8yc5HZ Azmr+Y+3qN7maey2tAZWhLOIjR3RMdg13Yi/SMwzBEGQEFsBQOR+v5YYvEFqaN0hmAtl QB069PlxzEIg6a3xHH/icveQ0Wz+Gh8IWtYLtLiO26Heg6vnA9lZMAOnLbonuwu1+Hf9 T+Eg== 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=TULrVOUFUUS3F/jSpgaUukntudkjwA3bUwNOYQt6Sjo=; b=nl76HW13o4nAsgSL9zUhpwdL0k55sAyEFfjWKqbK4XjHwkokn3IyXMjilhzNFhCgqR JL3DEr1M7se391us4ZQnxuqikyjTxrff9eWrFX7vl9qQXUoeK/UsYPaWH07CUw3TTaXe dgGzYdJ/mGaSVResBm2HQxARDqU1ZP33PdV8fkiq6+Gu/jfupxDA99ghB0AxHAYv41oo 4Os5HN5lpdEiVELoTmK34D6fHdRWf6q5SCDc5NCFN5NiyG2Xsf8t/dFa9YQUdDk+0fkz Zf06LxWjAR2WjoCVCB96nNDOJ18QJdCGw3SO8XW91dE3yShNZiIUhLC7xLfGFAHHwqXJ Ldrg== X-Gm-Message-State: AIkVDXLM4DrWz97iFvxogtVP0wWopwUm/AW8kEc7KRD+huF7RZFzK6aIskV2ZkLxZZJvrA== X-Received: by 10.28.17.20 with SMTP id 20mr288989wmr.99.1484692341929; Tue, 17 Jan 2017 14:32:21 -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.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jan 2017 14:32:21 -0800 (PST) From: Nikolay Borisov To: dsterba@suse.cz Cc: linux-btrfs@vger.kernel.org, Nikolay Borisov Subject: [PATCHv2 14/24] btrfs: Make btrfs_log_changed_extents take btrfs_inode Date: Wed, 18 Jan 2017 00:31:40 +0200 Message-Id: <1484692310-3987-15-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 | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 0e061f91055e..e293ae0e18d7 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -4053,7 +4053,7 @@ static int wait_ordered_extents(struct btrfs_trans_handle *trans, } static int log_one_extent(struct btrfs_trans_handle *trans, - struct inode *inode, struct btrfs_root *root, + struct btrfs_inode *inode, struct btrfs_root *root, const struct extent_map *em, struct btrfs_path *path, const struct list_head *logged_list, @@ -4070,7 +4070,7 @@ static int log_one_extent(struct btrfs_trans_handle *trans, int extent_inserted = 0; bool ordered_io_err = false; - ret = wait_ordered_extents(trans, inode, root, em, logged_list, + ret = wait_ordered_extents(trans, &inode->vfs_inode, root, em, logged_list, &ordered_io_err); if (ret) return ret; @@ -4082,14 +4082,14 @@ static int log_one_extent(struct btrfs_trans_handle *trans, btrfs_init_map_token(&token); - ret = __btrfs_drop_extents(trans, log, inode, path, em->start, + ret = __btrfs_drop_extents(trans, log, &inode->vfs_inode, path, em->start, em->start + em->len, NULL, 0, 1, sizeof(*fi), &extent_inserted); if (ret) return ret; if (!extent_inserted) { - key.objectid = btrfs_ino(BTRFS_I(inode)); + key.objectid = btrfs_ino(inode); key.type = BTRFS_EXTENT_DATA_KEY; key.offset = em->start; @@ -4148,7 +4148,7 @@ static int log_one_extent(struct btrfs_trans_handle *trans, static int btrfs_log_changed_extents(struct btrfs_trans_handle *trans, struct btrfs_root *root, - struct inode *inode, + struct btrfs_inode *inode, struct btrfs_path *path, struct list_head *logged_list, struct btrfs_log_ctx *ctx, @@ -4157,14 +4157,14 @@ static int btrfs_log_changed_extents(struct btrfs_trans_handle *trans, { struct extent_map *em, *n; struct list_head extents; - struct extent_map_tree *tree = &BTRFS_I(inode)->extent_tree; + struct extent_map_tree *tree = &inode->extent_tree; u64 test_gen; int ret = 0; int num = 0; INIT_LIST_HEAD(&extents); - down_write(&BTRFS_I(inode)->dio_sem); + down_write(&inode->dio_sem); write_lock(&tree->lock); test_gen = root->fs_info->last_trans_committed; @@ -4193,7 +4193,7 @@ static int btrfs_log_changed_extents(struct btrfs_trans_handle *trans, } list_sort(NULL, &extents, extent_cmp); - btrfs_get_logged_extents(BTRFS_I(inode), logged_list, start, end); + btrfs_get_logged_extents(inode, logged_list, start, end); /* * Some ordered extents started by fsync might have completed * before we could collect them into the list logged_list, which @@ -4204,7 +4204,7 @@ static int btrfs_log_changed_extents(struct btrfs_trans_handle *trans, * without writing to the log tree and the fsync must report the * file data write error and not commit the current transaction. */ - ret = filemap_check_errors(inode->i_mapping); + ret = filemap_check_errors(inode->vfs_inode.i_mapping); if (ret) ctx->io_err = ret; process: @@ -4233,7 +4233,7 @@ static int btrfs_log_changed_extents(struct btrfs_trans_handle *trans, } WARN_ON(!list_empty(&extents)); write_unlock(&tree->lock); - up_write(&BTRFS_I(inode)->dio_sem); + up_write(&inode->dio_sem); btrfs_release_path(path); return ret; @@ -4938,7 +4938,7 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans, goto out_unlock; } if (fast_search) { - ret = btrfs_log_changed_extents(trans, root, inode, dst_path, + ret = btrfs_log_changed_extents(trans, root, BTRFS_I(inode), dst_path, &logged_list, ctx, start, end); if (ret) { err = ret;