]> git.sesse.net Git - bcachefs-tools-debian/log
bcachefs-tools-debian
10 months agoci: upgrade to checkout action v3
Alexander Fougner [Thu, 20 Jul 2023 19:35:47 +0000 (21:35 +0200)]
ci: upgrade to checkout action v3

v2 is deprecated

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
10 months ago.gitignore: replace travis with github-ci config
Jörg Thalheim [Sun, 18 Jun 2023 12:23:28 +0000 (19:23 +0700)]
.gitignore: replace travis with github-ci config

10 months agoadd dependabot config to keep github ci actions up-to-date
Jörg Thalheim [Sun, 18 Jun 2023 12:22:57 +0000 (19:22 +0700)]
add dependabot config to keep github ci actions up-to-date

10 months agoci: unpin nix install url
Jörg Thalheim [Sun, 18 Jun 2023 12:19:24 +0000 (19:19 +0700)]
ci: unpin nix install url

I don't think we no longer need this and the install-nix-action
is not compatible with it.

10 months agoci: bump install-nix-action/cachix to fix nixos build
Jörg Thalheim [Sun, 18 Jun 2023 12:14:49 +0000 (19:14 +0700)]
ci: bump install-nix-action/cachix to fix nixos build

Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
11 months agoUpdate bcachefs sources to e14d7c7195 bcachefs: Compression levels
Kent Overstreet [Tue, 11 Jul 2023 00:31:34 +0000 (20:31 -0400)]
Update bcachefs sources to e14d7c7195 bcachefs: Compression levels

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
11 months agoAdd additional information about encryption
Demi Marie Obenour [Sat, 10 Jun 2023 20:43:31 +0000 (16:43 -0400)]
Add additional information about encryption

This adds additional details about how encryption works in
bcachefs, along with a warning regarding snapshots.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
11 months agoUpdate bcachefs sources to 04f2d2ae5b bcachefs: Fix build error on weird gcc
Kent Overstreet [Mon, 10 Jul 2023 19:57:09 +0000 (15:57 -0400)]
Update bcachefs sources to 04f2d2ae5b bcachefs: Fix build error on weird gcc

11 months agoUpdate bcachefs sources to 070ec8d07b bcachefs: Snapshot depth, skiplist fields
Kent Overstreet [Mon, 10 Jul 2023 18:17:18 +0000 (14:17 -0400)]
Update bcachefs sources to 070ec8d07b bcachefs: Snapshot depth, skiplist fields

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
11 months agoUpdate bcachefs sources to fb39031ade bcachefs: bch2_sb_maybe_downgrade(), bch2_sb_up...
Kent Overstreet [Mon, 10 Jul 2023 16:23:51 +0000 (12:23 -0400)]
Update bcachefs sources to fb39031ade bcachefs: bch2_sb_maybe_downgrade(), bch2_sb_upgrade()

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
11 months agoUpdate bcachefs sources to 1e3ca87f7b bcachefs: bcachefs_metadata_version_major_minor
Kent Overstreet [Mon, 10 Jul 2023 05:44:55 +0000 (01:44 -0400)]
Update bcachefs sources to 1e3ca87f7b bcachefs: bcachefs_metadata_version_major_minor

11 months agoUpdate bcachefs sources to da7d42a9a2 bcachefs: Add new assertions for shutdown path
Kent Overstreet [Sun, 9 Jul 2023 19:16:50 +0000 (15:16 -0400)]
Update bcachefs sources to da7d42a9a2 bcachefs: Add new assertions for shutdown path

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
11 months agoUpdate bcachefs sources to 25de2b00dc bcachefs: Change check for invalid key types
Kent Overstreet [Fri, 7 Jul 2023 08:24:54 +0000 (04:24 -0400)]
Update bcachefs sources to 25de2b00dc bcachefs: Change check for invalid key types

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
11 months agoget_random_u32_below()
Kent Overstreet [Tue, 27 Jun 2023 23:45:40 +0000 (19:45 -0400)]
get_random_u32_below()

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
11 months agoUpdate bcachefs sources to 84f132d569 bcachefs: fsck: Break walk_inode() up into...
Kent Overstreet [Sat, 24 Jun 2023 16:50:52 +0000 (12:50 -0400)]
Update bcachefs sources to 84f132d569 bcachefs: fsck: Break walk_inode() up into multiple functions

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
11 months agoUpdate bcachefs sources to bca25b802d fixup! bcachefs: Fix bch2_check_discard_freespa...
Kent Overstreet [Sun, 18 Jun 2023 20:20:01 +0000 (16:20 -0400)]
Update bcachefs sources to bca25b802d fixup! bcachefs: Fix bch2_check_discard_freespace_key()

