Skip to content

btrfs: ctree.he refactor

Qu Wenruo linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3btrfs: move the remaining on-disk format to ondisk_format.hfs/btrfs/ctree.h fs/btrfs/ondisk_format.h+224 -2090 replies
2/3btrfs: move the BTRFS_SETGET_* functions to dedicated headerfs/btrfs/accessors.h fs/btrfs/ctree.h+1005 -9660 replies
3/3btrfs: move btrfs_printk() related macros to messages.hfs/btrfs/ctree.h fs/btrfs/messages.h+171 -1620 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJosef Bacik
SeriesR-b
1/3
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] btrfs: ctree.he refactor

Btrfs is abusing ctree.h for almost everything which doesn't have a better location to put its definitions.

This makes ctree.h super congested for both kernel and btrfs-progs.

Here is just several cleanups inspired by my WIP btrfs-fuse project.

Currently my read-only (and still WIP) btrfs-fuse only has a ctree.h with less than 100 lines.
The read-only project is definitely going to be much smaller than kernel, but there are several tricks I used to make ctree.h slim:

- Put ondisk-format into ondisk_format.h
- Put BTRFS_SET_GET_* macros into accessors.h
- Put message output functions into messages.h

So we will only really high level structure definitions in ctree.h

Unfortunately for kernel, we still have tons of function definitions, which don't have proper headers for them.

But this is still a good direction to go.

Of course, any advice on the names of these new headers will be very helpful.

Qu Wenruo (3):
btrfs: move the remaining on-disk format to ondisk_format.h
btrfs: move the BTRFS_SETGET_* functions to dedicated header
btrfs: move btrfs_printk() related macros to messages.h

 fs/btrfs/accessors.h     | 1004 ++++++++++++++++++++++++++++
 fs/btrfs/ctree.h         | 1340 +-------------------------------------
 fs/btrfs/messages.h      |  170 +++++
 fs/btrfs/ondisk_format.h |  223 +++++++
 4 files changed, 1400 insertions(+), 1337 deletions(-)
 create mode 100644 fs/btrfs/accessors.h
 create mode 100644 fs/btrfs/messages.h
 create mode 100644 fs/btrfs/ondisk_format.h
Signature · 1 line
2.33.1