summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2024-02-23bch2_sb_is_encrypted{,_and_locked}Roland Vet
Specifically also mention locked Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-23Apply naming convention: passphrase->unlock->key->decrypt->fsRoland Vet
Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-22Improve error messageRoland Vet
Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-22Rename sb to block_deviceRoland Vet
Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-22Rename password{,_policy}Roland Vet
Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-22Rename KeyLocation to more appropriate KeyPolicyRoland Vet
Also key_location to key_policy Improve help description key policy Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-22TypoRoland Vet
Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-22Rename sbs to block_devices_to_mountRoland Vet
Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-22Rephrase help messageRoland Vet
Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-22Remove unnecessary bracketsRoland Vet
Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-22Add decryption by key_fileRoland Vet
- Add key_file option to Cli - Rework decryption flow logic to first attempt key_file - Read password from file and pass to decrypt_master_key Explicity specify '-k' for key_location Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-22Add fmt::Display for KeyLocationRoland Vet
Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-22Refactor ask_for_key to call new decrypt_master_keyRoland Vet
Signed-off-by: Roland Vet <RlndVt@protonmail.com>
2024-02-20rust: use libc::Ioctl type for ioctl() request argumentThomas Bertschinger
The second argument to ioctl() can be defined as a different type by different libc implementations, and can be a different size on different architectures depending on what type it is defined as. For example, glibc defines it as `unsigned long` which may have a different size on 32-bit vs. 64-bit architectures, and musl libc defines it as `int`. The Rust libc crate exposes a type `libc::Ioctl` which is defined as the appropriate integer type for the given libc implementation. Using this type for the request argument to `libc::ioctl()` ensures code will compile correctly regardless of architecture and libc implementation. Also, because ioctl request numbers are defined to be 32 bits (regardless of the fact that `unsigned long` might sometimes take 64 bits on some architectures), this patch changes the Rust representation of the bcachefs ioctl numbers to u32 instead of u64. Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-02-09feat: add aliases for a few subcommandsErrorNoInternet
2024-02-09refactor: clean up argumentsErrorNoInternet
2024-02-07Replace atty with stdlibAlexander Fougner
is_terminal() is part of rust 1.70 std, no need for isatty Signed-off-by: Alexander Fougner <fougner89@gmail.com>
2024-02-06kill dependency on char signednessKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-02-06fix snapshotting when dst is single component pathKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-02-06Update bcachefs sources to 50847e296b34 bcachefs: Check subvol <-> inode ↵Kent Overstreet
pointers in check_inode() Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-02-05cmd_subvolume: Fix snapshot creation with implicit sourceKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-01-27feat(rust/commands): introduce Rust-driven `subvolume` sub-CLIRyan Lahfa
This makes use of `BcachefsHandle` to introduce an elegant Rust driven CLI for subvolumes. Signed-off-by: Ryan Lahfa <bcachefs@lahfa.xyz>
2024-01-27feat(rust/wrappers): init `BcachefsHandle`Ryan Lahfa
We propose a simple low-level wrapper which can perform various subvolume-related operations as an example for the API surface. This will be used in an upcoming commit to migrate the subvolume CLI fully to Rust. The API design is the following: - `BcachefsHandle` is meant as a low level handle to carry around whenever you need a filesystem handle to send ioctl to. - it possess type-safe operations Type safe operations are handled by having type safe wrappers for ioctl commands *and* their payloads. We assume that all ioctl payloads only use *one* argument, this can easily be changed if needed. When the handle goes out of scope, we automatically close it à la C++ RAII. Signed-off-by: Ryan Lahfa <bcachefs@lahfa.xyz>
2024-01-23rust: fix docsWill Fancher
2024-01-20Remove gag usageKent Overstreet
Possibly-fixes: https://github.com/koverstreet/bcachefs-tools/issues/217 Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-01-16rust: bump rpassword to v7.xFaidon Liambotis
Including a tiny API change. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-01-16move Rust sources to top level, C sources into c_srcThomas Bertschinger
This moves the Rust sources out of rust_src/ and into the top level. Running the bcachefs executable out of the development tree is now: $ ./target/release/bcachefs command or $ cargo run --profile release -- command instead of "./bcachefs command". Building and installing is still: $ make && make install Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>