public inbox for linux-bcachefs@vger.kernel.org
 help / color / mirror / Atom feed
From: Alan Huang <mmpgouride@gmail.com>
To: kent.overstreet@linux.dev
Cc: linux-bcachefs@vger.kernel.org, Alan Huang <mmpgouride@gmail.com>
Subject: [PATCH 3/4] bcachefs: Remove spurious +1/-1 operation
Date: Tue, 15 Apr 2025 13:33:06 +0800	[thread overview]
Message-ID: <20250415053307.81354-4-mmpgouride@gmail.com> (raw)
In-Reply-To: <20250415053307.81354-1-mmpgouride@gmail.com>

Signed-off-by: Alan Huang <mmpgouride@gmail.com>
---
 fs/bcachefs/btree_types.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/bcachefs/btree_types.h b/fs/bcachefs/btree_types.h
index dd109dea0f1c..c2e05824e99b 100644
--- a/fs/bcachefs/btree_types.h
+++ b/fs/bcachefs/btree_types.h
@@ -656,13 +656,13 @@ static inline struct bset_tree *bset_tree_last(struct btree *b)
 static inline void *
 __btree_node_offset_to_ptr(const struct btree *b, u16 offset)
 {
-	return (void *) ((u64 *) b->data + 1 + offset);
+	return (void *) ((u64 *) b->data + offset);
 }
 
 static inline u16
 __btree_node_ptr_to_offset(const struct btree *b, const void *p)
 {
-	u16 ret = (u64 *) p - 1 - (u64 *) b->data;
+	u16 ret = (u64 *) p - (u64 *) b->data;
 
 	EBUG_ON(__btree_node_offset_to_ptr(b, ret) != p);
 	return ret;
-- 
2.48.1


  parent reply	other threads:[~2025-04-15  5:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-15  5:33 [PATCH 0/4] bcachefs: Random cleanup Alan Huang
2025-04-15  5:33 ` [PATCH 1/4] bcachefs: Kill bch2_trans_unlock_noassert Alan Huang
2025-04-15 14:34   ` Kent Overstreet
2025-04-15  5:33 ` [PATCH 2/4] bcachefs: mark_btree_node_locked_noreset -> mark_btree_node_locked_reset Alan Huang
2025-04-15 14:34   ` Kent Overstreet
2025-04-15 14:40     ` Alan Huang
2025-04-15 15:10       ` Kent Overstreet
2025-04-15  5:33 ` Alan Huang [this message]
2025-04-15 14:35   ` [PATCH 3/4] bcachefs: Remove spurious +1/-1 operation Kent Overstreet
2025-04-15  5:33 ` [PATCH 4/4] bcachefs: Simplify logic Alan Huang
2025-04-15 14:36   ` Kent Overstreet

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=20250415053307.81354-4-mmpgouride@gmail.com \
    --to=mmpgouride@gmail.com \
    --cc=kent.overstreet@linux.dev \
    --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