summaryrefslogtreecommitdiff
path: root/Makefile
Commit message (Collapse)AuthorAge
* btrfs-progs: fix missing __error symbol in libbtrfs.so.0Sergei Trofimovich2017-03-31
| | | | | | | | | | | | | | | | | | | | | | | | | The easiest way to reproduce the error is to try to build btrfs-progs with $ make LDFLAGS=-Wl,--no-undefined btrfs-list.o: In function `lookup_ino_path': btrfs-list.c:(.text+0x7d2): undefined reference to `__error' Noticed by Denis Descheneaux when snapper tool stopped working after upgrade to btrfs-progs-4.10. As soname didn't change in 4.9 -> 4.10 release I assume it's just an object file omission in library depends and not the API/ABI change of the library error printing. Cc: linux-btrfs@vger.kernel.org Cc: Mike Gilbert <floppym@gentoo.org> Reported-by: Denis Descheneaux Bug: https://bugs.gentoo.org/show_bug.cgi?id=613890 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Cleanup kernel-shared dir when execute make cleanQu Wenruo2017-03-31
| | | | | | Reported-by: Chris <coderight@gmail.com> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: misc/019, use fssumDavid Sterba2017-03-16
| | | | | | The fssum utility is now ready to use, test still passes. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: fssum, switch from MD5 to SHA256David Sterba2017-03-16
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: fssum, drop unnecessray build definesDavid Sterba2017-03-16
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: add fssum utilityDavid Sterba2017-03-16
| | | | | | | | | | Copy from fstests, originally from git://git.kernel.org/pub/scm/linux/kernel/git/arne/far-progs.git Needs libcrypto to link but this check is now missing in configure. Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: library-test: update test to build outside of topdirDavid Sterba2017-03-16
| | | | | | | | | | | | We need to build outside of the topdir so we can use the "btrfs/" prefix for includes and not accidentally include other files. Make magic is simple: - build dependencies inside TOPDIR - build inside temporary directory, link back to TOPDIR - library-test.o not built anymore obviously Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: library: distribute sizes.h, fix buildDavid Sterba2017-03-16
| | | | | | | | | | | | | The patch "btrfs-progs: Introduce kernel sizes to cleanup large intermediate number" (a2203246ae483d09) was taken from kernel but not properly ported so the build breaks because the header linux/sizes.h is not exported. The build tests of library do not cover the case when the macro BTRFS_FLAT_INCLUDES is not defined (ie. an external build). Reported-by: Holger Hoffstätte <holger@applied-asynchrony.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: tests: fix library-test rules and depsDavid Sterba2017-03-08
| | | | | | | The symbol __error was undefined and the rule did not use the dependencies from the rule definiton, like the rest. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: move ulist.[ch] to kernel-sharedDavid Sterba2017-03-08
| | | | | | | 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>
* btrfs-progs: move message helpers implementation out of headerDavid Sterba2017-03-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: use MAKEOPTS where missingDavid Sterba2017-03-08
| | | | | | $(MAKE) should also use MAKEOPTS. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: drop deprecated utility from test dependenciesDavid Sterba2017-03-08
| | | | | | | Standalone btrfs-debug-tree has been superseded by 'btrfs inspect-internal dump-tree'. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: move mkfs helper implementation out of utilsDavid Sterba2017-03-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: build library by defaultDavid Sterba2017-03-08
| | | | | | | Add a convenience rule and build the library by default, not just at the installation phase. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: add rule for building cscope indexDavid Sterba2017-03-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: split makefile to generated and stable partsDavid Sterba2017-03-08
| | | | | | | | 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>
* btrfs-progs: autoconf: add ./configure scriptKarel Zak2015-01-28
| | | | | | | | | | | - add ./autogen.sh script (necessary after git clean/clone) - add ./configure.ac - copy autotool helper scripts from automake - modify version.sh to be usable from the configure script - rename Makefile to Makefile.in and use basic variables from configure.ac Signed-off-by: Karel Zak <kzak@redhat.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: drop feature defines from C files, in favour of CFLAGS definesDimitri John Ledkov2015-01-27
| | | | | | | | | | | | | | | | | | | | | | glibc 2.10+ (5+ years old) enables all the desired features: _XOPEN_SOURCE 700, __XOPEN2K8, POSIX_C_SOURCE, DEFAULT_SOURCE; with a single _GNU_SOURCE define in the makefile alone. For portability to other libc implementations (e.g. dietlibc) _XOPEN_SOURCE=700 is also defined. This also resolves Debian bug report filed by Michael Tautschnig - "Inconsistent use of _XOPEN_SOURCE results in conflicting declarations". Whilst I was not able to reproduce the results, the reported fact is that _XOPEN_SOURCE set to 500 in one set of files (e.g. cmds-filesystem.c) generates/defines different struct stat from other files (cmds-replace.c). This patch thus cleans up all feature defines, and sets them at a consistent level. Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=747969 Signed-off-by: Dimitri John Ledkov <dimitri.j.ledkov@intel.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: tests, adjust alignment of the pretty command nameDavid Sterba2015-01-14
| | | | Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Makefile: Move linker only option to LDFLAGSQu Wenruo2014-12-19
| | | | | | | | | | Move the linker only option -rdynamic to LDFLAGS. This resolve lots of the following warning if using clang as CC: clang: warning: argument unused during compilation: '-rdynamic' Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Reviewed-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: remove false dependency on libmDavid Sterba2014-12-19
| | | | | | It ends up in the final binary, but there are not math functions used. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: tests: build prerequisities, btrfs-image and btrfsDavid Sterba2014-12-12
| | | | | | | Build required utilities from the main Makefile and just check in the test scripts. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Add btrfs_unlink() and btrfs_add_link() functions.Qu Wenruo2014-12-10
| | | | | | | | Add btrfs_unlink() and btrfs_add_link() functions in inode.c, for the incoming btrfs_mkdir() and later inode operations functions. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: remove duplicate pthread libs from buildDavid Sterba2014-12-04
| | | | | | | With the task-utils it's in the default LIBS flags now. We want to use -pthread as it also sets flags for the preprocessor. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: convert: use task for progress indication of metadata creationSilvio Fricke2014-12-04
| | | | | Signed-off-by: Silvio Fricke <silvio.fricke@gmail.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Add helpers functions to handle the printing of data in tabular ↵Goffredo Baroncelli2014-12-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | format This patch adds some functions to manage the printing of the data in tabular format. The function struct string_table *table_create(int columns, int rows) creates an (empty) table. The functions char *table_printf(struct string_table *tab, int column, int row, char *fmt, ...) char *table_vprintf(struct string_table *tab, int column, int row, char *fmt, va_list ap) populate the table with text. To align the text to the left, the text shall be prefixed with '<', otherwise the text shall be prefixed by a '>'. If the first character is a '=', the the text is replace by a sequence of '=' to fill the column width. The function void table_free(struct string_table *) frees all the data associated to the table. The function void table_dump(struct string_table *tab) prints the table on stdout. Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Enhance the command btrfs filesystem dfGoffredo Baroncelli2014-12-04
| | | | | | | | | | Enhance the command "btrfs filesystem df" to show space usage information for a mount point(s). It shows also an estimation of the space available, on the basis of the current one used. Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it> [code moved under #if 0 instead of deletion] Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: build, update the clean ruleDavid Sterba2014-11-07
| | | | | | Remove duplicate files, add extra progs, add library test binaries. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: build, gather utilities that are not built by defaultDavid Sterba2014-11-07
| | | | | | Add them to build test and to clean rules. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: build, add make target for a build testDavid Sterba2014-11-07
| | | | | | A quick check that everything still builds. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: build, add basic build test for libraryDavid Sterba2014-11-07
| | | | | | Basic test based on snapper code that uses the send stream API. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: fix linking with libbtrfsDavid Sterba2014-11-03
| | | | | | | | | Reported at https://github.com/openSUSE/snapper/issues/128 Commit cdb9e22e292275237c added another rbtree file that defines functions that libbtrfs uses. Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs-progs: break out rbtree util functionsJosef Bacik2014-10-14
| | | | | | | | | These were added to deal with duplicated functionality within btrfs-progs, but we specifically copied rbtree.c from the kernel, so move these functions out into their own file. This will make it easier to keep rbtree.c in sync. Thanks, Signed-off-by: Josef Bacik <jbacik@fb.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs-progs: pull back backref.c and fix it upJosef Bacik2014-10-14
| | | | | | | | | This patch pulls back backref.c, adds a couple of helpers everywhere that it needs, and cleans up backref.c to fit in btrfs-progs. Thanks, Signed-off-by: Josef Bacik <jbacik@fb.com> [removed free_some_buffers after "do not reclaim extent buffer"] Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: add option to disable backtrace usageGustavo Zacarias2014-10-10
| | | | | | | | | | | | This commit adds the support for a make variable named "DISABLE_BACKTRACE" which allows to disable the support for backtrace() usage on ASSERT(), BUG() and BUG_ON() calls. This is useful because some alternative C libraries like uClibc have optional support for backtrace() which is rarely built when debugging isn't taking place. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs-progs: make BUG*() be more verboseJosef Bacik2014-10-01
| | | | | | | | | | | | Currently these macros just tie to assert(), which gives us line number and such but no backtrace so no actual context. This patch adds support for spitting out a backtrace so we can see how we got to the given assert. Thanks, Signed-off-by: Josef Bacik <jbacik@fb.com> [backtrace_symbols_fd] Signed-off-by: Naohiro Aota <naota@elisp.net> [minor fixups] Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Improve static building and installationThomas Petazzoni2014-09-02
| | | | | | | | | | | | | | | | | | | | | | | | | This commit improves the static-only building of btrfs-progs, and adds support for installing the static only tools: - It now ensures that all programs are built statically, not only a small subset of them, by defining 'progs_static' from the existing 'progs' variable. - It changes the order of libraries in the btrfs-%.static rule so that -lpthread (part of STATIC_LIBS) appears *after* the '$($(subst -,_,$(subst .static,,$@)-libs))' logic, which brings in -lcom_err. This is needed because libcom_err.a uses the semaphore functions, which are available in the pthread library. - Adds the necessary rules to generate the btrfsck.static link and btrfstune.static binary. - Adds an 'install-static' target to install the static binaries. Note that they are renamed to not carry a '.static' suffix. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Add support for DISABLE_DOCUMENTATIONGustavo Zacarias2014-09-02
| | | | | | | | | | | This commit adds the support for a make variable named "DISABLE_DOCUMENTATION", which allows to disable the build of the documentation. This is useful in contexts where the tools needed to build the documentation are not necessarily available. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: library version definesArvin Schnell2014-09-02
| | | | | | | | | | | | | | commit 46de1a6ec3dbb0db203baa6c46cb64ba9b000ea2 changed the parameters of btrfs_read_and_process_send_stream(). This breaks snapper compilation. We can include version defines usable for the C preprocessor. Version 0.1.0: API up to and including 46de1a6ec3dbb0db2 (3.14.x) Version 0.1.1: 909131939f750faffb9fab (changed in 3.16) Signed-off-by: Arvin Schnell <aschnell@suse.de> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Add uninstall targets to Makefiles.Nils Steinger2014-08-22
| | | | | Signed-off-by: Nils Steinger <git@n-st.de> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: fix build of static targetDavid Sterba2014-08-22
| | | | | | | | | | | | | A user repoted that static buid fails with utils-lib.static.o: In function `arg_strtou64': /home/dsterba/labs/btrfs-progs/utils-lib.c:17: multiple definition of `arg_strtou64' utils-lib.static.o:/home/dsterba/labs/btrfs-progs/utils-lib.c:17: first defined here utils-lib.o was mistakenly added to linker twice. Signed-off-by: David Sterba <dsterba@suse.cz> Reviewed-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
* btrfs-progs: Add some simple end-to-end tests for btrfs-convertAdam Buchbinder2014-08-22
| | | | | | | | | | | | These use the system's mke2fs, and don't require loop devices or root privileges. They don't pick up anything with the default flags right now, but they do pick up some sanitizer issues when the tools are compiled with any of -fsanitize={address,memory,thread}. Signed-off-by: Adam Buchbinder <abuchbinder@google.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: add quota group verify codeMark Fasheh2014-08-22
| | | | | | | | | | | | | | | | | | | | | | | | | This patch adds functionality (in qgroup-verify.c) to compute bytecounts in subvolume quota groups. The original groups are read in and stored in memory so that after we compute our own bytecounts, we can compare them with those on disk. A print function is provided to do this comparison and show the results on the console. A 'qgroup check' pass is added to btrfsck. If any subvolume quota groups differ from what we compute, the differences for them are printed. We also provide an option '--qgroup-report' which will run only the quota check code and print a report on all quota groups. Other than making it possible to verify that our qgroup changes work correctly, this mode can also be used in xfstests for automated checking after qgroup tests. This patch does not address the following: - compressed counts are identical to non compressed, because kernel doesn't make the distinction yet. Adding the code to verify compressed counts shouldn't be hard at all though once kernel can do this. - It is only concerned with subvolume quota groups (like most of btrfs-progs). Signed-off-by: Mark Fasheh <mfasheh@suse.de> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: import ulistMark Fasheh2014-08-22
| | | | | | | qgroup-verify.c wants this for walking root refs. Signed-off-by: Mark Fasheh <mfasheh@suse.de> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: fix btrfs-fragments buildEric Sandeen2014-08-22
| | | | | | | | | | | When I made all the btrfs-foo.c targets generic, I somehow managed to break the libs definition for btrfs-fragments by dropping the "s" off the end. Fix that, although apparently nobody is building this tool. :) Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: move arg_strtou64 to a separate file for libraryDavid Sterba2014-05-02
| | | | | | | | | | Linking with libbtrfs fails because arg_strtou64 is not defined and we cannot just add utils.o to library objects because it's not library-clean. Reported-by: Arvin Schnell <aschnell@suse.com> Reported-by: Anton Farygin <rider@altlinux.org> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: add separate make target to clean docsDavid Sterba2014-04-22
| | | | | | | | Regenerating the asciidoc takes much longer now and makes quick build tests long. There's separate clean-doc target for that and clean-all that cleans docs and sources. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Switch to the new asciidoc Documentation.Qu Wenruo2014-04-22
| | | | | | | | Since all man page are converted to the new asciidoc, the old man page can be removed. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs-progs: introduce btrfs property subgroupAlexander Block2014-01-31
| | | | | | | | | | | | | | | "btrfs filesystem property" is a generic interface to set/get properties on filesystem objects (inodes/subvolumes/filesystems /devs). This patch adds the generic framework for properties and also implements two properties. The first is the read-only property for subvolumes and the second is the label property for devices. Signed-off-by: Alexander Block <ablock84@googlemail.com> Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <clm@fb.com>