Commit Graph

1452 Commits

Author SHA1 Message Date
Thomas Mühlbacher
990437ad13 build(nix): add bear to dev shell
A useful addition to make sure is available, since we also make clangd
available through clang-tools. bear can generate the
`compile_commands.json` for clangd. For example with `make clean && bear
-- make -j$(nproc)`.

Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-10 00:04:13 +02:00
koverstreet
c2354f0326
Merge pull request #293 from tmuehlbacher/fix-subvolume-commands-with-relative-paths
fix(subvol): make cmds work with relative paths
2024-06-09 17:43:41 -04:00
Thomas Mühlbacher
b42b5b4065 fix(subvol): make cmds work with relative paths
`Path::parent()` returns `Some("")` for relative paths with a single
component. The simplest fix is to just canonicalize the paths first.

Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-09 22:13:11 +02:00
Kent Overstreet
e1fa076a86 Fix target option parsing for format, migrate
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-07 16:12:55 -04:00
Kent Overstreet
0d570e822b Update bcachefs sources to 4f69e2d39ad3 bcachefs: bch2_btree_insert() - add btree iter flags 2024-06-05 10:53:01 -04:00
Kent Overstreet
0916d38664 cmd_fs_usage: Use now BCH_IOCTL_QUERY_ACCOUNTING
We can now report on compression type/ratio, btree usage, and pending
rebalance work.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-03 20:08:06 -04:00
Kent Overstreet
da5435b0cc cmd_fs_usage: split out devs_usage_to_text()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-03 20:08:06 -04:00
Kent Overstreet
7d79fba1af Update bcachefs sources to f81dc88f0c80 bcachefs: bch2_btree_insert() - add btree iter flags
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-03 20:08:06 -04:00
koverstreet
d456f9e97a
Merge pull request #291 from tmuehlbacher/fix-subvolume-commands
Fix subvolume commands
2024-06-03 17:01:22 -04:00
Thomas Mühlbacher
30e16b5e15 fix: avoid addr_of if we already use a reference
It's kind of stupid to use this macro if we have to deref the parameter
first. I was too enthusiastic about using this macro instead of `as`
because it's nicer to read (imo).

Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-03 17:05:52 +02:00
Thomas Mühlbacher
fac7cce224 fix: unbreak subvolume commands
This was a stupid mistake by me, "fixing" more than what clippy told me
to. `p` is already a reference and we should not use the addr of it.

Fixes: 96a3462 ("refactor: casting-related `clippy::pedantic` fixes")
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-06-03 17:05:52 +02:00
Kent Overstreet
587f7f5a47 cmd_list_journal: open with noexcl, so we can work on mounted filesystems
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-02 21:06:47 -04:00
koverstreet
cafd2226a2
Merge pull request #288 from tux3/patch-1
docs: udev.pc now in systemd-dev on Debian
2024-06-01 12:33:10 -04:00
Tux3
697c79fa7c
docs: udev.pc now in systemd-dev on Debian 2024-06-01 11:52:24 +02:00
koverstreet
4676269d2d
Merge pull request #286 from koverstreet/update_flake_lock_action
flake.lock: Update
2024-05-31 11:37:03 -04:00
github-actions[bot]
617ba1380b flake.lock: Update
Flake lock file updates:

• Updated input 'crane':
    'github:ipetkov/crane/19ca94ec2d288de334ae932107816b4a97736cd8?narHash=sha256-8K1R9Yg4r08rYk86Yq%2Blu3E9L3uRUb4xMqYHgl0VGS0%3D' (2024-05-26)
  → 'github:ipetkov/crane/480dff0be03dac0e51a8dfc26e882b0d123a450e?narHash=sha256-dIubLa56W9sNNz0e8jGxrX3CAkPXsq7snuFA/Ie6dn8%3D' (2024-05-29)
• Updated input 'fenix':
    'github:nix-community/fenix/9af557bccdfa8fb6a425661c33dbae46afef0afa?narHash=sha256-zxFADJsXhODHH9rrF7gXjN%2BBYVkMoNY2NpLyjGQDOJA%3D' (2024-05-27)
  → 'github:nix-community/fenix/14c3b99d4b7cb91343807eac77f005ed9218f742?narHash=sha256-BKFOT/eg0mCf99oTKa63yW%2Bd5Y3K6c5Gb%2BNetxacaHg%3D' (2024-05-31)
• Updated input 'fenix/rust-analyzer-src':
    'github:rust-lang/rust-analyzer/71a816a90facb6546a0a06010da17598e11812f7?narHash=sha256-xJ5vzVr5Et6wxHRQLOYicsa0gN2bwm4mj6AFHc8ugJc%3D' (2024-05-26)
  → 'github:rust-lang/rust-analyzer/b32f181f477576bb203879f7539608f3327b6178?narHash=sha256-mUZtVS2S%2BleFcMpBgbqkMnZm4II1qBM21pW8UnivVSo%3D' (2024-05-27)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/3eaeaeb6b1e08a016380c279f8846e0bd8808916?narHash=sha256-pU9ViBVE3XYb70xZx%2BjK6SEVphvt7xMTbm6yDIF4xPs%3D' (2024-05-21)
  → 'github:nixos/nixpkgs/ad57eef4ef0659193044870c731987a6df5cf56b?narHash=sha256-SzDKxseEcHR5KzPXLwsemyTR/kaM9whxeiJohbL04rs%3D' (2024-05-29)
• Updated input 'treefmt-nix':
    'github:numtide/treefmt-nix/2fba33a182602b9d49f0b2440513e5ee091d838b?narHash=sha256-wJqHMg/K6X3JGAE9YLM0LsuKrKb4XiBeVaoeMNlReZg%3D' (2024-05-17)
  → 'github:numtide/treefmt-nix/52b66cade760e93276146eb057122b8011ab9057?narHash=sha256-V68CsekhPCF6Oz84t2FHY5jin4smKrmsS208Xw057zs%3D' (2024-05-30)
2024-05-31 15:34:51 +00:00
koverstreet
e739da5da8
Merge pull request #284 from tmuehlbacher/fix-result-eval
fix: evaluate KeyHandle Result
2024-05-31 11:34:36 -04:00
koverstreet
af05a54922
Merge pull request #285 from tmuehlbacher/fix-pedantic-clippy-lints
Fix pedantic clippy lints
2024-05-31 11:34:06 -04:00
Thomas Mühlbacher
8cd17b40df build(nix): make package version more accurate
Would still be better to have commit rev included if
applicable/available but still better than before.

Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-31 14:49:39 +02:00
Thomas Mühlbacher
96a346254d refactor: casting-related clippy::pedantic fixes
Prefer using `ptr::addr_of!()` and `pointer::cast()` instead of raw `as`
where clippy complains and other type casting lints.

Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-31 12:48:42 +02:00
Thomas Mühlbacher
15e3c90584 refactor: make c_str! simpler, add test
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-31 12:48:42 +02:00
Thomas Mühlbacher
0ca3233518 refactor: change some fn type sigs and simplify
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-31 12:48:42 +02:00
Thomas Mühlbacher
20f7954cdb refactor: treat harmless clippy::pedantic lints
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-31 12:48:42 +02:00
Thomas Mühlbacher
9ec185437d fix: evaluate KeyHandle Result
This one is sort of bad to have missed, ouch.

Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-31 03:56:53 +02:00
koverstreet
96843fc95d
Merge pull request #283 from tmuehlbacher/msrv-and-tweaks
Msrv and tweaks
2024-05-30 20:41:29 -04:00
Thomas Mühlbacher
781ea5d40f fix: minor tweaks for key.rs
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-31 02:30:59 +02:00
Thomas Mühlbacher
31066e17e8 fix: keep compat with MSRV
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-31 02:30:59 +02:00
koverstreet
d42a097280
Merge pull request #281 from tmuehlbacher/rewrite-rust-key-handling
Rewrite rust key handling
2024-05-30 19:56:27 -04:00
Thomas Mühlbacher
22495e0d31 feat: rewrite key.rs
- Introduce `KeyHandle` and `Passphrase` types

- Refactor the functions into associated functions

