Commit Graph

41 Commits

Author SHA1 Message Date
Kent Overstreet
e9df26f9c9 Drop mlockall()
now that we have
 - shrinkers running in the background via a thread
 - run_shrinkers() considering swap usage

this can probably be safely dropped - and it causes problems when
running as non root, so let's do so.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-18 23:21:43 -05:00
Daniel Hill
326d7c1b3b improve kmalloc performance
Reading from /proc/meminfo is really slow

We don't want to start swapping to disk.

Deceptively, memory available goes up when we start to swap to disk making
performance even worse.

To mitigate this:
1. replace reading from meminfo with proper system calls.
2. attempt to lock allocations in physical memory space.
3. check our own allocated memory instead of available memory.
4. still check available memory in the off chance we're trying to play
nice with other apps.

Signed-off-by: Daniel Hill <daniel@gluo.nz>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-24 19:54:11 -05:00
Zhai Can
1d1fe7b0b6
add command to generate Rust-part CLI completions 2023-11-10 21:20:01 +08:00
Kent Overstreet
731926b5e5 Kill shell script wrappers
nixos has trouble with the shell script wrappers - readlink isn't
available by default!

But, there's a better approach: just get rid of them and use symlinks
instead, and have main() check what we're supposed to be.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-09-22 14:09:51 -04:00
Linus Heckemann
0de1fb41b7 cmd_mount: don't return 0 on mount failure
Signed-off-by: Linus Heckemann <git@sphalerite.org>
2023-08-10 11:01:24 -04:00
Kent Overstreet
9d26fad294 fuse: Update for snapshots
cmd_fusermount.c builds again

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-08-08 20:29:57 -04:00
Kent Overstreet
7a66cf70c5 cmd_fs_usage: Implement --help
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-06-10 20:59:22 -04:00
Kent Overstreet
0f37f9f05f 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>
2023-04-20 12:36:16 -04:00
Alexander Fougner
46ba4fb48c Add manpage for mount command
Signed-off-by: Alexander Fougner <fougner89@gmail.com>
2023-03-08 21:00:51 +01: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
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
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
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
e142c4ca01 New subcommand: set-option
This is for setting superblock options on existing filesystems, either
online or offline.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2022-05-26 16:37:13 -04:00
Kent Overstreet
58867de5bd New tool for killing btree nodes on a filesystem
To be used by error injection tests.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2022-04-07 19:25:50 -04:00
Kent Overstreet
57f6402131 Rename group to label in show-super output
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2021-12-13 17:14:44 -05:00
Daniel B. Hill
179ac9ba56 Fix sub commands not triggering without arguments
Signed-off-by: Daniel B. Hill <daniel@gluo.nz>
2021-11-17 12:46:05 +13:00
Daniel B. Hill
e87deba8e4 fix version and show-super not working 2021-11-04 17:38:58 +13:00
Brett Holman
9a649545a3 Add more specific subcommand usage messages
The device, data, fs, and subvolume subcommands currently print out a
generic usage message. Make these more specific.

Signed-off-by: Brett Holman <bholman.devel@gmail.com>
2021-11-01 08:12:35 -06:00
Chris Webb
f5c0b67603 Cosmetic fixes for device resize-journal
Correct the operation name from 'journal-resize' to 'resize-journal' in the
bcachefs usage summary, matching the command that is actually implemented.

Fix the size argument so it isn't optional. Defaulting to the entire device
makes sense for 'device resize', to automatically expand the fs to fill the
block device. However, it is never meaningful (or possible) to expand the
journal to the full disk.

Signed-off-by: Chris Webb <chris@arachsys.com>
2021-10-24 11:39:36 -04:00
Kent Overstreet
d214908864 Subvolume commands 2021-09-26 19:50:47 -04:00
Stijn Tintel
617535ce85 bcachefs: add missing journal-resize to help text
The command exists already but was missing from the main help text.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-05-25 00:07:07 +03:00
Stijn Tintel
9852948bad bcachefs: increase indentation in help text
This is in preparation of adding the resize-journal command to the main
help text, which would otherwise break the alignment.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-05-24 23:58:37 +03:00
Kent Overstreet
cc92b0f5a2 New data job command
This adds a new subcommand, bcachefs data job, that gives more direct
access to the data job/ioctl functionality, and hooks up the new rewrite
old nodes data job.
2021-03-16 21:46:21 -04:00
Kent Overstreet
41bec63b26 Add a subcommand for resizing the journal
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-17 10:52:39 -05:00
Kent Overstreet
2dbedd962b Add a command for dumping contents of journal 2020-03-25 16:23:29 -04:00
Justin Husted
a00998c4cd Make fuse3 support optional and document.
The experimental fuse3 support is not complete yet, and fuse3 is new and
still difficult to install on some platforms.

Make it optional at compile time, and default to off.

Signed-off-by: Justin Husted <sigstop@gmail.com>
2019-11-11 12:18:22 -08:00
Kent Overstreet
bc45c28470 fuse 2019-10-18 16:23:39 -04:00
Kent Overstreet
94cafcb8e5 New setattr command 2018-12-19 18:27:57 -05:00
Kent Overstreet
c416528eaa snapraid 2018-11-23 02:10:44 -05:00
Tim Schlueter
f05f2e89a6 Don't display an error on --help 2018-11-04 13:03:05 -08:00
Tim Schlueter
a5d94ce0a8 Added 'version' command to print when the bcachefs tool was built 2018-05-26 14:32:30 -07:00
Kent Overstreet
ff86d47221 Update bcachefs sources to 0906b1fb49 bcachefs: fixes for 32 bit/big endian machines 2018-05-17 02:36:19 -04:00
Kent Overstreet
7875b82630 New data rereplicate command 2018-02-08 15:33:43 -05:00
Kent Overstreet
f8cbede6d1 fix cmd_evacuate 2017-12-30 03:36:12 -05:00
Kent Overstreet
aca9f96dcc Resizing 2017-12-28 02:55:08 -05:00
Kent Overstreet
30caf69540 Add bcachefs fs usage 2017-12-23 00:51:19 -05:00
Austin Seipp
4ac5ad0832 bcachefs: make usage output more consistent
Minor newline and spacing/alignment touchups make it all just a little easier to
read.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2017-12-10 16:03:25 -06:00
Kent Overstreet
097fd2a5e6 Add commands for changing and removing passphrase 2017-11-08 16:06:37 -09:00
Kent Overstreet
c0ad33c126 bcachefs-in-userspace improvements
Got rid of the stupid shim file hack
2017-03-19 21:39:19 -08:00
Kent Overstreet
5ec39af8ea Rename from bcache-tools to bcachefs-tools 2017-03-19 17:31:47 -08:00