11 months agoUpdate bcachefs sources to 99175e5712 bcachefs: Fix bch2_check_discard_freespace_key()
Kent Overstreet [Sun, 18 Jun 2023 17:50:30 +0000 (13:50 -0400)]
Update bcachefs sources to 99175e5712 bcachefs: Fix bch2_check_discard_freespace_key()

11 months agoSwitch to CLOCK_MONOTONIC_COARSE
Kent Overstreet [Sun, 18 Jun 2023 18:31:59 +0000 (14:31 -0400)]
Switch to CLOCK_MONOTONIC_COARSE

CLOCK_MONOTONIC requires a syscall, and is much more expensive.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
12 months agobuild.nix: add instruction to keep cargoDeps hashes up-to-date
Jörg Thalheim [Fri, 16 Jun 2023 11:57:35 +0000 (13:57 +0200)]
build.nix: add instruction to keep cargoDeps hashes up-to-date

12 months agonix: replace deprecated cargo/rustc aliases with new version
Jörg Thalheim [Fri, 16 Jun 2023 06:17:00 +0000 (08:17 +0200)]
nix: replace deprecated cargo/rustc aliases with new version

12 months agoflake.lock: Update
Jörg Thalheim [Fri, 16 Jun 2023 06:14:10 +0000 (08:14 +0200)]
flake.lock: Update

This is needed so that nix-update can update cargo dependencies.

Flake lock file updates:

• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/b1f87ca164a9684404c8829b851c3586c4d9f089' (2023-02-25)
  → 'github:nixos/nixpkgs/0eeebd64de89e4163f4d3cf34ffe925a5cf67a05' (2023-06-12)
• Updated input 'utils':
    'github:numtide/flake-utils/3db36a8b464d0c4532ba1c7dda728f4576d6d073' (2023-02-13)
  → 'github:numtide/flake-utils/a1720a10a6cfe8234c0e93907ffe81be440f4cef' (2023-05-31)
• Added input 'utils/systems':
    'github:nix-systems/default/da67096a3b9bf56a91d16901293e51ba5b49a27e' (2023-04-09)

12 months agofix reading keys from non-tty inputs
Jörg Thalheim [Thu, 15 Jun 2023 17:08:41 +0000 (19:08 +0200)]
fix reading keys from non-tty inputs

read_password_from_tty doesn't have a fallback if input is a pipe.
This makes scripting and integration testing harder.

Noticed while updating our nixos integration test.

Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
12 months agoflake.nix: add missing bindgen output hash
Jörg Thalheim [Thu, 15 Jun 2023 17:05:45 +0000 (19:05 +0200)]
flake.nix: add missing bindgen output hash

Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
12 months agoUpdate bcachefs sources to 01d7ad6d95 bcachefs: snapshot_to_text() includes snapshot...
Kent Overstreet [Tue, 13 Jun 2023 19:06:46 +0000 (15:06 -0400)]
Update bcachefs sources to 01d7ad6d95 bcachefs: snapshot_to_text() includes snapshot tree

12 months agoUpdate bcachefs sources to ed6b7f81a7 six locks: Disable percpu read lock mode in...
Kent Overstreet [Sun, 11 Jun 2023 02:13:01 +0000 (22:13 -0400)]
Update bcachefs sources to ed6b7f81a7 six locks: Disable percpu read lock mode in userspace

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
12 months agocmd_fs_usage: Implement --help
Kent Overstreet [Sun, 11 Jun 2023 00:59:22 +0000 (20:59 -0400)]
cmd_fs_usage: Implement --help

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
12 months agoSort input file list
Bernhard M. Wiedemann [Thu, 8 Jun 2023 13:07:48 +0000 (15:07 +0200)]
Sort input file list

