From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 00/18] btrfs: migrate to "block size" to describe the
Date: Wed, 18 Dec 2024 20:11:16 +1030 [thread overview]
Message-ID: <cover.1734514696.git.wqu@suse.com> (raw)
[BACKGROUND]
Since day 1, btrfs uses a different terminology, sector size, to
describe the minimum data block size.
Meanwhile all other filesystems (ext4, xfs, jfs, bcachefs, reiserfs) are
using "block size" to describe the same unit.
Furthermore, kernel itself has its own sector size, fixed to 512 bytes,
as the minimal block IO unit.
This will cause extra confusiong when we're talking with other MM/FS
developers.
[IMPEMENTATION]
To reduce the confusion, this patchset will do such a huge migration in
different steps:
- Introduce btrfs_fs_info::blocksize as an alias for
btrfs_fs_info::sectorsize
This is done by introducing an anonymous union, allowing @sectorsize
and @blocksize to share the same value, and do the migration on a
per-file basis.
This covers @blocsize, @blocksize_bits, @blocks_per_page.
- Rename involved users, comments and local variables
- Rename related function names, parameters and even some macros
This affects scrub and raid56 most, as I follow the strict "sector"
terminology when reworking on those functionality.
Thus they will receive very heavy renames.
- Finish the btrfs_fs_info::sectorsize rename
- Add btrfs_super_block::blocksize as an alias for sectorsize
- Add btrfs_ioctl_fs_info_args::blocksize as an alias for sectorsize
Unlike the btrfs_fs_info::blocksize change which is purely inside
btrfs, those structures are exported as on-disk format and ioctl
parameters.
To keep the compatibility for older programs which may never update
their code, make @blocksize and @sectorsize co-exist as unions, to
avoid breakage for older programs.
Qu Wenruo (18):
btrfs: rename btrfs_fs_info::sectorsize to blocksize for disk-io.c
btrfs: migrate subpage.[ch] to use block size terminology
btrfs: migrate tree-checker.c to use block size terminology
btrfs: migrate scrub.c to use block size terminology
btrfs: migrate extent_io.[ch] to use block size terminology
btrfs: migrate compression related code to use block size terminology
btrfs: migrate free space cache code to use block size terminology
btrfs: migrate file-item.c to use block size terminology
btrfs: migrate file.c to use block size terminology
btrfs: migrate inode.c and btrfs_inode.h to use block size terminology
btrfs: migrate raid56.[ch] to use block size terminology
btrfs: migrate defrag.c to use block size terminology
btrfs: migrate bio.[ch] to use block size terminology
btrfs: migrate the remaining sector size users to use block size
terminology
btrfs: migrate selftests to use block size terminology
btrfs: finish the rename of btrfs_fs_info::sectorsize
btrfs: migrate btrfs_super_block::sectorsize to blocksize
btrfs: migrate the ioctl interfaces to use block size terminology
fs/btrfs/accessors.h | 6 +-
fs/btrfs/bio.c | 24 +-
fs/btrfs/bio.h | 4 +-
fs/btrfs/block-group.c | 4 +-
fs/btrfs/btrfs_inode.h | 2 +-
fs/btrfs/compression.c | 30 +-
fs/btrfs/defrag.c | 52 +-
fs/btrfs/delalloc-space.c | 26 +-
fs/btrfs/delayed-inode.c | 2 +-
fs/btrfs/delayed-ref.c | 12 +-
fs/btrfs/delayed-ref.h | 4 +-
fs/btrfs/dev-replace.c | 12 +-
fs/btrfs/direct-io.c | 6 +-
fs/btrfs/disk-io.c | 82 +--
fs/btrfs/extent-tree.c | 14 +-
fs/btrfs/extent_io.c | 124 ++--
fs/btrfs/extent_io.h | 16 +-
fs/btrfs/extent_map.h | 2 +-
fs/btrfs/fiemap.c | 6 +-
fs/btrfs/file-item.c | 94 +--
fs/btrfs/file.c | 138 ++--
fs/btrfs/free-space-cache.c | 8 +-
fs/btrfs/free-space-tree.c | 28 +-
fs/btrfs/fs.h | 19 +-
fs/btrfs/inode-item.c | 8 +-
fs/btrfs/inode.c | 140 ++--
fs/btrfs/ioctl.c | 14 +-
fs/btrfs/lzo.c | 80 +--
fs/btrfs/print-tree.c | 14 +-
fs/btrfs/qgroup.c | 10 +-
fs/btrfs/qgroup.h | 2 +-
fs/btrfs/raid56.c | 810 ++++++++++++------------
fs/btrfs/raid56.h | 36 +-
fs/btrfs/reflink.c | 22 +-
fs/btrfs/relocation.c | 16 +-
fs/btrfs/scrub.c | 442 ++++++-------
fs/btrfs/send.c | 36 +-
fs/btrfs/subpage.c | 92 +--
fs/btrfs/subpage.h | 8 +-
fs/btrfs/super.c | 10 +-
fs/btrfs/sysfs.c | 4 +-
fs/btrfs/tests/btrfs-tests.c | 38 +-
fs/btrfs/tests/btrfs-tests.h | 18 +-
fs/btrfs/tests/delayed-refs-tests.c | 4 +-
fs/btrfs/tests/extent-buffer-tests.c | 8 +-
fs/btrfs/tests/extent-io-tests.c | 34 +-
fs/btrfs/tests/free-space-tests.c | 104 +--
fs/btrfs/tests/free-space-tree-tests.c | 28 +-
fs/btrfs/tests/inode-tests.c | 266 ++++----
fs/btrfs/tests/qgroup-tests.c | 12 +-
fs/btrfs/tests/raid-stripe-tree-tests.c | 8 +-
fs/btrfs/tree-checker.c | 100 +--
fs/btrfs/tree-log.c | 6 +-
fs/btrfs/volumes.c | 26 +-
fs/btrfs/zlib.c | 2 +-
fs/btrfs/zoned.c | 6 +-
fs/btrfs/zstd.c | 6 +-
include/uapi/linux/btrfs.h | 21 +-
include/uapi/linux/btrfs_tree.h | 13 +-
59 files changed, 1590 insertions(+), 1569 deletions(-)
--
2.47.1
next reply other threads:[~2024-12-18 9:42 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-18 9:41 Qu Wenruo [this message]
2024-12-18 9:41 ` [PATCH 01/18] btrfs: rename btrfs_fs_info::sectorsize to blocksize for disk-io.c Qu Wenruo
2024-12-18 9:41 ` [PATCH 02/18] btrfs: migrate subpage.[ch] to use block size terminology Qu Wenruo
2024-12-18 9:41 ` [PATCH 03/18] btrfs: migrate tree-checker.c " Qu Wenruo
2024-12-18 9:41 ` [PATCH 04/18] btrfs: migrate scrub.c " Qu Wenruo
2024-12-18 9:41 ` [PATCH 05/18] btrfs: migrate extent_io.[ch] " Qu Wenruo
2024-12-18 9:41 ` [PATCH 06/18] btrfs: migrate compression related code " Qu Wenruo
2024-12-18 9:41 ` [PATCH 07/18] btrfs: migrate free space cache " Qu Wenruo
2024-12-18 9:41 ` [PATCH 08/18] btrfs: migrate file-item.c " Qu Wenruo
2024-12-18 9:41 ` [PATCH 09/18] btrfs: migrate file.c " Qu Wenruo
2024-12-18 9:41 ` [PATCH 10/18] btrfs: migrate inode.c and btrfs_inode.h " Qu Wenruo
2024-12-18 9:41 ` [PATCH 11/18] btrfs: migrate raid56.[ch] " Qu Wenruo
2024-12-18 9:41 ` [PATCH 12/18] btrfs: migrate defrag.c " Qu Wenruo
2024-12-18 9:41 ` [PATCH 13/18] btrfs: migrate bio.[ch] " Qu Wenruo
2024-12-18 9:41 ` [PATCH 14/18] btrfs: migrate the remaining sector size users " Qu Wenruo
2024-12-18 9:41 ` [PATCH 15/18] btrfs: migrate selftests " Qu Wenruo
2024-12-18 9:41 ` [PATCH 16/18] btrfs: finish the rename of btrfs_fs_info::sectorsize Qu Wenruo
2024-12-18 9:41 ` [PATCH 17/18] btrfs: migrate btrfs_super_block::sectorsize to blocksize Qu Wenruo
2024-12-18 9:41 ` [PATCH 18/18] btrfs: migrate the ioctl interfaces to use block size terminology Qu Wenruo
2024-12-18 18:31 ` [PATCH 00/18] btrfs: migrate to "block size" to describe the David Sterba
2024-12-18 20:13 ` Qu Wenruo
2024-12-18 20:36 ` David Sterba
2024-12-18 21:15 ` Qu Wenruo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1734514696.git.wqu@suse.com \
--to=wqu@suse.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox