Go to file
Thomas Bertschinger b2824ebac1 bch_bindgen: fix packed and aligned structs on i686, ppc64
This patch addresses build issues with bch_bindgen on architectures
where the natural alignment of u64 is 4 instead of 8, such as i686 and
ppc64. The issue arises from rustc's refusing to compile structs with a
"packed" attribute that have members with an explicit "align(N)"
attribute.

rust-bindgen generally does not place "align(N)" attributes on types
when it is redundant with the type's natural alignment. There are a few
types in bcachefs with "__aligned(8)" in C where the type's natural
alignment is 8 except on architectures like those mentioned above where
it is 4. rust-bindgen places the "align(8)" attribute on these types,
for those architectures. The affected types include:

- bch_csum
- bch_sb_layout
- bch_ioctl_data_progress

bch_ioctl_data_progress, and all types that depend on it, are not used
on the Rust side currently and bindings are only generated for them
because they are covered by `.allowlist_type("bch_.*")` in
bch_bindgen/build.rs. This patch resolves the build failure for this
type by excluding it from bch_bindgen. If/when accessing this type in
Rust is needed, a decision can be made then about how to represent its
layout in Rust.

bch_csum and bch_sb_layout, and types that depend on them, are currently
used in Rust so they can't be excluded. This patch addresses these types
by stripping off the "packed" attribute in Rust on types that embed
these types, since that attribute happens to not be necessary for proper
layout.

Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-02-17 13:38:09 -05:00
.github move Rust sources to top level, C sources into c_src 2024-01-16 01:47:05 -05:00
bch_bindgen bch_bindgen: fix packed and aligned structs on i686, ppc64 2024-02-17 13:38:09 -05:00
c_src Merge pull request #211 from oz123/master 2024-02-16 01:53:37 -05:00
ccan Move c_src dirs back to toplevel 2024-01-16 17:17:23 -05:00
debian fix packaging 2023-12-10 12:16:00 -05:00
doc Add additional information about encryption 2023-07-10 16:03:30 -04:00
fsck fix fsck service location 2024-01-11 23:55:39 -08:00
include Update bcachefs sources to 9a555a741e80 bcachefs: omit alignment attribute on big endian struct bkey 2024-02-15 23:45:29 -05:00
initramfs Make initramfs hook install mount.bcachefs 2024-02-04 14:44:54 +01:00
libbcachefs Update bcachefs sources to 9a555a741e80 bcachefs: omit alignment attribute on big endian struct bkey 2024-02-15 23:45:29 -05:00
linux Update bcachefs sources to bee7b5a4fa21 bcachefs: Pin btree cache in ram for random access in fsck 2024-02-09 21:32:46 -05:00
packaging packaging: Update RPM spec to use %_libexecdir for libexec files 2023-12-24 09:09:56 -05:00
raid Move c_src dirs back to toplevel 2024-01-16 17:17:23 -05:00
src feat: add aliases for a few subcommands 2024-02-09 17:37:01 +08:00
tests move Rust sources to top level, C sources into c_src 2024-01-16 01:47:05 -05:00
udev fix udev rules path 2023-12-06 15:41:05 -05:00
.bcachefs_revision Update bcachefs sources to 9a555a741e80 bcachefs: omit alignment attribute on big endian struct bkey 2024-02-15 23:45:29 -05:00
.editorconfig nix: overhaul build system. 2023-01-03 16:58:55 +13:00
.gitignore Add bcachefs command compatibility symlink 2024-01-29 14:29:35 +01:00
bcachefs Add bcachefs command compatibility symlink 2024-01-29 14:29:35 +01:00
bcachefs.8 man: Fix cmd-option format 2023-11-27 21:04:03 -05:00
build.nix use upstream bindgen; fix packed and aligned types 2024-01-23 13:08:12 -05:00
build.rs Move c_src dirs back to toplevel 2024-01-16 17:17:23 -05:00
Cargo.lock Replace atty with stdlib 2024-02-07 21:27:35 +01:00
Cargo.toml Replace atty with stdlib 2024-02-07 21:27:35 +01:00
COPYING
default.nix nix: fix build add overlay and formatter to flake 2023-11-09 22:09:33 +01:00
flake.lock nix: fix build add overlay and formatter to flake 2023-11-09 22:09:33 +01:00
flake.nix nix: add bcachefs-fuse package 2023-11-20 15:13:17 -05:00
INSTALL.md docs: add llvm-config dependency for arch, fedora 2023-12-19 19:52:37 -05:00
make-release-tarball.sh move Rust sources to top level, C sources into c_src 2024-01-16 01:47:05 -05:00
Makefile Update bcachefs sources to 50847e296b34 bcachefs: Check subvol <-> inode pointers in check_inode() 2024-02-06 01:07:16 -05:00
Makefile.compiler Update bcachefs sources to f9c612bbf82d bcachefs: Fixes for building in userspace 2023-09-23 20:03:23 -04:00
mount.bcachefs.sh
README.md doc(versioning): document version semantics of this project 2024-01-26 21:04:45 -05:00
rustfmt.toml move Rust sources to top level, C sources into c_src 2024-01-16 01:47:05 -05:00

bcachefs-tools

Userspace tools and docs for bcachefs

Bcachefs is an advanced new filesystem for Linux, with an emphasis on reliability and robustness and the complete set of features one would expect from a modern filesystem.

This repo primarily consists of the following:

  • bcachefs tool, the reason this repo exists.
  • {mkfs,mount,fsck}.bcachefs utils, which is just wrappers calling the corresponding subcommands in the main tool
  • docs in the form of man-pages and a user manual

Please refer to the main site for getting started An in-depth user manual is (also) found on the official website

Version semantics

The tools relies on an expected disk format structure which is reflected by your current kernel version. Disk format can be upgraded or downgraded automatically by the kernel, if needed.

  • Any patch-level change means no disk format change
  • Any minor-level change means a potential disk format change which is not breaking
  • Any major-level change means breaking changes

Build and install

Refer to INSTALL.md

Bug reports and contributions