so that libbcachefs.so builds in a reproducible way
in spite of non-deterministic filesystem readdir order.

See https://reproducible-builds.org/ for why this is good.

12 months agoUpdate bcachefs sources to 7c0fe6f104 bcachefs: Fix bch2_fsck_ask_yn()
Kent Overstreet [Sun, 4 Jun 2023 22:10:23 +0000 (18:10 -0400)]
Update bcachefs sources to 7c0fe6f104 bcachefs: Fix bch2_fsck_ask_yn()

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
12 months agoUpdate bcachefs sources to 31c09369cd six locks: Fix an unitialized var
Kent Overstreet [Thu, 25 May 2023 21:52:28 +0000 (17:52 -0400)]
Update bcachefs sources to 31c09369cd six locks: Fix an unitialized var

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
12 months agoUpdate bcachefs sources to 799716df00 bcachefs: Delete an incorrect bch2_trans_unlock()
Kent Overstreet [Fri, 19 May 2023 13:50:11 +0000 (09:50 -0400)]
Update bcachefs sources to 799716df00 bcachefs: Delete an incorrect bch2_trans_unlock()

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
13 months agoUpdate bcachefs sources to 400f275d46 bcachefs: Fix check_overlapping_extents()
Kent Overstreet [Sat, 13 May 2023 04:13:57 +0000 (00:13 -0400)]
Update bcachefs sources to 400f275d46 bcachefs: Fix check_overlapping_extents()

13 months agoUpdate bcachefs sources to 5074caad6a fixup! bcachefs: BTREE_ID_snapshot_tree
Kent Overstreet [Mon, 8 May 2023 08:20:52 +0000 (04:20 -0400)]
Update bcachefs sources to 5074caad6a fixup! bcachefs: BTREE_ID_snapshot_tree

13 months agoUpdate bcachefs sources to e990c131de fixup! bcachefs: BTREE_ID_snapshot_tree
Kent Overstreet [Mon, 8 May 2023 00:01:55 +0000 (20:01 -0400)]
Update bcachefs sources to e990c131de fixup! bcachefs: BTREE_ID_snapshot_tree

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
13 months agoUpdate bcachefs sources to 6a20aede29 bcachefs: Fix quotas + snapshots
Kent Overstreet [Wed, 26 Apr 2023 20:34:57 +0000 (16:34 -0400)]
Update bcachefs sources to 6a20aede29 bcachefs: Fix quotas + snapshots

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
13 months agochore(rust): add opt_get! and expose some FMODE_* as Rust const
TruongSinh Tran-Nguyen [Thu, 27 Apr 2023 18:02:00 +0000 (11:02 -0700)]
chore(rust): add opt_get! and expose some FMODE_* as Rust const

In an effort to rewrite `bch2_read_super` from C to Rust,
it is neccessary to have `opt_get!` macro defined, and some
FMODE_* consts (defined as macro in `include/linux/blkdev.h`)
defined as Rust const.

Bindgen is currently unable to exapnd C functional macro [1],
this this commit use the workaround as introduced in [2].

[1] https://github.com/rust-lang/rust-bindgen/issues/753
[2] https://github.com/rust-lang/rust-bindgen/issues/753#issuecomment-608546390

Signed-off-by: TruongSinh Tran-Nguyen <i@truongsinh.pro>
13 months agofeat(cmd_mount): Add support for magic keyword `OLD_BLKID_UUID`
TruongSinh Tran-Nguyen [Wed, 26 Apr 2023 17:15:12 +0000 (10:15 -0700)]
feat(cmd_mount): Add support for magic keyword `OLD_BLKID_UUID`

This commit enhances mount sub command by allowing it to accept
`OLD_BLKID_UUID=xxx` as the device, enabling whole fs mounting without relying
on colon-separated devices.

Using colon-separated devices in fstab is discouraged due to potential device
reference issues after reboot. Additionally, using `UUID=xxx` in fstab or with
`mount -t bcachefs` is currently infeasible as it depends on blkid, which prior
to v2.39, does not recognize bcachefs. This update enables mounting via fstab
using `OLD_BLKID_UUID=xxx` as obtained from `bcachefs show-super` "External
UUID".

