Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

btrfs-progs: rename "sector size" to "block size" #930

Open
wants to merge 4 commits into
base: devel
Choose a base branch
from

Conversation

adam900710
Copy link
Collaborator

Since day 1 of btrfs, we use the name "sector size" to indicate the
minimum data unit size (from btrfs_super_block::sectorsize).

But all other file systems use "block size" to indicate the minimum data
unit size, and inside kernel, a sector is used to describe the minimal
IO block size for a block device.
Furthermore kernel sector size is fixed to 512, and different block
devices have different sector sizes, from the older 512 sector sized
HDDs, to modern day flash devices that are even pushing for 16K sector
size.

This has brought quite some confusiong when we need to co-operate with
other fs/mm people.

I believe it's time to do the migration for btrfs-progs first, then do
it inside the kernel, before we're pushing for iomap support.

This will change all usage of btrfs_fs_info::sectorsize to
btrfs_fs_info::blocksize.

There are some extra changes involved:

- Rename csum_tree_block_size()'s @csum_sectorsize to @csum_size
  In fact @csum_sectorsize is only used in the declaration, and the
  implementation is already using @csum_size instead.

- Involved comments and simple function/variable names

- btrfs_free_space_ctrl::sectorsize to blocksize

- btrfs_mkfs_config::sectorsize to blocksize

The following one is not changed yet, as it is part of on-disk format,
thus will be changed in a dedicate patch.

- btrfs_super_block::sectorsize

The following one will not be changed:

- btrfs_chunk::sector_size
- btrfs_device_item::sector_size

As "sector size" is correct terminology for minimum block IO size for a
device.

Signed-off-by: Qu Wenruo <[email protected]>
"--sectorsize"

Btrfs uses the terminology "sectorsize" for the minimum data allocation
size, which is very different from other filesystems, and can be a
little confusing with the kernel block io sector size (which is the
minimum block io size, and is fixed to 512 bytes).

Let's start migrating mkfs.btrfs and its documentation to use the more
common terminology instead.

Signed-off-by: Qu Wenruo <[email protected]>
"blocksize"

To align with other filesystems, with extra mentioning of the older
"sectorsize" terminology to reduce confusion.

Signed-off-by: Qu Wenruo <[email protected]>
This on-disk format rename is to keep the terminology aligned to other
filesystems.

Signed-off-by: Qu Wenruo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant