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 <nborisov@suse.com>
Subject: [PATCH 06/38] btrfs: make btrfs_is_free_space_inode take btrfs_inode
Date: Fri, 17 Feb 2017 16:42:57 +0200	[thread overview]
Message-ID: <1487342609-20652-7-git-send-email-nborisov@suse.com> (raw)
In-Reply-To: <1487342609-20652-1-git-send-email-nborisov@suse.com>

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 fs/btrfs/btrfs_inode.h |  8 ++++----
 fs/btrfs/ctree.h       |  2 +-
 fs/btrfs/extent-tree.c |  4 ++--
 fs/btrfs/file-item.c   |  2 +-
 fs/btrfs/inode.c       | 22 +++++++++++-----------
 5 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h
index 46d117b77bd2..36eca5464e1b 100644
--- a/fs/btrfs/btrfs_inode.h
+++ b/fs/btrfs/btrfs_inode.h
@@ -243,14 +243,14 @@ static inline void btrfs_i_size_write(struct btrfs_inode *inode, u64 size)
 	inode->disk_i_size = size;
 }
 
-static inline bool btrfs_is_free_space_inode(struct inode *inode)
+static inline bool btrfs_is_free_space_inode(struct btrfs_inode *inode)
 {
-	struct btrfs_root *root = BTRFS_I(inode)->root;
+	struct btrfs_root *root = inode->root;
 
 	if (root == root->fs_info->tree_root &&
-	    btrfs_ino(BTRFS_I(inode)) != BTRFS_BTREE_INODE_OBJECTID)
+	    btrfs_ino(inode) != BTRFS_BTREE_INODE_OBJECTID)
 		return true;
-	if (BTRFS_I(inode)->location.objectid == BTRFS_FREE_INO_OBJECTID)
+	if (inode->location.objectid == BTRFS_FREE_INO_OBJECTID)
 		return true;
 	return false;
 }
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 97f84a80b479..8ab0ce65a218 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -3123,7 +3123,7 @@ static inline void btrfs_force_ra(struct address_space *mapping,
 }
 
 struct inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry);