Signed-off-by: TruongSinh Tran-Nguyen <i@truongsinh.pro>
13 months agochore: logger for idiomatic style and expanded logging levels
TruongSinh Tran-Nguyen [Wed, 26 Apr 2023 19:50:16 +0000 (12:50 -0700)]
chore: logger for idiomatic style and expanded logging levels

Improve the Rust logger by adhering to idiomatic Rust conventions and
incorporating additional logging levels: warn, debug, and trace.

Signed-off-by: TruongSinh Tran-Nguyen <i@truongsinh.pro>
13 months agoA small compile fix
Mikulas Patocka [Wed, 26 Apr 2023 12:31:10 +0000 (08:31 -0400)]
A small compile fix

Hi

Here I'm sending a small compile fix for bcachefs-tools.

Without this patch, I get this error:

cargo  build --release --manifest-path rust-src/Cargo.toml
   Compiling bch_bindgen v0.1.0
(/usr/src/git/bcachefs-tools/rust-src/bch_bindgen)
error: failed to run custom build command for `bch_bindgen v0.1.0
(/usr/src/git/bcachefs-tools/rust-src/bch_bindgen)`

Caused by:
  process didn't exit successfully:
`/usr/src/git/bcachefs-tools/rust-src/target/release/build/bch_bindgen-733e88995ce9eab7/build-script-build`
(exit status: 101)
  --- stderr
  warning: optimization flag '-fkeep-inline-functions' is not supported
[-Wignored-optimization-argument]
  ../../include/linux/bit_spinlock.h:20:3: error: call to undeclared
function 'futex'; ISO C99 and later do not support implicit function
declarations [-Wimplicit-function-declaration]
  ../../include/linux/bit_spinlock.h:28:2: error: call to undeclared
function 'futex'; ISO C99 and later do not support implicit function
declarations [-Wimplicit-function-declaration]
  ../../include/linux/bit_spinlock.h:39:2: error: call to undeclared
function 'futex'; ISO C99 and later do not support implicit function
declarations [-Wimplicit-function-declaration]

The futex() function is declared in
/usr/include/x86_64-linux-gnu/urcu/futex.h
It is not declared in linux/futex.h, so we need to include urcu/futex.h

Mikulas

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
13 months agoUpdate bcachefs sources to fd6fb298aa bcachefs: Make sure hash info gets initialized...
Kent Overstreet [Tue, 25 Apr 2023 18:35:51 +0000 (14:35 -0400)]
Update bcachefs sources to fd6fb298aa bcachefs: Make sure hash info gets initialized in fsck

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
13 months agoUpdate bcachefs sources to 2115a2ffde bcachefs: Kill bch2_verify_bucket_evacuated()
Kent Overstreet [Fri, 21 Apr 2023 08:02:48 +0000 (04:02 -0400)]
Update bcachefs sources to 2115a2ffde bcachefs: Kill bch2_verify_bucket_evacuated()

13 months agoAdd a NO_RUST option
Kent Overstreet [Thu, 20 Apr 2023 16:35:27 +0000 (12:35 -0400)]
Add a NO_RUST option

For systems without working rust/llvm/bindgen, add an option for
building without Rust. This will be less of an option in the future, as
more code gets rewritten in Rust.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
13 months agoDelete pytest
Kent Overstreet [Thu, 20 Apr 2023 16:18:25 +0000 (12:18 -0400)]
Delete pytest

These tests have never been useful; drop them.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
14 months agoUpdate bcachefs sources to fd381c355c bcachefs: Fix a null ptr deref in fsck check_ex...
Kent Overstreet [Mon, 17 Apr 2023 01:50:37 +0000 (21:50 -0400)]
Update bcachefs sources to fd381c355c bcachefs: Fix a null ptr deref in fsck check_extents()

14 months agoUpdate bcachefs sources to 22ccceee15 bcachefs: Fix a slab-out-of-bounds
Kent Overstreet [Sun, 16 Apr 2023 11:14:41 +0000 (07:14 -0400)]
Update bcachefs sources to 22ccceee15 bcachefs: Fix a slab-out-of-bounds

