Commit Graph

1032 Commits

Author SHA1 Message Date
Alexander Fougner
ea8adaf1cc 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>
2023-03-07 12:46:53 -05:00
Kent Overstreet
ea1b618203 cmd_list.rs: Finish list modes, delete cmd_list.c
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-03-06 04:13:45 -05:00
Kent Overstreet
0206d42daf Update bcachefs sources to 3856459b1b bcachefs: bch2_btree_iter_peek_node_and_restart()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-03-06 04:11:50 -05:00
Alexander Fougner
61b25f2dd2 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>
2023-03-05 05:37:08 -05:00
Kent Overstreet
7709585c2a 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>
2023-03-04 23:33:30 -05:00
Kent Overstreet
b0c9ad15f4 Update bcachefs sources to 171da96d76 bcachefs: Drop some anonymous structs, unions 2023-03-04 23:33:25 -05:00
Kent Overstreet
9fc4b5d675 rust: Fix ptr casting in Fs::open()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-03-04 19:14:50 -05:00
Kent Overstreet
1ee7dc7a55 Update bcachefs sources to 2272c5f5b7 bcachefs: Mark stripe buckets with correct data type 2023-03-03 00:39:26 -05:00
Kent Overstreet
d010a21653 linux shim: hlist_unhashed()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-03-02 23:00:03 -05:00
Kent Overstreet
d5b0d0892a rust: BkeySC now has correct lifetime on BtreeIter
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-03-02 22:01:00 -05:00
Kent Overstreet
8a7e3344fe 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>
2023-02-28 06:15:48 -05:00
Kent Overstreet
daebbc085d rust: BtreeTrans lifetime now marked w.r.t. Fs
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-02-28 02:28:44 -05:00
Kent Overstreet
b6f30fd188 rust: BkeyValC
Now we have a rust-style enum for key types

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-02-28 02:14:40 -05:00
Kent Overstreet
59528398cf 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>
2023-02-28 01:01:50 -05:00
Kent Overstreet
a999dc0a9f bcachefs: Annotate BtreeIter with BtreeTrans lifetime
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-02-28 00:34:43 -05:00
Kent Overstreet
a8dbc331f0 rust: Simplify bpos FromStr
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-02-28 00:33:42 -05:00
Kent Overstreet
a3eb6ad8ef rust: BtreeIterFlags
This adds a new wrapper type for btree iterator flags.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-02-27 22:15:10 -05:00
Kent Overstreet
5966e59eae Update bcachefs sources to a5da815430 bcachefs: Convert constants to consts 2023-02-27 22:14:56 -05:00
Kent Overstreet
e0e06d95f8 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>
2023-02-27 21:45:42 -05:00
Kent Overstreet
30cca2e94d Update bcachefs sources to ca97ee3577 bcachefs: bch2_btree_iter_peek_and_restart_outlined()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-02-27 21:36:36 -05:00
Daniel Hill
bf359ac1ad 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>
2023-02-27 16:39:46 +13:00
Westly Ward
203e40fcf5 Made the -k option for mount.bcachefs default to ask, without messing up formatting
Signed-off-by: Westly Ward <sonicrules1234@gmail.com>
2023-02-22 13:12:59 -07:00
Kent Overstreet
de720eaa24 cmd_list_journal: Highlight entries matching transaction filter
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-02-21 17:21:18 -05:00
Kent Overstreet
c67ea7b6a1 rust-src: Clean up read_super bindings
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-02-21 15:58:42 -05:00
Kent Overstreet
f2ab6e552d 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>
2023-02-21 14:39:43 -05:00
Kent Overstreet
10c609ac94 fixup! Rust now integrated into bcachefs binary 2023-02-21 03:02:06 -05:00
Kent Overstreet
28f703cc25 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>
2023-02-21 01:03:08 -05:00
Kent Overstreet
da6a356895 Update bcachefs sources to 8e1519ccb6 bcachefs: Add tracepoint & counter for btree split race
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-02-20 20:03:34 -05:00
Kent Overstreet
46a6b9210c Update bcachefs sources to 1b14994029 bcachefs: Fragmentation LRU 2023-02-17 17:51:22 -05:00
Kent Overstreet
c1677df62e 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>
2023-02-13 17:51:14 -05:00
Kent Overstreet
1b2d608269 Update bcachefs sources to 8dbfede1d9 fixup! bcachefs: More info on check_bucket_ref() error 2023-02-13 15:51:27 -05:00
Kent Overstreet
4697efb7a0 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>
2023-02-12 21:44:33 -05:00
Kent Overstreet
e160e9b979 Update bcachefs sources to 3e0c5b0722 fixup! bcachefs: Btree write buffer 2023-02-12 21:41:03 -05:00
Daniel Hill
157ea20eb2 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>
2023-02-11 13:45:23 +13:00
Kent Overstreet
284c1f5148 Update bcachefs sources to dab31ca168 bcachefs: Add some logging for btree node rewrites due to errors 2023-02-10 15:49:12 -05:00
Kent Overstreet
a104f0407b 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>
2023-02-09 18:36:24 -05:00
Daniel Hill
abe1c3bc8e nix: fix compilation issues
Update Cargo.lock files to match new dependancies
Bump nixpkgs pin
2023-02-02 12:54:04 +13:00
Kent Overstreet
97880a7ce4 Makefile: build with -Wno-deprecated-declarations
This fixes a ZSTD warning.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-02-01 16:34:14 -05:00
Kent Overstreet
bdd85a6325 cmd_fsck: Add --ratelimit_errors option
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-02-01 15:43:02 -05:00
Daniel Hill
3c39b422ac fixup! nix: overhaul build system.
Signed-off-by: Daniel Hill <daniel@gluo.nz>
2023-01-31 12:10:36 +13:00
Alexander Fougner
8accfdc3c5 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>
2023-01-18 06:47:46 +01:00
Alexander Fougner
20aecb42d8 rust: use rustfmt defaults
follow the kernel style guide, i.e idiomatic rust style.

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
2023-01-16 09:24:01 +01:00
Alexander Fougner
bdc290eee0 rust: suppress errors on fs probing
suppress errors for any non-bchfs blockdevs found during probing

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
2023-01-15 22:20:16 +01:00
Alexander Fougner
87243efa5c 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>
2023-01-15 22:20:13 +01:00
Daniel Hill
ccaca683b2 make: remove libbcachefs.so when cleaning.
Signed-off-by: Daniel Hill <daniel@gluo.nz>
2023-01-03 16:58:55 +13:00
Daniel Hill
9a44c6d4d0 nix: overhaul build system.
Removed outdated overlay.
Simply build tooling using bingenHook and propagated*Inputs

Signed-off-by: Daniel Hill <daniel@gluo.nz>
2023-01-03 16:58:55 +13:00
Daniel Hill
9d6040c8b6 rust: update bindgen to 0.63
Signed-off-by: Daniel Hill <daniel@gluo.nz>
2023-01-03 16:58:55 +13:00
Kent Overstreet
42cf74fd1d Merge https://github.com/fougner/bcachefs-tools 2022-12-29 12:31:29 -05:00
Alexander Fougner
d69daae411 doc: fix formatting
fix misnomer and some formatting

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
2022-12-29 18:06:16 +01:00
Kent Overstreet
0417560649 Get current metadata version from sysfs
This changes the default version for the format command to be the
currently supported version, via
/sys/modules/bcachefs/parameters/version.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2022-12-21 21:41:34 -05:00