-int btrfs_set_inode_index(struct inode *dir, u64 *index);
+int btrfs_set_inode_index(struct btrfs_inode *dir, u64 *index);
 int btrfs_unlink_inode(struct btrfs_trans_handle *trans,
 		       struct btrfs_root *root,
 		       struct btrfs_inode *dir, struct btrfs_inode *inode,
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 438c7312de33..883819c5abc0 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -4148,7 +4148,7 @@ int btrfs_alloc_data_chunk_ondemand(struct inode *inode, u64 bytes)
 	/* make sure bytes are sectorsize aligned */
 	bytes = ALIGN(bytes, fs_info->sectorsize);
 
-	if (btrfs_is_free_space_inode(inode)) {
+	if (btrfs_is_free_space_inode(BTRFS_I(inode))) {
 		need_commit = 0;
 		ASSERT(current->journal_info);
 	}
@@ -5947,7 +5947,7 @@ int btrfs_delalloc_reserve_metadata(struct inode *inode, u64 num_bytes)
 	 * If we have a transaction open (can happen if we call truncate_block
 	 * from truncate), then we need FLUSH_LIMIT so we don't deadlock.
 	 */
-	if (btrfs_is_free_space_inode(inode)) {
+	if (btrfs_is_free_space_inode(BTRFS_I(inode))) {
 		flush = BTRFS_RESERVE_NO_FLUSH;
 		delalloc_lock = false;
 	} else if (current->journal_info) {
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c
index e35df48b4383..71ed7f051685 100644
--- a/fs/btrfs/file-item.c
+++ b/fs/btrfs/file-item.c
@@ -214,7 +214,7 @@ static int __btrfs_lookup_bio_sums(struct inode *inode, struct bio *bio,
 	 * read from the commit root and sidestep a nasty deadlock
 	 * between reading the free space cache and updating the csum tree.
 	 */
-	if (btrfs_is_free_space_inode(inode)) {
+	if (btrfs_is_free_space_inode(BTRFS_I(inode))) {
 		path->search_commit_root = 1;
 		path->skip_locking = 1;
 	}
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 5d5e9474b09b..fcdff1023718 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -933,7 +933,7 @@ static noinline int cow_file_range(struct inode *inode,
 	struct extent_map *em;
 	int ret = 0;
 
-	if (btrfs_is_free_space_inode(inode)) {
+	if (btrfs_is_free_space_inode(BTRFS_I(inode))) {
 		WARN_ON_ONCE(1);
 		ret = -EINVAL;
 		goto out_unlock;
@@ -1231,7 +1231,7 @@ static noinline int run_delalloc_nocow(struct inode *inode,
 		return -ENOMEM;
 	}
 
-	nolock = btrfs_is_free_space_inode(inode);
+	nolock = btrfs_is_free_space_inode(BTRFS_I(inode));
 
 	cow_start = (u64)-1;
 	cur_offset = start;
@@ -1676,7 +1676,7 @@ static void btrfs_set_bit_hook(struct inode *inode,
 	if (!(state->state & EXTENT_DELALLOC) && (*bits & EXTENT_DELALLOC)) {
 		struct btrfs_root *root = BTRFS_I(inode)->root;
 		u64 len = state->end + 1 - state->start;
-		bool do_list = !btrfs_is_free_space_inode(inode);
+		bool do_list = !btrfs_is_free_space_inode(BTRFS_I(inode));
 
 		if (*bits & EXTENT_FIRST_DELALLOC) {
 			*bits &= ~EXTENT_FIRST_DELALLOC;
@@ -1726,7 +1726,7 @@ static void btrfs_clear_bit_hook(struct inode *inode,
 	 */
 	if ((state->state & EXTENT_DELALLOC) && (*bits & EXTENT_DELALLOC)) {
 		struct btrfs_root *root = BTRFS_I(inode)->root;
-		bool do_list = !btrfs_is_free_space_inode(inode);
+		bool do_list = !btrfs_is_free_space_inode(BTRFS_I(inode));
 
 		if (*bits & EXTENT_FIRST_DELALLOC) {
 			*bits &= ~EXTENT_FIRST_DELALLOC;
@@ -1860,7 +1860,7 @@ static int btrfs_submit_bio_hook(struct inode *inode, struct bio *bio,
 
 	skip_sum = BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM;
 
-	if (btrfs_is_free_space_inode(inode))
+	if (btrfs_is_free_space_inode(BTRFS_I(inode)))
 		metadata = BTRFS_WQ_ENDIO_FREE_SPACE;
 
 	if (bio_op(bio) != REQ_OP_WRITE) {
@@ -2799,7 +2799,7 @@ static int btrfs_finish_ordered_io(struct btrfs_ordered_extent *ordered_extent)
 	bool nolock;
 	bool truncated = false;
 
-	nolock = btrfs_is_free_space_inode(inode);
+	nolock = btrfs_is_free_space_inode(BTRFS_I(inode));
 
 	if (test_bit(BTRFS_ORDERED_IOERR, &ordered_extent->flags)) {
 		ret = -EIO;
@@ -2999,7 +2999,7 @@ static int btrfs_writepage_end_io_hook(struct page *page, u64 start, u64 end,
 					    end - start + 1, uptodate))
 		return 0;
 
-	if (btrfs_is_free_space_inode(inode)) {
+	if (btrfs_is_free_space_inode(BTRFS_I(inode))) {
 		wq = fs_info->endio_freespace_worker;
 		func = btrfs_freespace_write_helper;
 	} else {
@@ -3871,7 +3871,7 @@ noinline int btrfs_update_inode(struct btrfs_trans_handle *trans,
 	 * The data relocation inode should also be directly updated
 	 * without delay
 	 */
-	if (!btrfs_is_free_space_inode(inode)
+	if (!btrfs_is_free_space_inode(BTRFS_I(inode))
 	    && root->root_key.objectid != BTRFS_DATA_RELOC_TREE_OBJECTID
 	    && !test_bit(BTRFS_FS_LOG_RECOVERING, &fs_info->flags)) {
 		btrfs_update_root_times(trans, root);
@@ -4325,7 +4325,7 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans,
 	 * for non-free space inodes and ref cows, we want to back off from
 	 * time to time
 	 */
-	if (!btrfs_is_free_space_inode(inode) &&
+	if (!btrfs_is_free_space_inode(BTRFS_I(inode)) &&
 	    test_bit(BTRFS_ROOT_REF_COWS, &root->state))
 		be_nice = 1;
 
@@ -5179,7 +5179,7 @@ void btrfs_evict_inode(struct inode *inode)
 	if (inode->i_nlink &&
 	    ((btrfs_root_refs(&root->root_item) != 0 &&
 	      root->root_key.objectid != BTRFS_ROOT_TREE_OBJECTID) ||
-	     btrfs_is_free_space_inode(inode)))
+	     btrfs_is_free_space_inode(BTRFS_I(inode))))
 		goto no_delete;
 
 	if (is_bad_inode(inode)) {
@@ -5896,7 +5896,7 @@ int btrfs_write_inode(struct inode *inode, struct writeback_control *wbc)
 	if (test_bit(BTRFS_INODE_DUMMY, &BTRFS_I(inode)->runtime_flags))
 		return 0;
 
-	if (btrfs_fs_closing(root->fs_info) && btrfs_is_free_space_inode(inode))
+	if (btrfs_fs_closing(root->fs_info) && btrfs_is_free_space_inode(BTRFS_I(inode)))
 		nolock = true;
 
 	if (wbc->sync_mode == WB_SYNC_ALL) {
-- 
2.7.4


  parent reply	other threads:[~2017-02-17 14:43 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-17 14:42 [PATCH 00/38] More btrfs_inode cleanups Nikolay Borisov
2017-02-17 14:42 ` [PATCH 01/38] btrfs: Make btrfs_log_all_parents take btrfs_inode Nikolay Borisov
2017-02-17 14:42 ` [PATCH 02/38] btrfs: Make btrfs_insert_dir_item " Nikolay Borisov
2017-02-17 14:42 ` [PATCH 03/38] btrfs: make btrfs_set_inode_index_count " Nikolay Borisov
2017-02-17 14:42 ` [PATCH 04/38] btrfs: Make btrfs_set_inode_index " Nikolay Borisov
2017-02-17 14:42 ` [PATCH 05/38] btrfs: Make btrfs_i_size_write " Nikolay Borisov
2017-02-17 14:42 ` Nikolay Borisov [this message]
2017-02-17 14:42 ` [PATCH 07/38] btrfs: make btrfs_alloc_data_chunk_ondemand " Nikolay Borisov
2017-02-17 14:42 ` [PATCH 08/38] btrfs: Make drop_outstanding_extent " Nikolay Borisov
2017-02-17 14:43 ` [PATCH 09/38] btrfs: Make calc_csum_metadata_size " Nikolay Borisov
2017-02-17 14:43 ` [PATCH 10/38] btrfs: Make btrfs_orphan_reserve_metadata " Nikolay Borisov
2017-02-17 14:43 ` [PATCH 11/38] btrfs: Make btrfs_orphan_release_metadata " Nikolay Borisov
2017-02-17 14:43 ` [PATCH 12/38] btrfs: Make btrfs_delalloc_reserve_metadata " Nikolay Borisov
2017-02-17 14:43 ` [PATCH 13/38] btrfs: ale btrfs_delalloc_release_metadata " Nikolay Borisov
2017-02-17 14:43 ` [PATCH 14/38] btrfs: Make (__)btrfs_add_inode_defrag " Nikolay Borisov
2017-02-17 14:43 ` [PATCH 15/38] btrfs: Make btrfs_requeue_inode_defrag " Nikolay Borisov
2017-02-17 14:43 ` [PATCH 16/38] btrfs: Make btrfs_drop_extent_cache " Nikolay Borisov
2017-02-17 16:47   ` kbuild test robot
2017-02-17 17:03   ` kbuild test robot
2017-02-17 14:43 ` [PATCH 17/38] btrfs: Make hole_mergeable " Nikolay Borisov
2017-02-17 14:43 ` [PATCH 18/38] btrfs: Make fille_holes " Nikolay Borisov
2017-02-17 14:43 ` [PATCH 19/38] btrfs: Make btrfs_mark_extent_written " Nikolay Borisov
2017-02-17 14:43 ` [PATCH 20/38] btrfs: Make btrfs_lookup_ordered_range " Nikolay Borisov
2017-02-17 14:43 ` [PATCH 21/38] btrfs: Make check_can_nocow " Nikolay Borisov
2017-02-17 14:43 ` [PATCH 22/38] btrfs: Make lock_and_cleanup_extent_if_need " Nikolay Borisov
2017-02-17 14:43 ` [PATCH 23/38] btrfs: make free_io_failure " Nikolay Borisov
2017-02-17 14:43 ` [PATCH 24/38] btrfs: make btrfs_print_data_csum_error " Nikolay Borisov
2017-02-17 14:43 ` [PATCH 25/38] btrfs: make check_compressed_csum " Nikolay Borisov
2017-02-17 14:43 ` [PATCH 26/38] btrfs: make repair_io_failure " Nikolay Borisov
2017-02-17 14:43 ` [PATCH 27/38] btrfs: make clean_io_failure " Nikolay Borisov
2017-02-17 14:43 ` [PATCH 28/38] btrfs: make btrfs_free_io_failure_record " Nikolay Borisov
2017-02-17 14:43 ` [PATCH 29/38] btrfs: make btrfs_orphan_del " Nikolay Borisov
2017-02-17 14:43 ` [PATCH 30/38] btrfs: Make btrfs_orphan_add " Nikolay Borisov
2017-02-17 14:43 ` [PATCH 31/38] btrfs: Make check_parent_dirs_for_sync " Nikolay Borisov
2017-02-17 14:43 ` [PATCH 32/38] btrfs: make btrfs_log_inode_parent " Nikolay Borisov
2017-02-17 14:43 ` [PATCH 33/38] btrfs: Make btrfs_extent_item_to_extent_map " Nikolay Borisov
2017-02-17 14:43 ` [PATCH 34/38] btrfs: Make btrfs_clear_bit_hook " Nikolay Borisov
2017-02-17 14:43 ` [PATCH 35/38] btrfs: Make clone_update_extent_map " Nikolay Borisov
2017-02-17 14:43 ` [PATCH 36/38] btrfs: Make check_extent_to_block " Nikolay Borisov
2017-02-17 14:43 ` [PATCH 37/38] btrfs: Make get_extent_t " Nikolay Borisov
2017-02-17 17:14   ` kbuild test robot
2017-02-17 17:26   ` kbuild test robot
2017-02-17 14:43 ` [PATCH 38/38] btrfs: Make btrfs_del_delalloc_inode " 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=1487342609-20652-7-git-send-email-nborisov@suse.com \
    --to=n.borisov.lkml@gmail.com \
    --cc=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@suse.com \
    /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).