14 months agoUpdate bcachefs sources to 504729f99c bcachefs: Allow answering y or n to all fsck...
Kent Overstreet [Mon, 10 Apr 2023 18:39:18 +0000 (14:39 -0400)]
Update bcachefs sources to 504729f99c bcachefs: Allow answering y or n to all fsck errors of given type

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
14 months agoUpdate bcachefs sources to 8fd009dd76 bcachefs: Rip out code for storing backpointers...
Kent Overstreet [Fri, 31 Mar 2023 19:52:24 +0000 (15:52 -0400)]
Update bcachefs sources to 8fd009dd76 bcachefs: Rip out code for storing backpointers in alloc keys

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
14 months agoFix build dependencies
Kent Overstreet [Sun, 19 Mar 2023 19:32:43 +0000 (15:32 -0400)]
Fix build dependencies

Incremental builds are fast again

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
14 months agoAdd packaging workflow
Alexander Fougner [Mon, 13 Mar 2023 17:45:15 +0000 (18:45 +0100)]
Add packaging workflow

Package and publish deb+rpm for easy testing

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
15 months agoUpdate bcachefs sources to 0342eebf85 bcachefs: Improve the backpointer to missing...
Kent Overstreet [Wed, 15 Mar 2023 12:59:01 +0000 (08:59 -0400)]
Update bcachefs sources to 0342eebf85 bcachefs: Improve the backpointer to missing extent message

15 months agoUpdate bcachefs sources to 72405e7ff8 bcachefs: Fix bch2_check_extents_to_backpointers()
Kent Overstreet [Tue, 14 Mar 2023 16:56:38 +0000 (12:56 -0400)]
Update bcachefs sources to 72405e7ff8 bcachefs: Fix bch2_check_extents_to_backpointers()

15 months agoAdd manpage for mount command
Alexander Fougner [Wed, 8 Mar 2023 19:57:50 +0000 (20:57 +0100)]
Add manpage for mount command

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
15 months agoRemove cmd_assemble docs
Alexander Fougner [Tue, 7 Mar 2023 19:42:11 +0000 (20:42 +0100)]
Remove cmd_assemble docs

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
15 months agolinux shim: Fix dropped O_DIRECT flag
Kent Overstreet [Wed, 8 Mar 2023 15:30:16 +0000 (10:30 -0500)]
linux shim: Fix dropped O_DIRECT flag

A recent libbcachefs update accidentally committed a change that dropped
the O_DIRECT flag - we definitely didn't want to do that.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
15 months agoadd rpm make target and fix up spec file
Eric Sandeen [Wed, 8 Mar 2023 15:25:13 +0000 (09:25 -0600)]
add rpm make target and fix up spec file

Add a new make target to build an rpm. This uses rpmbuild --build-in-place,
so no SRPM is created.

Also clean up the specfile to remove manually-added Requires: that will
be auto-generated, add a couple new BuildRequires: and use macros for
file locations.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
15 months agoUpdate docs
Alexander Fougner [Sun, 5 Mar 2023 14:43:45 +0000 (15:43 +0100)]
Update docs

- add some project info for the main readme
- migrate readmes to markdown for improved formatting
- The main binary now requires the Rust toolchain, so make note of it
  in the build instructions.

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
15 months agocmd_list.rs: Finish list modes, delete cmd_list.c
Kent Overstreet [Mon, 6 Mar 2023 07:21:52 +0000 (02:21 -0500)]
cmd_list.rs: Finish list modes, delete cmd_list.c

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
15 months agoUpdate bcachefs sources to 3856459b1b bcachefs: bch2_btree_iter_peek_node_and_restart()
Kent Overstreet [Mon, 6 Mar 2023 07:35:56 +0000 (02:35 -0500)]
Update bcachefs sources to 3856459b1b bcachefs: bch2_btree_iter_peek_node_and_restart()

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
15 months agoAdd rust toolchain to debian build-deps
Alexander Fougner [Sat, 25 Feb 2023 12:48:51 +0000 (13:48 +0100)]
Add rust toolchain to debian build-deps

Fixes building the .deb

- also add missing libudev to debian build deps

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
15 months agorust: Implement BtreeNodeIter
Kent Overstreet [Sun, 5 Mar 2023 03:06:01 +0000 (22:06 -0500)]
rust: Implement BtreeNodeIter

