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 v2] btrfs: Remove bio_offset argument from submit_bio_hook
Date: Wed, 10 Apr 2019 19:46:04 +0300	[thread overview]
Message-ID: <20190410164604.29788-1-nborisov@suse.com> (raw)
In-Reply-To: <20190410142443.6470-7-nborisov@suse.com>

None of the implementers of the submit_bio_hook use the bio_offset
parameter, simply remove it. No functional changes.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---

Change since v1: 

 * Remove code dealing with bio internals in submit_one_bio.

 fs/btrfs/disk-io.c   |  4 ++--
 fs/btrfs/extent_io.c | 10 ++--------
 fs/btrfs/extent_io.h |  3 +--
 fs/btrfs/inode.c     |  5 +++--
 4 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index ee9e03b8aae3..0a7897adc58f 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -885,8 +885,8 @@ static int check_async_write(struct btrfs_inode *bi)
 }
 
 static blk_status_t btree_submit_bio_hook(struct inode *inode, struct bio *bio,
-					  int mirror_num, unsigned long bio_flags,
-					  u64 bio_offset)
+					  int mirror_num,
+					  unsigned long bio_flags)
 {
 	struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
 	int async = check_async_write(BTRFS_I(inode));
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 048d6c6fe7b9..9aa79ad794c9 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -149,19 +149,13 @@ static int __must_check submit_one_bio(struct bio *bio, int mirror_num,
 				       unsigned long bio_flags)
 {
 	blk_status_t ret = 0;
-	struct bio_vec *bvec = bio_last_bvec_all(bio);
-	struct bio_vec bv;
 	struct extent_io_tree *tree = bio->bi_private;
-	u64 start;
-
-	mp_bvec_last_segment(bvec, &bv);
-	start = page_offset(bv.bv_page) + bv.bv_offset;
 
 	bio->bi_private = NULL;
 
 	if (tree->ops)
 		ret = tree->ops->submit_bio_hook(tree->private_data, bio,
-					   mirror_num, bio_flags, start);
+						 mirror_num, bio_flags);
 	else
 		btrfsic_submit_bio(bio);
 
@@ -2546,7 +2540,7 @@ static int bio_readpage_error(struct bio *failed_bio, u64 phy_offset,
 		read_mode, failrec->this_mirror, failrec->in_validation);
 
 	status = tree->ops->submit_bio_hook(tree->private_data, bio, failrec->this_mirror,
-					 failrec->bio_flags, 0);
+					 failrec->bio_flags);
 	if (status) {
 		free_io_failure(failure_tree, tree, failrec);
 		bio_put(bio);
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h
index 37240e03c4e3..aa18a16a6ed7 100644
--- a/fs/btrfs/extent_io.h
+++ b/fs/btrfs/extent_io.h
@@ -105,8 +105,7 @@ struct extent_io_ops {
 	 * pointer will be called unconditionally.
 	 */
 	blk_status_t (*submit_bio_hook)(struct inode *inode, struct bio *bio,
-					int mirror_num, unsigned long bio_flags,
-					u64 bio_offset);
+					int mirror_num, unsigned long bio_flags);
 	int (*readpage_end_io_hook)(struct btrfs_io_bio *io_bio, u64 phy_offset,
 				    struct page *page, u64 start, u64 end,
 				    int mirror);
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 6e5f1afa7407..476111d44021 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1954,8 +1954,9 @@ static blk_status_t btrfs_submit_bio_start(void *private_data, struct bio *bio,
  *    c-3) otherwise:			async submit
  */
 static blk_status_t btrfs_submit_bio_hook(struct inode *inode, struct bio *bio,
-				 int mirror_num, unsigned long bio_flags,
-				 u64 bio_offset)
+					  int mirror_num,
+					  unsigned long bio_flags)
+
 {
 	struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
 	struct btrfs_root *root = BTRFS_I(inode)->root;
-- 
2.17.1


  parent reply	other threads:[~2019-04-10 16:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-10 14:24 [PATCH 0/6] Simplifications around submit_bio_hook Nikolay Borisov
2019-04-10 14:24 ` [PATCH 1/6] btrfs: Define submit_bio_hook's type directly Nikolay Borisov
2019-04-11 11:10   ` Johannes Thumshirn
2019-04-10 14:24 ` [PATCH 2/6] btrfs: Change submit_bio_hook to taking an inode directly Nikolay Borisov
2019-04-11 11:18   ` Johannes Thumshirn
2019-04-11 11:23     ` Nikolay Borisov
2019-04-10 14:24 ` [PATCH 3/6] btrfs: Remove 'tree' argument from read_extent_buffer_pages Nikolay Borisov
2019-04-11 13:01   ` Johannes Thumshirn
2019-04-10 14:24 ` [PATCH 4/6] btrfs: Pass 0 for bio_offset to btrfs_wq_submit_bio Nikolay Borisov
2019-04-11 13:09   ` Johannes Thumshirn
2019-04-11 13:10     ` Johannes Thumshirn
2019-04-11 13:17       ` Nikolay Borisov
2019-04-11 13:26         ` Johannes Thumshirn
2019-04-10 14:24 ` [PATCH 5/6] btrfs: Always pass 0 bio_offset for btree_submit_bio_start Nikolay Borisov
2019-04-11 13:27   ` Johannes Thumshirn
2019-04-10 14:24 ` [PATCH 6/6] btrfs: Remove bio_offset argument from submit_bio_hook Nikolay Borisov
2019-04-10 16:39   ` Nikolay Borisov
2019-04-10 16:46   ` Nikolay Borisov [this message]
2019-04-11 13:29     ` [PATCH v2] " Johannes Thumshirn
2019-04-11 14:39       ` Nikolay Borisov
2019-04-18 13:04 ` [PATCH 0/6] Simplifications around submit_bio_hook David Sterba

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=20190410164604.29788-1-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.