public inbox for linux-bcachefs@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: linux-bcachefs@vger.kernel.org
Subject: [PATCH v3 2/4] bcachefs: track current fiemap offset in start variable
Date: Mon,  8 Apr 2024 10:48:44 -0400	[thread overview]
Message-ID: <20240408144846.1001243-3-bfoster@redhat.com> (raw)
In-Reply-To: <20240408144846.1001243-1-bfoster@redhat.com>

Signed-off-by: Brian Foster <bfoster@redhat.com>
---
 fs/bcachefs/fs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c
index 137ce028bc3c..9c86749b256e 100644
--- a/fs/bcachefs/fs.c
+++ b/fs/bcachefs/fs.c
@@ -1015,6 +1015,7 @@ static int bch2_fiemap(struct inode *vinode, struct fiemap_extent_info *info,
 		bch2_bkey_buf_realloc(&prev, c, k.k->u64s);
 
 		sectors = min(sectors, k.k->size - offset_into_extent);
+		start = iter.pos.offset + sectors;
 
 		bch2_cut_front(POS(k.k->p.inode,
 				   bkey_start_offset(k.k) +
@@ -1035,8 +1036,7 @@ static int bch2_fiemap(struct inode *vinode, struct fiemap_extent_info *info,
 		bkey_copy(prev.k, cur.k);
 		have_extent = true;
 
-		bch2_btree_iter_set_pos(&iter,
-			POS(iter.pos.inode, iter.pos.offset + sectors));
+		bch2_btree_iter_set_pos(&iter, POS(iter.pos.inode, start));
 	}
 	start = iter.pos.offset;
 	bch2_trans_iter_exit(trans, &iter);
-- 
2.44.0


  parent reply	other threads:[~2024-04-08 14:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-08 14:48 [PATCH v3 0/4] bcachefs: fiemap delalloc support and cleanup Brian Foster
2024-04-08 14:48 ` [PATCH v3 1/4] bcachefs: drop duplicate fiemap sync flag Brian Foster
2024-04-08 14:48 ` Brian Foster [this message]
2024-04-08 14:48 ` [PATCH v3 3/4] bcachefs: refactor fiemap processing into extent helper and struct Brian Foster
2024-04-08 14:48 ` [PATCH v3 4/4] bcachefs: add fiemap delalloc extent detection Brian Foster
2024-04-18 14:46   ` Brian Foster
2024-04-20  2:02     ` Kent Overstreet
2024-04-09  3:33 ` [PATCH v3 0/4] bcachefs: fiemap delalloc support and cleanup Kent Overstreet
2024-04-09 12:21   ` Brian Foster

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=20240408144846.1001243-3-bfoster@redhat.com \
    --to=bfoster@redhat.com \
    --cc=linux-bcachefs@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