- Add `zeroizing` crate to handle passphrase memory safely

Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-30 22:26:06 +02:00
Thomas Mühlbacher
25bce91b4b refactor: rename function again
`bch2_sb_is_encrypted_and_locked()` simply does not check if the fs is
locked. The name is misleading.

Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-30 22:26:06 +02:00
Thomas Mühlbacher
21b1111b59 refactor: reduce UnlockPolicy boilerplate
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
2024-05-30 22:26:06 +02:00
koverstreet
de6e8ac230
Merge pull request #280 from JohnRTitor/cleanup
treewide: fix typos in docs and comments
2024-05-29 23:56:27 -04:00
Kent Overstreet
3016a7dbbd cmd_fsck: Fix check for running online fsck
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-29 18:01:59 -04:00
Kent Overstreet
c3c7dacab2 mount: minor cleanup
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-29 17:00:50 -04:00
Andrea Gelmini
18f9526c45
treewide, docs: fix typos
Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
[remove changes to libbcachefs/, linux/, include/, and raid/]
Co-authored-by: Masum Reza <masumrezarock100@gmail.com>
Signed-off-by: Masum Reza <masumrezarock100@gmail.com>
2024-05-29 09:22:09 +05:30
Kent Overstreet
0c39011ae0 Update bcachefs sources to 8528bde1b66b bcachefs: Fix uninitialized var warning 2024-05-28 18:22:45 -04:00
koverstreet
cd94eda1d8
Merge pull request #279 from JohnRTitor/workflows
workflows: add monthly flake lock update workflow
2024-05-28 16:18:34 -04:00
John Titor
a0bbe712c0
workflows: add monthly flake lock update workflow
Signed-off-by: Masum Reza <masumrezarock100@gmail.com>
2024-05-29 01:12:56 +05:30
koverstreet
c36b96d4dc
Merge pull request #278 from tmuehlbacher/add-more-flake-checks
Add more flake checks
2024-05-28 15:25:29 -04:00
Thomas Mühlbacher
d43fbfd642 docs: rm outdated msrv in install instructions 2024-05-28 19:32:53 +02:00
Thomas Mühlbacher
7f15685517 build(nix): minor tweaks
- rm unused function argument

- `LIBCLANG_PATH` is superfluous here, this is already handled by
  `rustPlatform.bindgenHook` for us.

- rustc is not directly needed in the `$PATH` for the build but it's
  good to have in the dev shell.
2024-05-28 19:32:53 +02:00
Thomas Mühlbacher
b362f12add build(nix): add cargo test check
this is pretty much a no-op currently, but hopefully we can make some
use of it in the future.
2024-05-28 19:32:53 +02:00
Thomas Mühlbacher
422ae1f1a7 build(nix): add cargo clippy check
note that this only checks the top-level package, `bch_bindgen` is
excluded because it has too many clippy lints.
2024-05-28 19:32:53 +02:00
Thomas Mühlbacher
bf2c0c8852 build(nix): use crane to build packages
this enables faster incremental rebuilds in nix. it also allows us to
add clippy and cargo test checks more easily. aside from that, i have
tried to carry over things that i think are sensible from the previous
`mkDerivation` call.

the `checkPhase` may as well rather be done in a `installCheckPhase` and
we can set `enableParallelBuilding` to speed up the compilation of
`libbcachefs.a`.
2024-05-28 19:32:15 +02:00
Thomas Mühlbacher
ce01c61ba5 build(nix): enable rustfmt check+formatter
with this, the gh actions ci will fail if submitted code does not adhere
to rustfmt rules.

additionally, running `nix fmt` will also format rust code.

because we want rules only supported by nightly rustfmt, and nixpkgs
doesn't have a nightly toolchain, we need to pull in another flake
input: fenix.
2024-05-27 19:30:26 -04:00
Thomas Mühlbacher
0e414b462f style: fix one straggler not caught by rustfmt
not sure why this wasn't picked up, maybe different versions of nightly
rustfmt?
2024-05-27 19:30:26 -04:00
Kent Overstreet
7efaf45d78 Update bcachefs sources to bc0fa834a738 bcachefs: Better fsck error message for key version 2024-05-27 19:17:49 -04:00
Kent Overstreet
067e072465 Update bcachefs sources to ea473c4a1a21 bcachefs: btree_gc can now handle unknown btrees 2024-05-27 19:04:42 -04:00
Kent Overstreet
9bb2977a1a Update bcachefs sources to 45845c32a41a fs: bcachefs: add missing MODULE_DESCRIPTION() 2024-05-27 17:59:22 -04:00
Christopher Fore
5a3011c48e doc: update subvolume destroy command to subvolume delete
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-26 21:36:01 -04:00