linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolay Borisov <n.borisov.lkml@gmail.com>
To: dsterba@suse.com
Cc: linux-btrfs@vger.kernel.org, Nikolay Borisov <n.borisov.lkml@gmail.com>
Subject: [PATCH 14/24] btrfs: Make btrfs_log_changed_extents take btrfs_inode
Date: Thu, 12 Jan 2017 16:00:40 +0200	[thread overview]
Message-ID: <1484229650-24554-15-git-send-email-n.borisov.lkml@gmail.com> (raw)
In-Reply-To: <1484229650-24554-1-git-send-email-n.borisov.lkml@gmail.com>

Signed-off-by: Nikolay Borisov <n.borisov.lkml@gmail.com>
---
 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;
-- 
2.7.4


  parent reply	other threads:[~2017-01-12 14:01 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-12 14:00 [PATCH 00/24] tree-log inode vs btrfs_inode cleanups Nikolay Borisov
2017-01-12 14:00 ` [PATCH 01/24] btrfs: Make btrfs_must_commit_transaction take btrfs_inode Nikolay Borisov
2017-01-12 14:00 ` [PATCH 02/24] btrfs: Make btrfs_record_unlink_dir " Nikolay Borisov
2017-01-12 14:00 ` [PATCH 03/24] btrfs: Make btrfs_record_snapshot_destroy " Nikolay Borisov
2017-01-12 14:00 ` [PATCH 04/24] btrfs: Make btrfs_inode_in_log " Nikolay Borisov
2017-01-12 14:00 ` [PATCH 05/24] btrfs: Make btrfs_log_new_name " Nikolay Borisov
2017-01-12 14:00 ` [PATCH 06/24] btrfs: Make btrfs_del_dir_entries_in_log " Nikolay Borisov
2017-01-12 14:00 ` [PATCH 07/24] btrfs: Make btrfs_del_inode_ref " Nikolay Borisov
2017-01-12 14:00 ` [PATCH 08/24] btrfs: Make logged_inode_size " Nikolay Borisov
2017-01-12 14:00 ` [PATCH 09/24] btrfs: Make btrfs_check_ref_name_override " Nikolay Borisov
2017-01-12 14:00 ` [PATCH 10/24] btrfs: Make copy_items " Nikolay Borisov
2017-01-12 14:00 ` [PATCH 11/24] btrfs: Make btrfs_log_all_xattrs " Nikolay Borisov
2017-01-12 14:00 ` [PATCH 12/24] btrfs: Make btrfs_log_trailing_hole " Nikolay Borisov
2017-01-12 14:00 ` [PATCH 13/24] btrfs: Make btrfs_get_logged_extents " Nikolay Borisov
2017-01-12 14:00 ` Nikolay Borisov [this message]
2017-01-12 14:00 ` [PATCH 15/24] btrfs: Make log_dir_items " Nikolay Borisov
2017-01-12 14:00 ` [PATCH 16/24] btrfs: Make log_directory_changes " Nikolay Borisov
2017-01-12 14:00 ` [PATCH 17/24] btrfs: Make log_new_dir_dentries " Nikolay Borisov
2017-01-12 14:00 ` [PATCH 18/24] btrfs: Make btrfs_unlink_inode " Nikolay Borisov
2017-01-12 14:00 ` [PATCH 19/24] btrfs: Make drop_one_dir_item " Nikolay Borisov
2017-01-12 14:00 ` [PATCH 20/24] btrfs: Make __add_inode_ref " Nikolay Borisov
2017-01-12 14:00 ` [PATCH 21/24] btrfs: Make log_inode_item " Nikolay Borisov
2017-01-12 14:00 ` [PATCH 22/24] btrfs: Make btrfs_log_inode " Nikolay Borisov
2017-01-12 14:00 ` [PATCH 23/24] btrfs: Make count_inode_extrefs " Nikolay Borisov
2017-01-12 14:00 ` [PATCH 24/24] btrfs: Make count_inode_refs " Nikolay Borisov
2017-01-17 16:15 ` [PATCH 00/24] tree-log inode vs btrfs_inode cleanups David Sterba
2017-01-17 22:31   ` [PATCHv2 " Nikolay Borisov
2017-01-17 22:31     ` [PATCHv2 01/24] btrfs: Make btrfs_must_commit_transaction take btrfs_inode Nikolay Borisov
2017-01-17 22:31     ` [PATCHv2 02/24] btrfs: Make btrfs_record_unlink_dir " Nikolay Borisov
2017-01-17 22:31     ` [PATCHv2 03/24] btrfs: Make btrfs_record_snapshot_destroy " Nikolay Borisov
2017-01-17 22:31     ` [PATCHv2 04/24] btrfs: Make btrfs_inode_in_log " Nikolay Borisov
2017-01-17 22:31     ` [PATCHv2 05/24] btrfs: Make btrfs_log_new_name " Nikolay Borisov
2017-01-17 22:31     ` [PATCHv2 06/24] btrfs: Make btrfs_del_dir_entries_in_log " Nikolay Borisov
2017-01-17 22:31     ` [PATCHv2 07/24] btrfs: Make btrfs_del_inode_ref " Nikolay Borisov
2017-01-17 22:31     ` [PATCHv2 08/24] btrfs: Make logged_inode_size " Nikolay Borisov
2017-01-17 22:31     ` [PATCHv2 09/24] btrfs: Make btrfs_check_ref_name_override " Nikolay Borisov
2017-01-17 22:31     ` [PATCHv2 10/24] btrfs: Make copy_items " Nikolay Borisov
2017-01-17 22:31     ` [PATCHv2 11/24] btrfs: Make btrfs_log_all_xattrs " Nikolay Borisov
2017-01-17 22:31     ` [PATCHv2 12/24] btrfs: Make btrfs_log_trailing_hole " Nikolay Borisov
2017-01-17 22:31     ` [PATCHv2 13/24] btrfs: Make btrfs_get_logged_extents " Nikolay Borisov
2017-01-17 22:31     ` [PATCHv2 14/24] btrfs: Make btrfs_log_changed_extents " Nikolay Borisov
2017-01-17 22:31     ` [PATCHv2 15/24] btrfs: Make log_dir_items " Nikolay Borisov
2017-01-17 22:31     ` [PATCHv2 16/24] btrfs: Make log_directory_changes " Nikolay Borisov
2017-01-17 22:31     ` [PATCHv2 17/24] btrfs: Make log_new_dir_dentries " Nikolay Borisov
2017-01-17 22:31     ` [PATCHv2 18/24] btrfs: Make btrfs_unlink_inode " Nikolay Borisov
2017-01-17 22:31     ` [PATCHv2 19/24] btrfs: Make drop_one_dir_item " Nikolay Borisov
2017-01-17 22:31     ` [PATCHv2 20/24] btrfs: Make __add_inode_ref " Nikolay Borisov
2017-01-17 22:31     ` [PATCHv2 21/24] btrfs: Make log_inode_item " Nikolay Borisov
2017-01-17 22:31     ` [PATCHv2 22/24] btrfs: Make btrfs_log_inode " Nikolay Borisov
2017-01-17 22:31     ` [PATCHv2 23/24] btrfs: Make count_inode_extrefs " Nikolay Borisov
2017-01-17 22:31     ` [PATCHv2 24/24] btrfs: Make count_inode_refs " Nikolay Borisov
2017-01-19 18:21     ` [PATCHv2 00/24] tree-log inode vs btrfs_inode cleanups David Sterba
2017-01-20  7:22       ` Nikolay Borisov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1484229650-24554-15-git-send-email-n.borisov.lkml@gmail.com \
    --to=n.borisov.lkml@gmail.com \
    --cc=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).