This implements BtreeNodeIter, and adds it to cmd_list.rs - the next
step in having a full replacement for cmd_list.c

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
15 months agoUpdate bcachefs sources to 171da96d76 bcachefs: Drop some anonymous structs, unions
Kent Overstreet [Sun, 5 Mar 2023 03:47:04 +0000 (22:47 -0500)]
Update bcachefs sources to 171da96d76 bcachefs: Drop some anonymous structs, unions

15 months agorust: Fix ptr casting in Fs::open()
Kent Overstreet [Sat, 4 Mar 2023 12:35:29 +0000 (07:35 -0500)]
rust: Fix ptr casting in Fs::open()

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
15 months agoUpdate bcachefs sources to 2272c5f5b7 bcachefs: Mark stripe buckets with correct...
Kent Overstreet [Fri, 3 Mar 2023 05:39:26 +0000 (00:39 -0500)]
Update bcachefs sources to 2272c5f5b7 bcachefs: Mark stripe buckets with correct data type

15 months agolinux shim: hlist_unhashed()
Kent Overstreet [Fri, 3 Mar 2023 04:00:03 +0000 (23:00 -0500)]
linux shim: hlist_unhashed()

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
15 months agorust: BkeySC now has correct lifetime on BtreeIter
Kent Overstreet [Fri, 3 Mar 2023 03:01:00 +0000 (22:01 -0500)]
rust: BkeySC now has correct lifetime on BtreeIter

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
15 months agorust: Filesystem options now supported
Kent Overstreet [Tue, 28 Feb 2023 11:15:48 +0000 (06:15 -0500)]
rust: Filesystem options now supported

This implements opt_set!(), which works exactly the same as the C
version and allows filesystem options to be specified in Rust code.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
15 months agorust: BtreeTrans lifetime now marked w.r.t. Fs
Kent Overstreet [Tue, 28 Feb 2023 07:28:44 +0000 (02:28 -0500)]
rust: BtreeTrans lifetime now marked w.r.t. Fs

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
15 months agorust: BkeyValC
Kent Overstreet [Tue, 28 Feb 2023 07:11:05 +0000 (02:11 -0500)]
rust: BkeyValC

Now we have a rust-style enum for key types

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
15 months agorust: BkeySC
Kent Overstreet [Tue, 28 Feb 2023 06:01:50 +0000 (01:01 -0500)]
rust: BkeySC

Implement a rust equivalent to bkey_s_c, which uses references with the
correct lifetimes: now cmd_list.rs doesn't need unsafe.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
15 months agobcachefs: Annotate BtreeIter with BtreeTrans lifetime
Kent Overstreet [Tue, 28 Feb 2023 05:34:43 +0000 (00:34 -0500)]
bcachefs: Annotate BtreeIter with BtreeTrans lifetime

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
15 months agorust: Simplify bpos FromStr
Kent Overstreet [Tue, 28 Feb 2023 05:33:42 +0000 (00:33 -0500)]
rust: Simplify bpos FromStr

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
15 months agorust: BtreeIterFlags
Kent Overstreet [Tue, 28 Feb 2023 03:15:10 +0000 (22:15 -0500)]
rust: BtreeIterFlags

This adds a new wrapper type for btree iterator flags.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
15 months agoUpdate bcachefs sources to a5da815430 bcachefs: Convert constants to consts
Kent Overstreet [Tue, 28 Feb 2023 03:14:56 +0000 (22:14 -0500)]
Update bcachefs sources to a5da815430 bcachefs: Convert constants to consts

15 months agoRust: Start of cmd_list rewrite
Kent Overstreet [Mon, 27 Feb 2023 02:38:12 +0000 (21:38 -0500)]
Rust: Start of cmd_list rewrite

This is a _very_ preliminary rewrite of the cmd_list tool in rust, which
is intended to be a testing ground for a safe interface in Rust to the
core btree interface. This adds rust wrappers for:

bch_fs: provides bch2_fs_open(), bch2_fs_stop
btree_trans: provides bch2_trans_init(), bch2_trans_exit()
btree_iter: provides peek, peek_and_restart, advance
bch_errcode: implements Display (wraps bch2_err_str())
bpos: implements Ord (wraps bpos_cmp())
bkey_s_c: implements Display (wraps bch2_bkey_val_to_text())

