From patchwork Thu Jan 12 14:00: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: 9513287 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 D68BC60710 for ; Thu, 12 Jan 2017 14:02:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C39AB2868C for ; Thu, 12 Jan 2017 14:02:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B89CD286D5; Thu, 12 Jan 2017 14:02:02 +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=-1.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=no 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 C25D62868C for ; Thu, 12 Jan 2017 14:01:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751055AbdALOBR (ORCPT ); Thu, 12 Jan 2017 09:01:17 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:34180 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751015AbdALOBN (ORCPT ); Thu, 12 Jan 2017 09:01:13 -0500 Received: by mail-wm0-f65.google.com with SMTP id c85so3882324wmi.1 for ; Thu, 12 Jan 2017 06:01:12 -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=j1Vx5ZeLCTvjLEJuwbnGUOaXBh/bse6HIxWNNTcEH00=; b=vXMoTbEyNY3IF5C6KojrvTPoylJolFkqAQrmvqur0yWkPZzv5i/ZH4wjzd4GeiQQk8 u65RjY1DXXNnLqhVdXoczlF41aRvc9sYrXfa1FzTztxbrAMHBmw7sXCMzGwt025oeN/e eBRIhJelvtZ+bfRmFqrInZtkZPliJcjtHjPiHI8PxH3n8qCvLgOBzke6o7wzRWiQ2MF2 N5hnFvqVKPtAPuBnliORrM5OUMheJ32POHARYKQLtuEEpF+0EFtchFjyhy9g0ASjhlWl lvmctyiRLx+hWYJ+0Iuv9jOIBFvP/FTEpVBnPM3P1iD5nNGSRZdgHkRf/Ox3epngIc2D B4Fw== 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=j1Vx5ZeLCTvjLEJuwbnGUOaXBh/bse6HIxWNNTcEH00=; b=L57zfpCk4hZ5icWdNJCH3Yg7ykxDWteBB0Lm3Swfil6iYyUD7VY9YQmR8aDM4qd1PR r1o4j+pk4AFtnH8nuK+aCtUk+6pEUfqN3+3sPtfk/pdOwIdyo4KXjsQPn74BZZDIefNh Z0kDtb8BrhvB1zCl7eSbvRvCFs5IFB+CujxEwbitEAB7CoDTO6qU93mavC2rRpwqCSlC dZgjxN428ljhNGwt9UXPhwaTZnUqDM5MlumcDRSQ4AiwtlEuSHwJ0d4iZSsdlKmazN5g S5q35NfEk3vFOwoeCW/4pjVggKz1b2xBYrYsWnJoECpQdvRg24mjM9WvHwqb0DBRSzBO BDCA== X-Gm-Message-State: AIkVDXJ8OVjTbCLC8WLSitaw9z4af4ZhZjhWa2P5KBz7qHaTaqupwko/LWDc+T54Gk1yZw== X-Received: by 10.28.199.73 with SMTP id x70mr8000181wmf.42.1484229671121; Thu, 12 Jan 2017 06:01:11 -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.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Jan 2017 06:01:10 -0800 (PST) From: Nikolay Borisov To: dsterba@suse.com Cc: linux-btrfs@vger.kernel.org, Nikolay Borisov Subject: [PATCH 14/24] btrfs: Make btrfs_log_changed_extents take btrfs_inode Date: Thu, 12 Jan 2017 16:00:40 +0200 Message-Id: <1484229650-24554-15-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 | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 657c118aed63..5abe54963049 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -4052,7 +4052,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, @@ -4069,7 +4069,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; @@ -4081,14 +4081,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; @@ -4147,7 +4147,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, @@ -4156,14 +4156,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; @@ -4192,7 +4192,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 @@ -4203,7 +4203,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: @@ -4232,7 +4232,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; @@ -4931,7 +4931,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;