All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Josef Bacik <josef@toxicpanda.com>
Cc: linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH 0/7] Cleanup btrfs_item_* related helpers
Date: Mon, 8 Nov 2021 20:30:37 +0100	[thread overview]
Message-ID: <20211108193037.GK28560@twin.jikos.cz> (raw)
In-Reply-To: <cover.1634842475.git.josef@toxicpanda.com>

On Thu, Oct 21, 2021 at 02:58:30PM -0400, Josef Bacik wrote:
> Hello,
> 
> We've got a lot of odd patterns with our btrfs_item* helpers.  In a lot of
> places we use teh btrfs_item_*_nr() helpers, in some places we get the
> btrfs_item and then use the direct helpers on that.  Our btrfs_item_key()
> helpers only take the slot.
> 
> Fix this up by using a leaf+slot combination everywhere, and only use the offset
> calculations in the helpers.
> 
> This gives us a net deletion of about 40 lines, and also allows me to more
> easily change the btrfs_item math when I change the size of btrfs_header in the
> future without needing to update all the callsites to pass in an extent buffer.
> 
> Thanks,
> 
> Josef Bacik (7):
>   btrfs: use btrfs_item_size_nr/btrfs_item_offset_nr everywhere
>   btrfs: add btrfs_set_item_*_nr() helpers
>   btrfs: make btrfs_file_extent_inline_item_len take a slot
>   btrfs: introduce item_nr token variant helpers
>   btrfs: drop the _nr from the item helpers
>   btrfs: remove the btrfs_item_end() helper
>   btrfs: rename btrfs_item_end_nr to btrfs_item_data_end

Added to misc-next, thanks. It's a big conflict surface but hopefully
all incorrect uses of the helpers in the old/new code should be caught
by a mismatching types of the parameters.

      parent reply	other threads:[~2021-11-08 19:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-21 18:58 [PATCH 0/7] Cleanup btrfs_item_* related helpers Josef Bacik
2021-10-21 18:58 ` [PATCH 1/7] btrfs: use btrfs_item_size_nr/btrfs_item_offset_nr everywhere Josef Bacik
2021-10-21 23:26   ` Qu Wenruo
2021-10-21 18:58 ` [PATCH 2/7] btrfs: add btrfs_set_item_*_nr() helpers Josef Bacik
2021-10-21 18:58 ` [PATCH 3/7] btrfs: make btrfs_file_extent_inline_item_len take a slot Josef Bacik
2021-10-21 18:58 ` [PATCH 4/7] btrfs: introduce item_nr token variant helpers Josef Bacik
2021-10-21 18:58 ` [PATCH 5/7] btrfs: drop the _nr from the item helpers Josef Bacik
2021-10-21 18:58 ` [PATCH 6/7] btrfs: remove the btrfs_item_end() helper Josef Bacik
2021-10-21 18:58 ` [PATCH 7/7] btrfs: rename btrfs_item_end_nr to btrfs_item_data_end Josef Bacik
2021-11-08 19:30 ` David Sterba [this message]

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=20211108193037.GK28560@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=josef@toxicpanda.com \
    --cc=kernel-team@fb.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.