and other assorted types.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
15 months agoUpdate bcachefs sources to ca97ee3577 bcachefs: bch2_btree_iter_peek_and_restart_outl...
Kent Overstreet [Mon, 27 Feb 2023 02:36:39 +0000 (21:36 -0500)]
Update bcachefs sources to ca97ee3577 bcachefs: bch2_btree_iter_peek_and_restart_outlined()

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
15 months agonix fix up! Rust now integrated into bcachefs binary
Daniel Hill [Mon, 27 Feb 2023 03:34:06 +0000 (16:34 +1300)]
nix fix up! Rust now integrated into bcachefs binary

Heavily simplified to just call make with the required rust dependencies.

Signed-off-by: Daniel Hill <daniel@gluo.nz>
15 months agoMade the -k option for mount.bcachefs default to ask, without messing up formatting
Westly Ward [Wed, 22 Feb 2023 20:00:45 +0000 (13:00 -0700)]
Made the -k option for mount.bcachefs default to ask, without messing up formatting

Signed-off-by: Westly Ward <sonicrules1234@gmail.com>
15 months agocmd_list_journal: Highlight entries matching transaction filter
Kent Overstreet [Tue, 21 Feb 2023 22:21:18 +0000 (17:21 -0500)]
cmd_list_journal: Highlight entries matching transaction filter

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
15 months agorust-src: Clean up read_super bindings
Kent Overstreet [Tue, 21 Feb 2023 20:58:42 +0000 (15:58 -0500)]
rust-src: Clean up read_super bindings

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
15 months agoMore rust improvements
Kent Overstreet [Tue, 21 Feb 2023 19:39:43 +0000 (14:39 -0500)]
More rust improvements

 - passing of arguments from c -> rust code now works correctly
 - 'bcachefs mount' now handles being passed a device or devices

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
15 months agofixup! Rust now integrated into bcachefs binary
Kent Overstreet [Tue, 21 Feb 2023 08:02:06 +0000 (03:02 -0500)]
fixup! Rust now integrated into bcachefs binary

15 months agoRust now integrated into bcachefs binary
Kent Overstreet [Wed, 4 Jan 2023 03:31:36 +0000 (22:31 -0500)]
Rust now integrated into bcachefs binary

Rust is now required for building the bcachefs tool, and rust code is
now fully integrated with the C codebase - meaning it is possible to
call back and forth.

The mount helper is now a subcommand, 'mount.bcachefs' is now a small
shell wrapper that invokes 'bcachefs mount'.

This will make it easier to start rewriting other subcommands in rust,
and eventually the whole command line interface.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
15 months agoUpdate bcachefs sources to 8e1519ccb6 bcachefs: Add tracepoint & counter for btree...
Kent Overstreet [Mon, 20 Feb 2023 23:55:08 +0000 (18:55 -0500)]
Update bcachefs sources to 8e1519ccb6 bcachefs: Add tracepoint & counter for btree split race

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
15 months agoUpdate bcachefs sources to 1b14994029 bcachefs: Fragmentation LRU
Kent Overstreet [Fri, 17 Feb 2023 22:51:22 +0000 (17:51 -0500)]
Update bcachefs sources to 1b14994029 bcachefs: Fragmentation LRU

16 months agoFix cpu_relax()
Kent Overstreet [Mon, 13 Feb 2023 22:51:14 +0000 (17:51 -0500)]
Fix cpu_relax()

cpu_relax() is supposed to be a compiler barrier - this fixes a bug with
btree_write_buffer_flush() getting stuck.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
16 months agoUpdate bcachefs sources to 8dbfede1d9 fixup! bcachefs: More info on check_bucket_ref...
Kent Overstreet [Mon, 13 Feb 2023 20:51:27 +0000 (15:51 -0500)]
Update bcachefs sources to 8dbfede1d9 fixup! bcachefs: More info on check_bucket_ref() error

16 months agocmd_list_journal: Add filter options
Kent Overstreet [Mon, 13 Feb 2023 02:44:33 +0000 (21:44 -0500)]
cmd_list_journal: Add filter options

