mbox series

[00/21] btrfs: first batch of zoned cleanups

Message ID cover.1637745470.git.johannes.thumshirn@wdc.com (mailing list archive)
Headers show
Series btrfs: first batch of zoned cleanups | expand

Message

Johannes Thumshirn Nov. 24, 2021, 9:30 a.m. UTC
Here's a first batch of cleanups for the zoend code. It reduces the number of
calls to btrfs_is_zoned() outside of zoned.[ch] from 46 on misc-next to 33.

As I had to create a scrub.h file, I also moved the scrub related function
prototypes from ctree.h to scrub.h.

Johannes Thumshirn (21):
  btrfs: zoned: encapsulate inode locking for zoned relocation
  btrfs: zoned: simplify btrfs_check_meta_write_pointer
  btrfs: zoned: sink zone check into btrfs_repair_one_zone
  btrfs: zoned: it's pointless to check for REQ_OP_ZONE_APPEND and
    btrfs_is_zoned
  btrfs: zoned: move compatible fs flags check to zoned code
  btrfs: zoned: move mark_block_group_to_copy to zoned code
  btrfs: zoned: move btrfs_finish_block_group_to_copy to zoned code
  btrfs: zoned: move is_block_group_to_copy to zoned code
  btrfs: zoned: skip zoned check if block_group is marked as copy
  btrfs: move struct scrub_ctx to scrub.h
  btrfs: zoned: move fill_writer_pointer_gap to zoned code
  btrfs: zoned: sync_write_pointer_for_zoned to zoned code
  btrfs: make scrub_submit and scrub_wr_submit non-static
  btrfs: zoned: move sync_replace_for_zoned to zoned code
  btrfs: zoned: move finish_extent_writes_for_zoned to zoned code
  btrfs: move btrfs_scrub_dev() definition to scrub.h
  btrfs: move btrfs_scrub_pause() definition to scrub.h
  btrfs: move btrfs_scrub_continue() definition to scrub.h
  btrfs: move btrfs_scrub_cancel() definition to scrub.h
  btrfs: move btrfs_scrub_cancel_dev() definition to scrub.h
  btrfs: move btrfs_scrub_progress() definition to scrub.h

 fs/btrfs/ctree.h       |  10 --
 fs/btrfs/dev-replace.c | 182 +-----------------------
 fs/btrfs/dev-replace.h |   3 -
 fs/btrfs/disk-io.c     |   1 +
 fs/btrfs/extent_io.c   |  16 +--
 fs/btrfs/ioctl.c       |  13 +-
 fs/btrfs/scrub.c       | 187 +++++--------------------
 fs/btrfs/scrub.h       |  62 +++++++++
 fs/btrfs/super.c       |   1 +
 fs/btrfs/transaction.c |   1 +
 fs/btrfs/volumes.c     |  36 ++---
 fs/btrfs/volumes.h     |   2 +-
 fs/btrfs/zoned.c       | 306 ++++++++++++++++++++++++++++++++++++++---
 fs/btrfs/zoned.h       |  77 +++++++++++
 14 files changed, 483 insertions(+), 414 deletions(-)
 create mode 100644 fs/btrfs/scrub.h

Comments

Josef Bacik Nov. 24, 2021, 4:34 p.m. UTC | #1
On Wed, Nov 24, 2021 at 01:30:26AM -0800, Johannes Thumshirn wrote:
> Here's a first batch of cleanups for the zoend code. It reduces the number of
> calls to btrfs_is_zoned() outside of zoned.[ch] from 46 on misc-next to 33.
> 
> As I had to create a scrub.h file, I also moved the scrub related function
> prototypes from ctree.h to scrub.h.
> 
> Johannes Thumshirn (21):
>   btrfs: zoned: encapsulate inode locking for zoned relocation
>   btrfs: zoned: simplify btrfs_check_meta_write_pointer
>   btrfs: zoned: sink zone check into btrfs_repair_one_zone
>   btrfs: zoned: it's pointless to check for REQ_OP_ZONE_APPEND and
>     btrfs_is_zoned
>   btrfs: zoned: move compatible fs flags check to zoned code
>   btrfs: zoned: move mark_block_group_to_copy to zoned code
>   btrfs: zoned: move btrfs_finish_block_group_to_copy to zoned code
>   btrfs: zoned: move is_block_group_to_copy to zoned code
>   btrfs: zoned: skip zoned check if block_group is marked as copy
>   btrfs: move struct scrub_ctx to scrub.h
>   btrfs: zoned: move fill_writer_pointer_gap to zoned code
>   btrfs: zoned: sync_write_pointer_for_zoned to zoned code
>   btrfs: make scrub_submit and scrub_wr_submit non-static
>   btrfs: zoned: move sync_replace_for_zoned to zoned code
>   btrfs: zoned: move finish_extent_writes_for_zoned to zoned code
>   btrfs: move btrfs_scrub_dev() definition to scrub.h
>   btrfs: move btrfs_scrub_pause() definition to scrub.h
>   btrfs: move btrfs_scrub_continue() definition to scrub.h
>   btrfs: move btrfs_scrub_cancel() definition to scrub.h
>   btrfs: move btrfs_scrub_cancel_dev() definition to scrub.h
>   btrfs: move btrfs_scrub_progress() definition to scrub.h

These last six could have been a single patch but no sense in redoing it now.
Fix up that random return and you can add

Reviewed-by: Josef Bacik <josef@toxicpanda.com>

to the series, thanks,

Josef
Johannes Thumshirn Nov. 25, 2021, 9:58 a.m. UTC | #2
On 24/11/2021 17:34, Josef Bacik wrote:
>> Johannes Thumshirn (21):
>>   btrfs: zoned: encapsulate inode locking for zoned relocation
>>   btrfs: zoned: simplify btrfs_check_meta_write_pointer
>>   btrfs: zoned: sink zone check into btrfs_repair_one_zone
>>   btrfs: zoned: it's pointless to check for REQ_OP_ZONE_APPEND and
>>     btrfs_is_zoned
>>   btrfs: zoned: move compatible fs flags check to zoned code
>>   btrfs: zoned: move mark_block_group_to_copy to zoned code
>>   btrfs: zoned: move btrfs_finish_block_group_to_copy to zoned code
>>   btrfs: zoned: move is_block_group_to_copy to zoned code
>>   btrfs: zoned: skip zoned check if block_group is marked as copy
>>   btrfs: move struct scrub_ctx to scrub.h
>>   btrfs: zoned: move fill_writer_pointer_gap to zoned code
>>   btrfs: zoned: sync_write_pointer_for_zoned to zoned code
>>   btrfs: make scrub_submit and scrub_wr_submit non-static
>>   btrfs: zoned: move sync_replace_for_zoned to zoned code
>>   btrfs: zoned: move finish_extent_writes_for_zoned to zoned code
>>   btrfs: move btrfs_scrub_dev() definition to scrub.h
>>   btrfs: move btrfs_scrub_pause() definition to scrub.h
>>   btrfs: move btrfs_scrub_continue() definition to scrub.h
>>   btrfs: move btrfs_scrub_cancel() definition to scrub.h
>>   btrfs: move btrfs_scrub_cancel_dev() definition to scrub.h
>>   btrfs: move btrfs_scrub_progress() definition to scrub.h
> 
> These last six could have been a single patch but no sense in redoing it now.

I've squashed them into one patch.