All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] Cleanup btrfs_item_* related helpers
@ 2021-10-21 18:58 Josef Bacik
  2021-10-21 18:58 ` [PATCH 1/7] btrfs: use btrfs_item_size_nr/btrfs_item_offset_nr everywhere Josef Bacik
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Josef Bacik @ 2021-10-21 18:58 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

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

 fs/btrfs/backref.c                   |  16 ++-
 fs/btrfs/ctree.c                     | 148 +++++++++++----------------
 fs/btrfs/ctree.h                     |  55 ++++++----
 fs/btrfs/dev-replace.c               |   4 +-
 fs/btrfs/dir-item.c                  |  12 +--
 fs/btrfs/extent-tree.c               |  14 +--
 fs/btrfs/file-item.c                 |  24 ++---
 fs/btrfs/inode-item.c                |  14 ++-
 fs/btrfs/inode.c                     |   3 +-
 fs/btrfs/ioctl.c                     |   6 +-
 fs/btrfs/print-tree.c                |   8 +-
 fs/btrfs/props.c                     |   2 +-
 fs/btrfs/ref-verify.c                |   2 +-
 fs/btrfs/reflink.c                   |   2 +-
 fs/btrfs/relocation.c                |   2 +-
 fs/btrfs/root-tree.c                 |   4 +-
 fs/btrfs/scrub.c                     |   2 +-
 fs/btrfs/send.c                      |  18 ++--
 fs/btrfs/tests/extent-buffer-tests.c |  17 +--
 fs/btrfs/tree-checker.c              |  56 +++++-----
 fs/btrfs/tree-log.c                  |  34 +++---
 fs/btrfs/uuid-tree.c                 |  10 +-
 fs/btrfs/verity.c                    |   2 +-
 fs/btrfs/volumes.c                   |   6 +-
 fs/btrfs/xattr.c                     |   8 +-
 25 files changed, 215 insertions(+), 254 deletions(-)

-- 
2.26.3


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-11-08 19:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 0/7] Cleanup btrfs_item_* related helpers David Sterba

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.