Commit Graph

3382 Commits (886a8565e03bfacddc1383fe61439303226a8802)
 

Author SHA1 Message Date
David Sterba 886a8565e0 btrfs-progs: move ulist.[ch] to kernel-shared
The implementation of ulist_* is same for kernel and userspace, without
dependencies, so we can keep it separately for code sync.

Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:47 +01:00
David Sterba 1ffcc9b455 btrfs-progs: move prefixcmp helper to utils
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:47 +01:00
Goldwyn Rodrigues 2db52a6a48 btrfs-progs: Remove unused function arg in delete_extent_records
new_len is not used in delete_extent_records().

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:47 +01:00
Austin S. Hemmelgarn 01bba62728 btrfs-progs: better document btrfs receive security
This adds some extra documentation to the btrfs-receive manpage that
explains some of the security related aspects of btrfs-receive.  The
first part covers the fact that the subvolume being received is writable
until the receive finishes, and the second covers the current lack of
sanity checking of the send stream.

Signed-off-by: Austin S. Hemmelgarn <ahferroin7@gmail.com>
Suggested-by: Graham Cobb <g.btrfs@cobb.uk.net>
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:47 +01:00
David Sterba 99063d88af btrfs-progs: drop unused argument from btrfs_del_ptr
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:47 +01:00
David Sterba c6eae415ee btrfs-progs: drop unused argument from btrfs_extend_item
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:47 +01:00
David Sterba 4069aa73d3 btrfs-progs: drop unused argument from btrfs_truncate_item
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
Jonathan Boulle 2c23b7b871 btrfs-progs: docs: fix typo in receive man page
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba eb111e9f39 btrfs-progs: move message helpers implementation out of header
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba bb104f5bce btrfs-progs: move message helpers out of utils
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba a09f0e96e7 btrfs-progs: move utils code out of header
There are not performance critical static inlines, we can do the normal
declaration/definition split for various helpers.

Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba ca92914804 btrfs-progs: convert: improve assert in make_convert_btrfs
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba 52319450e7 btrfs-progs: convert: rename members that clash with other functions
Rename 'free' and also 'used' for consistency.

Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba d1d99f50e3 btrfs-progs: mkfs: use const char for label
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba 6783002cd3 btrfs-progs: mkfs: make make_cfg::blocks an internal member
The caller of make_btrfs does not need to set it, it's for internal use
and can be read after mkfs ends.

Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba a2ed85a11d btrfs-progs: mkfs: describe fields of btrfs_mkfs_config
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba e945e27712 btrfs-progs: mkfs: clear whole mkfs_cfg at once
Zero out the structure and set only the requested fields.

Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba 2920c8d526 btrfs-progs: build: remove unused variables from docs makefile
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba 5eff096b78 btrfs-progs: build: use MAKEOPTS where missing
$(MAKE) should also use MAKEOPTS.

Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba 0c94504d06 btrfs-progs: build: drop deprecated utility from test dependencies
Standalone btrfs-debug-tree has been superseded by
'btrfs inspect-internal dump-tree'.

Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba 1f739d73e3 btrfs-progs: convert: move internal bg size definition
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba 39aa42147a btrfs-progs: convert: rename ext2 function to create a symlink
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba ed4c7428b7 btrfs-progs: move mkfs helper implementation out of utils
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba 11c83cefb8 btrfs-progs: move more mkfs declarations to the common header
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba df32b5fa22 btrfs-progs: kerncompat: print trace from ASSERT, if enabled
Commit bc2d4ccc46 "btrfs-progs:
kerncompat: disconnect assert and warning messages" forgot to add the
print_trace call to assert_trace.

Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba d7e3f1d0b7 btrfs-progs: build: build library by default
Add a convenience rule and build the library by default, not just at the
installation phase.

Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba f6dfc0263d btrfs-progs: build: add stub makefile to convert
A shortcut to compile btrfs-convert from inside the directory.

Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba 0c362b9031 btrfs-progs: convert: use bit field for convert flags
Use one flag field instead of several variables. The change cascades
down to the callchain and modifies several functions.

Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba c45a060f3e btrfs-progs: convert: use helper for special inode number check
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba 9368a77456 btrfs-progs: convert: better error handling in ext2_read_used_space
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba 5bcff79f14 btrfs-progs: convert: remove unused includes
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba 4927a9b268 btrfs-progs: convert: use on-stack buffer for subvol name dir
Get rid of dynamic allocation.

Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba 6b74f2fbe3 btrfs-progs: convert: use fixed lenght array for source fs name
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba cf83a41a02 btrfs-progs: convert: move struct initialization to the init function
The context is zeroed in convert_open_fs after and overwrites the rbtree
initialization, which accidentally is the same (NULL).

Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba 663253415f btrfs-progs: build: add rule for building cscope index
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba 732056e3d3 btrfs-progs: build: split makefile to generated and stable parts
It's not really necessary to configure and regenerate Makefiles in cases
like adding a new source file. The build environment and optional
features are not affected by that.

Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba 0c49ff5fb5 btrfs-progs: build: add rule for ctags
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba f989881ccd btrfs-progs: convert: update some forward declarations
Add missing and reorder so they come next to the structures using them.

Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba c0acc29c99 btrfs-progs: convert: use wider types types for inode counts for progress reports
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba 0a5d16eca7 btrfs-progs: mkfs: make list of source fs more visible
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba 6550f5b9ed btrfs-progs: build: remove directory-specific include paths
The convert and image utilities used include, but we specify the headers
by path relative to the toplevel directory for clarity. The compiler
option is not needed.

Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:46 +01:00
David Sterba dc1c2c4bb0 btrfs-progs: build: use target deps on commandline via automatic variable
The dependencies are duplicated in many targets, but we can use the $^
variable to simplify the command line.

Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:45 +01:00
David Sterba 9876a6b24c btrfs-progs: build: replace target names with automatic variable
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:45 +01:00
David Sterba d9119007d1 btrfs-progs: build: reorder target dependencies
Reorder target dependencies:

1) target-specific objects
2) common objects
3) library objects
4) static libraries

1-3 are for faster detection of build failures, the specific objects
reflect changes to the source, but otherwise is only a cosmetic change.
The 4 is for correct order during linking, if we'd use the $^ variable.

Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:45 +01:00
David Sterba 839d857c7e btrfs-progs: build: split LIBS
Not all the build targets use all libs listed in LIBS, separate the
common and compression ones.

Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:45 +01:00
David Sterba c439152191 btrfs-progs: build: list mkfs.btrfs build objects in a variable
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:45 +01:00
David Sterba 30dc24dc84 btrfs-progs: build: list convert build objects in a variable
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:45 +01:00
David Sterba 3a724cbde0 btrfs-progs: convert: move implementation for interal conversion API to own file
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:45 +01:00
David Sterba 03c085861b btrfs-progs: convert: move ext2 conversion out of main.c
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:45 +01:00
David Sterba 27e927e775 btrfs-progs: convert: move ext2 definitions out of main
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:45 +01:00