All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: Nikolay Borisov <nborisov@suse.com>
Subject: [PATCH 03/46] btrfs: Make btrfs_lookup_ordered_extent take btrfs_inode
Date: Mon,  1 Jun 2020 18:37:01 +0300	[thread overview]
Message-ID: <20200601153744.31891-4-nborisov@suse.com> (raw)
In-Reply-To: <20200601153744.31891-1-nborisov@suse.com>

It doesn't use the generic vfs inode for anything use btrfs_inode directly.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 fs/btrfs/file-item.c    | 5 +++--
 fs/btrfs/inode.c        | 2 +-
 fs/btrfs/ioctl.c        | 2 +-
 fs/btrfs/ordered-data.c | 6 +++---
 fs/btrfs/ordered-data.h | 2 +-
 fs/btrfs/relocation.c   | 2 +-
 6 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c
index 706a3128e192..9d311e834b20 100644
--- a/fs/btrfs/file-item.c
+++ b/fs/btrfs/file-item.c
@@ -522,10 +522,11 @@ int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, u64 end,
  *		 means this bio can contains potentially discontigous bio vecs
  *		 so the logical offset of each should be calculated separately.
  */
-blk_status_t btrfs_csum_one_bio(struct inode *inode, struct bio *bio,
+blk_status_t btrfs_csum_one_bio(struct inode *vfsinode, struct bio *bio,
 		       u64 file_start, int contig)
 {
-	struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
+	struct btrfs_inode *inode = BTRFS_I(vfsinode);
+	struct btrfs_fs_info *fs_info = inode->root->fs_info;
 	SHASH_DESC_ON_STACK(shash, fs_info->csum_shash);
 	struct btrfs_ordered_sum *sums;
 	struct btrfs_ordered_extent *ordered = NULL;
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index bc94051e3b4a..09a0c6a9a73a 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -4543,7 +4543,7 @@ int btrfs_truncate_block(struct inode *inode, loff_t from, loff_t len,
 	lock_extent_bits(io_tree, block_start, block_end, &cached_state);
 	set_page_extent_mapped(page);

-	ordered = btrfs_lookup_ordered_extent(inode, block_start);
+	ordered = btrfs_lookup_ordered_extent(BTRFS_I(inode), block_start);
 	if (ordered) {
 		unlock_extent_cached(io_tree, block_start, block_end,
 				     &cached_state);
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 168deb8ef68a..4dc308048d8c 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -1265,7 +1265,7 @@ static int cluster_pages_for_defrag(struct inode *inode,
 		while (1) {
 			lock_extent_bits(tree, page_start, page_end,
 					 &cached_state);
-			ordered = btrfs_lookup_ordered_extent(inode,
+			ordered = btrfs_lookup_ordered_extent(BTRFS_I(inode),
 							      page_start);
 			unlock_extent_cached(tree, page_start, page_end,
 					     &cached_state);
diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c
index 7bf7edbb994c..4139de966c74 100644
--- a/fs/btrfs/ordered-data.c
+++ b/fs/btrfs/ordered-data.c
@@ -697,14 +697,14 @@ int btrfs_wait_ordered_range(struct inode *inode, u64 start, u64 len)
  * find an ordered extent corresponding to file_offset.  return NULL if
  * nothing is found, otherwise take a reference on the extent and return it
  */
-struct btrfs_ordered_extent *btrfs_lookup_ordered_extent(struct inode *inode,
+struct btrfs_ordered_extent *btrfs_lookup_ordered_extent(struct btrfs_inode *inode,
 							 u64 file_offset)
 {
 	struct btrfs_ordered_inode_tree *tree;
 	struct rb_node *node;
 	struct btrfs_ordered_extent *entry = NULL;

-	tree = &BTRFS_I(inode)->ordered_tree;
+	tree = &inode->ordered_tree;
 	spin_lock_irq(&tree->lock);
 	node = tree_search(tree, file_offset);
 	if (!node)
@@ -802,7 +802,7 @@ int btrfs_find_ordered_sum(struct inode *inode, u64 offset, u64 disk_bytenr,
 	const u16 csum_size = btrfs_super_csum_size(fs_info->super_copy);
 	int index = 0;

-	ordered = btrfs_lookup_ordered_extent(inode, offset);
+	ordered = btrfs_lookup_ordered_extent(BTRFS_I(inode), offset);
 	if (!ordered)
 		return 0;

diff --git a/fs/btrfs/ordered-data.h b/fs/btrfs/ordered-data.h
index c01c9698250b..6afa9d98e84e 100644
--- a/fs/btrfs/ordered-data.h
+++ b/fs/btrfs/ordered-data.h
@@ -166,7 +166,7 @@ int btrfs_add_ordered_extent_compress(struct inode *inode, u64 file_offset,
 				      int compress_type);
 void btrfs_add_ordered_sum(struct btrfs_ordered_extent *entry,
 			   struct btrfs_ordered_sum *sum);
-struct btrfs_ordered_extent *btrfs_lookup_ordered_extent(struct inode *inode,
+struct btrfs_ordered_extent *btrfs_lookup_ordered_extent(struct btrfs_inode *inode,
 							 u64 file_offset);
 void btrfs_start_ordered_extent(struct inode *inode,
 				struct btrfs_ordered_extent *entry, int wait);
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 3bbae80c752f..2a49115ee4c6 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -3882,7 +3882,7 @@ int btrfs_reloc_clone_csums(struct inode *inode, u64 file_pos, u64 len)
 	u64 new_bytenr;
 	LIST_HEAD(list);

-	ordered = btrfs_lookup_ordered_extent(inode, file_pos);
+	ordered = btrfs_lookup_ordered_extent(BTRFS_I(inode), file_pos);
 	BUG_ON(ordered->file_offset != file_pos || ordered->num_bytes != len);

 	disk_bytenr = file_pos + BTRFS_I(inode)->index_cnt;
--
2.17.1


  parent reply	other threads:[~2020-06-01 15:38 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-01 15:36 [PATCH 00/46] Trivial BTRFS_I removal Nikolay Borisov
2020-06-01 15:36 ` [PATCH 01/46] btrfs: Make __btrfs_add_ordered_extent take struct btrfs_inode Nikolay Borisov
2020-06-02  8:50   ` Johannes Thumshirn
2020-06-01 15:37 ` [PATCH 02/46] btrfs: Make get_extent_allocation_hint take btrfs_inode Nikolay Borisov
2020-06-02  8:54   ` Johannes Thumshirn
2020-06-01 15:37 ` Nikolay Borisov [this message]
2020-06-02  8:56   ` [PATCH 03/46] btrfs: Make btrfs_lookup_ordered_extent " Johannes Thumshirn
2020-06-01 15:37 ` [PATCH 04/46] btrfs: Make btrfs_reloc_clone_csums " Nikolay Borisov
2020-06-02  8:57   ` Johannes Thumshirn
2020-06-01 15:37 ` [PATCH 05/46] btrfs: Make create_io_em " Nikolay Borisov
2020-06-02  8:58   ` Johannes Thumshirn
2020-06-01 15:37 ` [PATCH 06/46] btrfs: Make extent_clear_unlock_delalloc " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 07/46] btrfs: Make btrfs_csum_one_bio takae btrfs_inode Nikolay Borisov
2020-06-01 15:37 ` [PATCH 08/46] btrfs: Make __btrfs_drop_extents take btrfs_inode Nikolay Borisov
2020-06-01 15:37 ` [PATCH 09/46] btrfs: Make qgroup_free_reserved_data " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 10/46] btrfs: Make __btrfs_qgroup_release_data " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 11/46] btrfs: Make btrfs_qgroup_free_data " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 12/46] btrfs: Make cow_file_range_inline " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 13/46] btrfs: Make btrfs_add_ordered_extent " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 14/46] btrfs: Make cow_file_range " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 15/46] btrfs: Make btrfs_add_ordered_extent_compress " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 16/46] btrfs: Make btrfs_submit_compressed_write " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 17/46] btrfs: Make submit_compressed_extents " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 18/46] btrfs: Make btrfs_qgroup_release_data " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 19/46] btrfs: Make insert_reserved_file_extent " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 20/46] btrfs: Make fallback_to_cow " Nikolay Borisov
2020-06-02  9:23   ` Johannes Thumshirn
2020-06-01 15:37 ` [PATCH 21/46] btrfs: Make run_delalloc_nocow " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 22/46] btrfs: Make cow_file_range_async " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 23/46] btrfs: Make btrfs_dec_test_first_ordered_pending " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 24/46] btrfs: Make __endio_write_update_ordered " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 25/46] btrfs: Make btrfs_cleanup_ordered_extents " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 26/46] btrfs: Make inode_can_compress " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 27/46] btrfs: Make inode_need_compress " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 28/46] btrfs: Make need_force_cow " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 29/46] btrfs: Make btrfs_run_delalloc_range " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 30/46] btrfs: Make btrfs_add_ordered_extent_dio " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 31/46] btrfs: Make btrfs_create_dio_extent " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 32/46] btrfs: Make btrfs_new_extent_direct " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 33/46] btrfs: Make __extent_writepage_io " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 34/46] btrfs: Make writepage_delalloc " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 35/46] btrfs: Make btrfs_set_extent_delalloc " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 36/46] btrfs: Make btrfs_dirty_pages " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 37/46] btrfs: Make btrfs_qgroup_reserve_data " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 38/46] btrfs: Make btrfs_free_reserved_data_space_noquota take btrfs_fs_info Nikolay Borisov
2020-06-01 15:37 ` [PATCH 39/46] btrfs: Make btrfs_free_reserved_data_space take btrfs_inode Nikolay Borisov
2020-06-01 15:37 ` [PATCH 40/46] btrfs: Make btrfs_delalloc_release_space " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 41/46] btrfs: Make btrfs_check_data_free_space " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 42/46] btrfs: Make btrfs_delalloc_reserve_space " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 43/46] btrfs: Remove BTRFS_I calls in btrfs_writepage_fixup_worker Nikolay Borisov
2020-06-01 15:37 ` [PATCH 44/46] btrfs: Make prealloc_file_extent_cluster take btrfs_inode Nikolay Borisov
2020-06-01 15:37 ` [PATCH 45/46] btrfs make btrfs_set_inode_last_trans " Nikolay Borisov
2020-06-01 15:37 ` [PATCH 46/46] btrfs: Make btrfs_qgroup_check_reserved_leak " Nikolay Borisov
2020-06-01 17:20 ` [PATCH 00/46] Trivial BTRFS_I removal David Sterba
2020-06-02  9:46 ` Johannes Thumshirn
2020-06-03  5:55 [PATCH v2 " Nikolay Borisov
2020-06-03  5:55 ` [PATCH 03/46] btrfs: Make btrfs_lookup_ordered_extent take btrfs_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=20200601153744.31891-4-nborisov@suse.com \
    --to=nborisov@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.