Instead of having to use grep, this adds the ability to print out only
transactions that update a particular key, or to filter out entirely
keys except those updating certain btrees.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
16 months agoUpdate bcachefs sources to 3e0c5b0722 fixup! bcachefs: Btree write buffer
Kent Overstreet [Mon, 13 Feb 2023 02:40:59 +0000 (21:40 -0500)]
Update bcachefs sources to 3e0c5b0722 fixup! bcachefs: Btree write buffer

16 months agomount: support remount
Daniel Hill [Sat, 11 Feb 2023 00:45:23 +0000 (13:45 +1300)]
mount: support remount

remount is handled by libc, not the kernel mount procedure, this fixes
remounts. Also sorted the list of flags.

Signed-off-by: Daniel Hill <daniel@gluo.nz>
16 months agoUpdate bcachefs sources to dab31ca168 bcachefs: Add some logging for btree node rewri...
Kent Overstreet [Fri, 10 Feb 2023 20:49:12 +0000 (15:49 -0500)]
Update bcachefs sources to dab31ca168 bcachefs: Add some logging for btree node rewrites due to errors

16 months agoUpdate bcachefs sources to ea93c26e98 fixup! bcachefs: We can handle missing btree...
Kent Overstreet [Thu, 9 Feb 2023 23:34:08 +0000 (18:34 -0500)]
Update bcachefs sources to ea93c26e98 fixup! bcachefs: We can handle missing btree roots for all alloc btrees

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
16 months agonix: fix compilation issues
Daniel Hill [Wed, 1 Feb 2023 23:54:04 +0000 (12:54 +1300)]
nix: fix compilation issues

Update Cargo.lock files to match new dependancies
Bump nixpkgs pin

16 months agoMakefile: build with -Wno-deprecated-declarations
Kent Overstreet [Wed, 1 Feb 2023 21:27:32 +0000 (16:27 -0500)]
Makefile: build with -Wno-deprecated-declarations

This fixes a ZSTD warning.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
16 months agocmd_fsck: Add --ratelimit_errors option
Kent Overstreet [Wed, 1 Feb 2023 20:37:05 +0000 (15:37 -0500)]
cmd_fsck: Add --ratelimit_errors option

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
16 months agofixup! nix: overhaul build system.
Daniel Hill [Tue, 3 Jan 2023 08:38:11 +0000 (21:38 +1300)]
fixup! nix: overhaul build system.

Signed-off-by: Daniel Hill <daniel@gluo.nz>
16 months agorust: replace tracing with logger
Alexander Fougner [Mon, 16 Jan 2023 16:08:52 +0000 (17:08 +0100)]
rust: replace tracing with logger

tracing framework is a overengineered for simple mount helper. Add a
few very barebone logging macros to allow configurable verbosity and
colorized output with a small footprint.

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
16 months agorust: use rustfmt defaults
Alexander Fougner [Mon, 16 Jan 2023 08:22:49 +0000 (09:22 +0100)]
rust: use rustfmt defaults

follow the kernel style guide, i.e idiomatic rust style.

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
17 months agorust: suppress errors on fs probing
Alexander Fougner [Sun, 15 Jan 2023 20:57:04 +0000 (21:57 +0100)]
rust: suppress errors on fs probing

suppress errors for any non-bchfs blockdevs found during probing

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
17 months agorust: support fstab style mount
Alexander Fougner [Thu, 12 Jan 2023 19:35:23 +0000 (20:35 +0100)]
rust: support fstab style mount

- add support for fstab format, UUID=<uuid>

- structopt is no longer actively maintained, replace with clap v4
  which support everything structopt can and more.

- update dependencies

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
17 months agomake: remove libbcachefs.so when cleaning.
Daniel Hill [Wed, 30 Nov 2022 01:12:27 +0000 (14:12 +1300)]
make: remove libbcachefs.so when cleaning.

Signed-off-by: Daniel Hill <daniel@gluo.nz>
17 months agonix: overhaul build system.
Daniel Hill [Thu, 24 Nov 2022 23:47:29 +0000 (12:47 +1300)]
nix: overhaul build system.

Removed outdated overlay.
Simply build tooling using bingenHook and propagated*Inputs

Signed-off-by: Daniel Hill <daniel@gluo.nz>