Commit Graph

321 Commits

Author SHA1 Message Date
Leah Neukirchen
e523a844d6 format: the error_action readonly is spelled remount_ro 2018-02-09 20:51:23 +01:00
Leah Neukirchen
79ce40239a list: fix usage header 2018-02-09 19:25:46 +01:00
Leah Neukirchen
06a81e6d29 list: document -f and -v 2018-02-09 19:25:17 +01:00
Leah Neukirchen
869e51901d migrate: migrate_superblock -> migrate-superblock in usage 2018-02-09 19:22:52 +01:00
Leah Neukirchen
a502eb5094 format: document -U (used by many mkfs.*) 2018-02-09 19:21:47 +01:00
Leah Neukirchen
a2a99187c1 dump: document -f 2018-02-09 19:18:58 +01:00
Leah Neukirchen
0feb77e79e device add: support --help 2018-02-09 19:17:26 +01:00
Leah Neukirchen
487282f7a1 bcachefs.8: completely rewrite manpage with mdoc, adapting to current usages 2018-02-09 19:14:24 +01:00
Leah Neukirchen
2a6b7fe8ba mkfs.bcachefs: convert to POSIX sh 2018-02-09 16:54:03 +01:00
Leah Neukirchen
1c0c62559f fsck.bcachefs: convert to POSIX sh 2018-02-09 16:52:44 +01:00
Leah Neukirchen
6c9e9b675c Makefile: default PREFIX to /usr/local 2018-02-09 16:33:26 +01:00
koverstreet
fc96071b58
Merge pull request #1 from Pneumaticat/patch-1
typo: "migrate_superblock" -> "migrate-superblock"
2018-02-08 16:53:26 -05:00
Kevin Liu
d81d11623d
typo: "migrate_superblock" -> "migrate-superblock" 2018-02-08 16:26:25 -05:00
Kent Overstreet
7875b82630 New data rereplicate command 2018-02-08 15:33:43 -05:00
Kent Overstreet
6976570d67 Update bcachefs sources to d5e561b3cc bcachefs: BCH_DATA ioctl 2018-02-08 15:33:42 -05:00
Kent Overstreet
a9f5937a97 cmd_migrate fixes
when linking existing data, we weren't creating alloc btree keys - also,
we were calculating the wrong bucket...
2018-02-07 06:52:56 -05:00
Kent Overstreet
1ef243e3ad Update bcachefs sources to 496cbe9474 bcachefs: export bch2_alloc_write() 2018-02-07 06:16:50 -05:00
Kent Overstreet
99adc23cf6 Update bcachefs sources to 0e765bc37c bcachefs: foreground merging of interior btree nodes 2018-02-05 00:31:32 -05:00
Kent Overstreet
27c0b6fbc5 use futex instead of pthread cond variable for schedule 2018-02-05 00:13:40 -05:00
Kent Overstreet
7c29c458db Update bcachefs sources to 2834633e12 bcachefs: fix ioctls that set inode flags 2018-01-21 16:39:23 -05:00
Kent Overstreet
fe2d5ef75f Update bcachefs sources to ae6e8a59d3 bcachefs: quota limit enforcement 2018-01-21 12:17:34 -05:00
Kent Overstreet
4de98a2712 Update bcachefs sources to 02ae70070a bcachefs: Allocate new btree roots lazily 2018-01-11 07:02:08 -05:00
Kent Overstreet
f8cbede6d1 fix cmd_evacuate 2017-12-30 03:36:12 -05:00
Kent Overstreet
dbad1685bc show-super can now print more stuff 2017-12-29 21:15:47 -05:00
Kent Overstreet
88242ec7a3 Update bcachefs sources to 0b8c5d0fb7 bcachefs: refactor superblock validation 2017-12-29 21:15:45 -05:00
Kent Overstreet
aca9f96dcc Resizing 2017-12-28 02:55:08 -05:00
Kent Overstreet
9d2dfea54b update for bcachefs changes 2017-12-28 02:55:08 -05:00
Kent Overstreet
d77921a153 Update bcachefs sources to f4b290345a bcachefs: device resize 2017-12-28 02:55:06 -05:00
Kent Overstreet
30caf69540 Add bcachefs fs usage 2017-12-23 00:51:19 -05:00
Kent Overstreet
14117dcdfb Update bcachefs sources to 2afdc642c2 bcachefs: kill bucket_data_type, improve disk usage stats 2017-12-23 00:51:17 -05:00
Kent Overstreet
da37a5f204 Update bcachefs sources to b2f5acc670 bcachefs: fix assertion in journal read 2017-12-21 18:57:37 -05:00
Kent Overstreet
1cf4d51dc4 Update bcachefs sources to 14ce2a2031 bcachefs: fixes for building in userspace 2017-12-21 18:06:45 -05:00
Austin Seipp
8acc54456e make: correct path to 'bcachefs' in mkfs/fsck scripts
The fsck and bcachefs scripts simply worked by running 'exec bcachefs
...', but this executes whatever is out of `$PATH`, which is likely not
what a user expected when working inside the bcachefs-tools tree.

This replaces the local uses of 'exec bcachefs' to use bash's
readlink/dirname builtins in order to find the location of the currently
executing wrapper, and execute the 'bcachefs' tool from there.

This allows executing these wrappers from anywhere, provided 'bcachefs'
is just right next to them, with the correct semantics.

As a result, this also allows removing a tiny hack from the Nix
expressions, allowing the included default.nix to use completely
standard mkDerivation builders, with no extra patch/fixup phases.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2017-12-17 12:46:45 -06:00
Kent Overstreet
5053c6ed25 fix default checksum types 2017-12-15 12:57:40 -05:00
Kent Overstreet
ea83a3985d Update bcachefs sources to e57b5958cf bcachefs: fix for building in userspace 2017-12-13 16:12:38 -05:00
Kent Overstreet
f2feceddae Shim layer updates 2017-12-13 16:07:21 -05:00
Austin Seipp
fa36882a73 nix: add nix expressions for development
This adds Nix expressions for bcachefs-tools that are modular, work in
purely sandboxed build environments (e.g. on NixOS itself, or macOS, where
sandboxing is enabled by default), use a fixed copy of Nixpkgs (to avoid hidden,
global state) and uses standard build idioms.

This change uses a fixed version of Nixpkgs, one that will always be used for
every build of bcachefs-tools, for all users, rather than relying on whatever
copy of Nixpkgs the user has available.

This has a major benefit in that it allows the build to work in sandboxed
environments such as NixOS, and it correctly declares all of the necessary
dependencies that bcachefs-tools needs. This is done simply by using
stdenv.mkDerivation in order to write a "normal" Nix expression, where the
previous version used a variant of the stdenv builder, but this isn't needed for
the most part. (Doing this has other knock-on benefits, such as the usage of
standardized options like `enableParallelBuild = true;` -- allowing `nix-build`
to automatically do parallel builds, etc.)

Another major benefit of this change is that anyone can now use `nix-shell` to
develop/hack on bcachefs-tools incrementally; simply running nix-shell will put
you in a Bash shell environment where all of bcachefs-tools' dependencies are
proprerly provided, no matter the state of the outside build environment/host
operating system:

    $ nix-shell

    [nix-shell:~/src/bcachefs-tools]$ make -j4 # works immediately

As mentioned before, with this change, by default, nix-build and
nix-shell run using a prepackaged copy of an upstream Nixpkgs snapshot. This is
done purely to ensure anyone who builds bcachefs-tools using Nix does, in fact,
get a reproducible build. Without this, nix-build defaults to using the the
`<nixpkgs>` NIX_PATH entry in order to fetch dependencies; meaning that two
users on different channels will get different results (for example, if you have
the November 2017 channel but I have the October 2017 channel, the results may
be different).

With this patch, a user running

    $ nix-build

will always use the exact same copy of nixpkgs to bootstrap the build,
regardless of whatever channels the user has. This bootstrap mechanism does not
even depend on an existing copy of Nixpkgs itself; e.g. it can work with a
completely empty `NIX_PATH`.

This is arguably anti-modular, but for end-user applications like
bcachefs-tools, fixing the version of Nixpkgs is not normally a huge deal. Users
who wish to use a different copy of Nixpkgs can provide this with an argument to
nix-build directly, using the `nixpkgs` argument to the expression:

    $ nix-build --pure --arg nixpkgs 'import <nixpkgs> {}'

This uses the `<nixpkgs>` provided inside your `NIX_PATH` environment variable
to acquire dependencies, which by default is managed using `nix-channel`. If you
have a copy of the Nixpkgs source code e.g. from a `git clone`, you may use that
too by simply using `-I` to prepend your Nixpkgs to `NIX_PATH` (see `man
nix-build` for more):

    $ nix-build --pure \
        -I nixpkgs=$HOME/src/nixpkgs \
        --arg nixpkgs 'import <nixpkgs> {}'

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2017-12-10 16:07:33 -06:00
Austin Seipp
997bb216aa build: require explicit include paths for libbcachefs/
This removes the implicit `-I libbcachefs` argument to $(CC), which in turn
requires a set of minor changes throughout the tools. There are two advantages
to this setup:

    1) It is (arguably) easier to read, since the location of bcachefs includes
    are easier to understand at a glance ("where does util.h live?")

    2) It removes the need for a hack to include glibc's copy of
    dirent.h explicitly via '/usr/include/dirent.h', because libbcachefs/
    *also* has a dirent.h file and the compiler cannot disambiguate them.
    This has some ramifications on systems where /usr/include may not
    exist, such as NixOS.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2017-12-10 16:06:01 -06:00
Austin Seipp
04035f0c7e build: use 'find', not 'git', to locate C source code
We will not always have .git available in some cases. For example, if someone
simply downloaded a tarball of the tree, or if we're building with something
like Nix and want to exclude the .git folder, we need to cope and build the
source anyway.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2017-12-10 16:03:32 -06: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
a95883db43 add --replicas 2017-12-02 06:04:16 -05:00
Kent Overstreet
22291ae84a Update bcachefs sources to 9e7ae5219c bcachefs: Make write points more dynamic 2017-11-22 00:50:47 -05:00
Kent Overstreet
74cb922032 Update bcachefs sources to 661faf58db bcachefs: fix a deadlock in journal replay error path 2017-11-12 18:23:29 -05:00
Kent Overstreet
3347339bbd Simple stupid memory reclaim code 2017-11-12 16:48:07 -05:00
Kent Overstreet
e9afb70d26 Update bcachefs sources to 6a361fb68c bcachefs: Rework btree read error handling 2017-11-10 22:18:52 -09:00
Kent Overstreet
ea57dd8d48 Update bcachefs sources to 58b77cfec6 bcachefs: improve btree_ptr_debugcheck() 2017-11-10 12:58:58 -09:00
Kent Overstreet
6d09cd7766 Update bcachefs sources to 2679158d6e bcachefs: fix allocation + replication 2017-11-08 21:12:38 -09:00
Kent Overstreet
097fd2a5e6 Add commands for changing and removing passphrase 2017-11-08 16:06:37 -09:00
Kent Overstreet
b984559329 update for new option code 2017-11-08 16:01:26 -09:00
Kent Overstreet
8351bbc05b Update bcachefs sources to d4b7ef921a bcachefs: Refactoring 2017-11-08 16:01:26 -09:00