Skip to content

btrfs: block group cleanups

Josef Bacik linux-btrfs 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest9 patches 2 repliesIn review
  2. v29 patches 1 replySuperseded
  3. v15 patches 4 repliesSuperseded

Changes in v3 from the cover letter

- I removed a check for FS_OPEN in the first patch which was incorrect.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9btrfs: use btrfs_fs_closing for background bg workfs/btrfs/block-group.c+6 -00 replies
2/9btrfs: simplify btrfs_update_space_infofs/btrfs/block-group.c fs/btrfs/space-info.c fs/btrfs/space-info.h+28 -360 replies
3/9btrfs: handle space_info setting of bg in btrfs_add_bg_to_space_infofs/btrfs/block-group.c fs/btrfs/space-info.c fs/btrfs/space-info.h+13 -280 replies
4/9btrfs: convert block group bit field to use bit helpersfs/btrfs/block-group.c fs/btrfs/block-group.h fs/btrfs/dev-replace.c +6 more+82 -561 reply
5/9btrfs: remove block_group->lock protection for TO_COPYfs/btrfs/dev-replace.c fs/btrfs/scrub.c fs/btrfs/volumes.c+0 -100 replies
6/9btrfs: simplify btrfs_put_block_group_cachefs/btrfs/block-group.c+15 -270 replies
7/9btrfs: remove BLOCK_GROUP_FLAG_HAS_CACHING_CTLfs/btrfs/block-group.c fs/btrfs/block-group.h+21 -260 replies
8/9btrfs: remove bg->lock protection for relocation repair flagfs/btrfs/volumes.c+0 -30 replies
9/9btrfs: delete btrfs_wait_space_cache_v1_finishedfs/btrfs/block-group.c fs/btrfs/block-group.h+1 -90 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/9] btrfs: block group cleanups

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(-)
Signature · 1 line
2.26.3