mbox series

[v3,0/9] btrfs: block group cleanups

Message ID cover.1659708822.git.josef@toxicpanda.com (mailing list archive)
Headers show
Series btrfs: block group cleanups | expand

Message

Josef Bacik Aug. 5, 2022, 2:14 p.m. UTC
v2->v3:
- I removed a check for FS_OPEN in the first patch which was incorrect.

v1->v2:
- I'm an idiot and didn't rebase properly, so adding the two other cleanups I
  had that I didn't send.
- Rebased onto a recent misc-next and fixed the compile errors.
- Realized that with the new zoned patches that caused the compile error that
  btrfs_update_space_info needed to be cleaned up, so added patches for that.

--- Original email ---

I'm reworking our relocation and delete unused block group workqueues which
require some cleanups of how we deal with flags on the block group.  We've had a
bit field for various flags on the block group for a while, but there's a subtle
gotcha with this bitfield in that you have to protect every modification with
bg->lock in order to not mess with the values, and there were a few places that
we weren't holding the lock.

Rework these to be normal flags, and then go behind this conversion and cleanup
some of the usage of the different flags.  Additionally there's a cleanup around
when to break out of the background workers.  Thanks,

Josef

Josef Bacik (9):
  btrfs: use btrfs_fs_closing for background bg work
  btrfs: simplify btrfs_update_space_info
  btrfs: handle space_info setting of bg in btrfs_add_bg_to_space_info
  btrfs: convert block group bit field to use bit helpers
  btrfs: remove block_group->lock protection for TO_COPY
  btrfs: simplify btrfs_put_block_group_cache
  btrfs: remove BLOCK_GROUP_FLAG_HAS_CACHING_CTL
  btrfs: remove bg->lock protection for relocation repair flag
  btrfs: delete btrfs_wait_space_cache_v1_finished

 fs/btrfs/block-group.c      | 158 ++++++++++++++----------------------
 fs/btrfs/block-group.h      |  21 ++---
 fs/btrfs/dev-replace.c      |  11 +--
 fs/btrfs/extent-tree.c      |   7 +-
 fs/btrfs/free-space-cache.c |  18 ++--
 fs/btrfs/scrub.c            |  16 ++--
 fs/btrfs/space-info.c       |  38 +++++----
 fs/btrfs/space-info.h       |   6 +-
 fs/btrfs/volumes.c          |  16 ++--
 fs/btrfs/zoned.c            |  34 +++++---
 10 files changed, 148 insertions(+), 177 deletions(-)

Comments

David Sterba Aug. 5, 2022, 4:37 p.m. UTC | #1
On Fri, Aug 05, 2022 at 10:14:51AM -0400, Josef Bacik wrote:
> v2->v3:
> - I removed a check for FS_OPEN in the first patch which was incorrect.

V3 replaced in misc-next, thanks.