mbox series

[0/5,v2] Struct to fs_info helpers

Message ID cover.1706810422.git.dsterba@suse.com (mailing list archive)
Headers show
Series Struct to fs_info helpers | expand

Message

David Sterba Feb. 1, 2024, 6:02 p.m. UTC
v2:

- move helper definitions to fs.h
- add _Generic to the macros for type checking
- reuse helpers to some code duplication

Add convenience helpers for getting a fs_info from page, bio, inode etc.
There's one prep patch where tests use a normal helper that expects
valid inode->root->fs_info.

David Sterba (5):
  btrfs: tests: allocate dummy fs_info and root in test_find_delalloc()
  btrfs: add helpers to get inode from page/folio pointers
  btrfs: add helpers to get fs_info from page/folio pointers
  btrfs: add helper to get fs_info from struct inode pointer
  btrfs: hoist fs_info out of loops in end_bbio_data_write and
    end_bbio_data_read

 fs/btrfs/compression.c           |  8 +++---
 fs/btrfs/defrag.c                |  4 +--
 fs/btrfs/disk-io.c               | 11 ++++----
 fs/btrfs/export.c                |  2 +-
 fs/btrfs/extent_io.c             | 45 ++++++++++++++++----------------
 fs/btrfs/file.c                  | 14 +++++-----
 fs/btrfs/free-space-cache.c      |  2 +-
 fs/btrfs/fs.h                    | 11 ++++++++
 fs/btrfs/inode.c                 | 42 ++++++++++++++---------------
 fs/btrfs/ioctl.c                 | 40 ++++++++++++++--------------
 fs/btrfs/lzo.c                   |  4 +--
 fs/btrfs/props.c                 |  2 +-
 fs/btrfs/reflink.c               |  6 ++---
 fs/btrfs/relocation.c            |  2 +-
 fs/btrfs/tests/extent-io-tests.c | 28 +++++++++++++++++---
 15 files changed, 126 insertions(+), 95 deletions(-)

Comments

Johannes Thumshirn Feb. 2, 2024, 12:10 p.m. UTC | #1
On 01.02.24 19:07, David Sterba wrote:
> v2:
> 
> - move helper definitions to fs.h
> - add _Generic to the macros for type checking
> - reuse helpers to some code duplication
> 
> Add convenience helpers for getting a fs_info from page, bio, inode etc.
> There's one prep patch where tests use a normal helper that expects
> valid inode->root->fs_info.
> 
> David Sterba (5):
>    btrfs: tests: allocate dummy fs_info and root in test_find_delalloc()
>    btrfs: add helpers to get inode from page/folio pointers
>    btrfs: add helpers to get fs_info from page/folio pointers
>    btrfs: add helper to get fs_info from struct inode pointer
>    btrfs: hoist fs_info out of loops in end_bbio_data_write and
>      end_bbio_data_read
> 
>   fs/btrfs/compression.c           |  8 +++---
>   fs/btrfs/defrag.c                |  4 +--
>   fs/btrfs/disk-io.c               | 11 ++++----
>   fs/btrfs/export.c                |  2 +-
>   fs/btrfs/extent_io.c             | 45 ++++++++++++++++----------------
>   fs/btrfs/file.c                  | 14 +++++-----
>   fs/btrfs/free-space-cache.c      |  2 +-
>   fs/btrfs/fs.h                    | 11 ++++++++
>   fs/btrfs/inode.c                 | 42 ++++++++++++++---------------
>   fs/btrfs/ioctl.c                 | 40 ++++++++++++++--------------
>   fs/btrfs/lzo.c                   |  4 +--
>   fs/btrfs/props.c                 |  2 +-
>   fs/btrfs/reflink.c               |  6 ++---
>   fs/btrfs/relocation.c            |  2 +-
>   fs/btrfs/tests/extent-io-tests.c | 28 +++++++++++++++++---
>   15 files changed, 126 insertions(+), 95 deletions(-)
> 

For the series,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Anand Jain Feb. 2, 2024, 12:45 p.m. UTC | #2
>    btrfs: tests: allocate dummy fs_info and root in test_find_delalloc()
>    btrfs: add helpers to get inode from page/folio pointers
>    btrfs: add helpers to get fs_info from page/folio pointers
>    btrfs: add helper to get fs_info from struct inode pointer
>    btrfs: hoist fs_info out of loops in end_bbio_data_write and
>      end_bbio_data_read


Looks good.

Reviewed-by: Anand Jain <anand.jain@oracle.com>

Thx.