The layout may be unaligned on 4k sector devices - but there's no reason
we need to use direct IO here.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
The option code has been switching to keeping things in display units -
bytes - and this transitions more libbcachefs.c code to bytes as well,
to match, and also fixes device add.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Disk labels used to be called groups - not all uses had been converted.
This renames --group to --label, and --label to --fs_label
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
The device, data, fs, and subvolume subcommands currently print out a
generic usage message. Make these more specific.
Signed-off-by: Brett Holman <bholman.devel@gmail.com>
Correct the operation name from 'journal-resize' to 'resize-journal' in the
bcachefs usage summary, matching the command that is actually implemented.
Fix the size argument so it isn't optional. Defaulting to the entire device
makes sense for 'device resize', to automatically expand the fs to fill the
block device. However, it is never meaningful (or possible) to expand the
journal to the full disk.
Signed-off-by: Chris Webb <chris@arachsys.com>
If a disk is absent, there is no way to remove it from the filesystem.
Add the possibility to remove devices by id, to allow removal of missing
disks.
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Tiering has been replaced by disk groups, but the usage message for
cmd_device_add was never updated to reflect this change. Replace the
tier option with group to fix the usage message.
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
This removes the implicit `-I libbcachefs` argument to $(CC), which in turn
requires a set of minor changes throughout the tools. There are two advantages
to this setup:
1) It is (arguably) easier to read, since the location of bcachefs includes
are easier to understand at a glance ("where does util.h live?")
2) It removes the need for a hack to include glibc's copy of
dirent.h explicitly via '/usr/include/dirent.h', because libbcachefs/
*also* has a dirent.h file and the compiler cannot disambiguate them.
This has some ramifications on systems where /usr/include may not
exist, such as NixOS.
Signed-off-by: Austin Seipp <aseipp@pobox.com>
Factor out bch2_pick_bucket_size() from the format code, and pick the
bucket size before picking the superblock location - that way we can
ensure the superblock gets its own bucket and doesn't trigger warnings
due to the allocation code noticing different types of data in the same
bucket.