summaryrefslogtreecommitdiff
path: root/Makefile
Commit message (Collapse)AuthorAge
* 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>
* btrfs-progs: add fsck.btrfs stub and manpageDavid Sterba2014-01-31
| | | | | Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <clm@fb.com>
* Add -fno-strict-aliasingChris Mason2013-11-22
| | | | Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* btrfs-progs: remove extra uuid-tree.o in objectsEmil Karlson2013-11-11
| | | | | | | This fixes static compile target of btrfs-progs. Signed-off-by: Emil Karlson <jekarlson@gmail.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* Btrfs-progs: add make test frameworkJosef Bacik2013-10-16
| | | | | | | | | | | We need to start adding some sanity tests to btrfs-progs to make sure we aren't breaking things with our patches. The most important of these tools is btrfsck. This patch gets things started by adding a basic btrfsck test that makes sure we can fix a corruption problem we know we can fix. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* Btrfs-progs: add super-recover to recover bad supersWang Shilong2013-10-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now if one of device's first superblock is corrupt,btrfs will fail to mount. Luckily, btrfs have at least two superblocks for every disk. In theory, if silent corrupting happens when we are writting superblocks into disk, we must hold at least one good superblock. One side effect is that user must gurantee that the disk must be a btrfs disk. Otherwise, this tool may destroy other fs.(This is also reason why btrfs only use first superblock in every disk to mount) This little program will try to correct bad superblocks from good superblocks with max generation. There will be five kinds of return values: 0: all supers are valid, no need to recover 1: usage or syntax error 2: recover all bad superblocks successfully 3: fail to recover bad superblocks 4: abort to recover bad superblocks Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* btrfs-progs: add list_sort and use it to sort devices by idDavid Sterba2013-10-16
| | | | | | | | The devices in 'btrfs filesystem show' are now sorted by the device id, currently the order was undefined. Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* btrfs-progs: separate command and implementation of chunk-recover codeDavid Sterba2013-10-16
| | | | | | | | | | | | | The command has been moved and we should rename the files accordingly, so the entry point is now in cmds-rescue.c and the core functionality in it's own file. Return codes of btrfs_recover_chunk_tree have been simplified not to require a define and another file for defintion. CC: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* btrfs-progs: introduce rescue command groupDavid Sterba2013-10-16
| | | | | | | | Add an empty 1st level command namespace that will collect specialized recovery tools like chunk-recover, zero-log, select-super and similar. Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* Btrfs-progs: Add Makefile infrastructure for subdirsEric Sandeen2013-09-10
| | | | | | | | | Preparatory patch to move cmd & test files into their own subdirs. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* btrfs-progs: get C=1 sparse checking working againZach Brown2013-09-03
| | | | | | | | | | | | | | | | | | | | | | | | | | There were a few problems that were breaking sparse checking: - We were defining CHECK_ENDIAN late in the environment, after linux/fs.h has been included which defines __force and __bitwise in confusing ways that conflict with ours. Define it up with __CHECKER__ so that linux/fs.h and our copy are acting on the same input. - We had manually set a few of gcc's internal defines to give to sparse. It's easier to just ask gcc for all the defines it sets and hand those to sparse. - We weren't passing the same *FLAGS to sparse as we were to CC. - glibc has so many errors with FORTIFY turned on that sparse gives up and doesn't show us any errors from our code. It's a questionable hack to always turn on FORTIFY ourselves, so we'll just not do that when building with sparse. And add a nice '[SP]' quiet output line for sparse checks. Signed-off-by: Zach Brown <zab@redhat.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* btrfs-progs: Fix automatic prerequisite generationKusanagi Kouichi2013-08-09
| | | | | | | | | | | | | | | | | Some files don't compile because of insufficient prerequisite. $ make btrfs ... [CC] btrfs.o btrfs.c:24:21: fatal error: version.h: No such file or directory #include "version.h" ^ compilation terminated. make: *** [btrfs.o] Error 1 Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* Btrfs-progs: add UUID tree lookup methodsStefan Behrens2013-08-09
| | | | | | | | | This commit adds UUID tree lookup methods that make use of the search ioctl. The code is based on the kernel code. Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* libbtrfs: Set SONAME to "libbtrfs.so.0" (instead of "libbtrfs.so").Richard W.M. Jones2013-08-09
| | | | | | Signed-off-by: Richard W.M. Jones <rjones@redhat.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* Btrfs-progs: make btrfsck a hardlink at install timeEric Sandeen2013-08-09
| | | | | | | | | | | | | btrfsck gets hardlinked to btrfs during the build, but the install phase simply copies them both to the destination without preserving the link. Just force-link btrfsck in the destination again during install so that the installed btrfsck is a link as well. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* Btrfs-progs: Add chunk recover function - using old chunk itemsMiao Xie2013-07-03
| | | | | | | | | | | | | | | | | | Add chunk-recover program to check or rebuild chunk tree when the system chunk array or chunk tree is broken. Due to the importance of the system chunk array and chunk tree, if one of them is broken, the whole btrfs will be broken even other data are OK. But we have some hint(fsid, checksum...) to salvage the old metadata. So this function will first scan the whole file system and collect the needed data(chunk/block group/dev extent), and check for the references between them. If the references are OK, the chunk tree can be rebuilt and luckily the file system will be mountable. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* Btrfs-progs: Add block group check funtionMiao Xie2013-07-03
| | | | | | | | | This patch adds the function to check correspondence between block group, chunk and device extent. Original-signed-off-by: Cheng Yang <chenyang.fnst@cn.fujitsu.com> Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* btrfs-progs: Add default rules to MakefileEric Sandeen2013-04-24
| | | | | | | | | | | | | | Add a default rule for any btrfs-$FOO or btrfs-$FOO.static target, allowing it to be built from btrfs-$FOO.c along with all the normal userspace objects. This gets rid of a lot of the cut and pasted rules for each individual command, and as an added bonus makes it easy to build any btrfs-$FOO statically as well, i.e. # make btrfs-convert.static Signed-off-by: Eric Sandeen <sandeen@redhat.com>
* btrfs-progs: standardize tool source filenamesEric Sandeen2013-04-24
| | | | | | | | | | | | | | For any btrfs-$FOO executable, rename the main source file from $FOO.c to to btrfs-$FOO.c This makes it slightly more obvious what's building what, and allows us to write a default rule in the Makefile for these tools. (also add btrfs-calc-size to the list of objects to remove on make clean) Signed-off-by: Eric Sandeen <sandeen@redhat.com>
* Btrfs-progs: add a free space cache checker to fsck V2Josef Bacik2013-04-23
| | | | | | | | | | | | | In trying to track down a weird tree log problem I wanted to make sure that the free space cache was actually valid, which we currently have no way of doing. So this patch adds a bunch of support for the free space cache code and then a checker to fsck. Basically we go through and if we can actually load the free space cache then we will walk the extent tree and verify that the free space cache exactly matches what is in the extent tree. Hopefully this will always be correct, the only time it wouldn't is if the extent tree is corrupt or we have some sort of awful bug in the free space cache. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com>
* btrfs-progs: re-add send-testMark Fasheh2013-04-23
| | | | | | | | | | | | | send-test.c links against libbtrfs and uses the send functionality provided to decode and print a send stream to the console. 66819df "btrfs-progs: add send-test" contained this file when submitted, but somehow got lost on commit. [sandeen@redhat.com: Resurrect lost send-test.c from original commit] Signed-off-by: Mark Fasheh <mfasheh@suse.de> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
* Btrfs-progs: add btrfs-crc toolJan Schmidt2013-04-09
| | | | | | | | This tool can be used to compute btrfs' style crc32c checksums for filenames as done by the kernel. Additionally, there is -c mode to do a brute force search for file names with a given checksum. Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
* Btrfs-progs: tool to visualize fragmentationArne Jansen2013-03-19
| | | | | | | | | | | | | | | | | | | This tool draws per-chunk pngs representing the allocation map. A black or colored dot means the block is allocated. The output is written to a subdirectory, together with an index.html to be viewed in a browser. There are options to control whether color should be used and which block group types should be printed. To build, you need to have libpng and libgd installed. It is not part of the 'all' target, so please build it explicitely with make btrfs-fragments. A (rather untypical) example can be seen at http://sensille.com/fragments Please regard this as a first scratch version and feel free to improve it :) Signed-off-by: Arne Jansen <sensille@gmx.net>
* btrfs-progs: makefile: clean static targetsDavid Sterba2013-03-19
| | | | | | | | | * create .static.o version from the library objects as well and use them for building static targets * remove build dependencies on libbtrfs.* * other minor cleanups Signed-off-by: David Sterba <dsterba@suse.cz>
* Removing btrfsctl, btrfs-vol, btrfs-showGoffredo Baroncelli2013-03-19
| | | | | | | | | | | | | | With the commit 002d021c (committed October 2011) btrfsctl, btrfs-vol, btrfs-show were declared deprecated. The last patches related to these commands are dated December 2010. These tools are replaced by the "btrfs" tool in all the functionality. This commit removes all the related code. Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it> Signed-off-by: David Sterba <dsterba@suse.cz>
* Makefile: allow user set LDFLAGS for libbtrfs.so as wellSergei Trofimovich2013-03-19
| | | | | | | | | | Detected by gentoo's QA checker: * QA Notice: Files built without respecting LDFLAGS have been detected * Please include the following list of files in your report: * /usr/lib/libbtrfs.so.0.1 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* btrfs-progs: add lzo compression support to restoreJosef Bacik2013-03-18
| | | | | | This patch simply adds support to decompress lzo compressed extents in restore. Signed-off-by: Josef Bacik <josef@redhat.com>
* btrfs-progs: add Makefile rule for static build of btrfs-find-rootHugo Mills2013-03-14
| | | | | | | | btrfs-find-root isn't yet integrated into the main btrfs tool, and is an important recovery tool, so it deserves to be built as a static binary. Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* btrfs-progs: Add a rule to build a static mkfs.btrfsAntoine Sirinelli2013-03-12
| | | | | | | | | | Static mkfs.btrfs can be used to "bootstrap" a system from a live CD which does not provide mkfs.btrfs. The executable produced is named mkfs.btrfs.static and built by invoking the "static" make rule. Signed-off-by: Antoine Sirinelli <antoine@monte-stello.com>
* btrfs-progs: don't link binaries to a dynamic libraryDavid Sterba2013-02-27
| | | | | | | | | | | | Linking 'btrfs' and other binaries against the dynamic library makes it tedious to use directly from the git repo. This is useful for testing various fixes, but now it'd need to also set LD_LIBRARY_PATH or install the library to a known path. Add a target for static library and use it for linking, the dynamic library is to be used by external users. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: libify some parts of btrfs-progsMark Fasheh2013-02-27
| | | | | | | | | | | | | | | External software wanting to use the functionality provided by the btrfs send ioctl has a hard time doing so without replicating tons of work. Of particular interest are functions like btrfs_read_and_process_send_stream() and subvol_uuid_search(). As that functionality requires a bit more than just send-stream.c and send-utils.c we have to pull in some other parts of the progs package. This patch adds code to the Makefile and headers to create a library, libbtrfs which the btrfs command now links to. Signed-off-by: Mark Fasheh <mfasheh@suse.de> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: move btrfslabel.[c|h] stuff to utils.[c|h]Jeff Liu2013-02-26
| | | | | | | | | Clean btrfslabel.[c|h] out of the source tree and move those related functions to utils.[c|h]. CC: Gene Czarcinski <gene@czarc.net> Signed-off-by: Jie Liu <jeff.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: require mkfs -f force option to overwrite filesystem or ↵Eric Sandeen2013-02-19
| | | | | | | | | | | | | | | | | | | | | | | | partition table The core of this is shamelessly stolen from xfsprogs. Use blkid to detect an existing filesystem or partition table on any of the target devices. If something is found, require the '-f' option to overwrite it, hopefully avoiding disaster due to mistyped devicenames, etc. # mkfs.btrfs /dev/sda1 WARNING! - Btrfs v0.20-rc1-59-gd00279c-dirty IS EXPERIMENTAL WARNING! - see http://btrfs.wiki.kernel.org before using /dev/sda1 appears to contain an existing filesystem (xfs). Use the -f option to force overwrite. # This does introduce a requirement on libblkid. Signed-off-by: Eric Sandeen <sandeen@redhat.com>
* btrfs-progs: add send-testMark Fasheh2013-02-13
| | | | | | | | send-test.c links against libbtrfs and uses the send functionality provided to decode and print a send stream to the console. Signed-off-by: Mark Fasheh <mfasheh@suse.de> Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs-progs: add restore command to btrfsIan Kumlien2013-02-12
| | | | | | | | Add 'btrfs restore' command which previously existed as a separate utility btrfs-restore. Signed-off-by: Ian Kumlien <pomac@demius.net> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: build btrsfck to keep compatibilityDavid Sterba2013-02-12
| | | | | | | The command 'btrfsck' is commonly used and we should build it by default. Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs-progs: add btrfsck functionality to btrfsIan Kumlien2013-02-12
| | | | | | | | This patch includes the functionality of btrfs, it's found as "btrfs check". Signed-off-by: Ian Kumlien <pomac@demius.net> Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs-progs: -U_FORTIFY_SOURCE before -DIan Kumlien2013-02-12
| | | | | | | | | | My builds are cluttered with: <command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default] Which makes it hard to tell if something breaks or not. Signed-off-by: Ian Kumlien <pomac@demius.net>
* Btrfs-progs: add static compile targetIan Kumlien2013-02-12
| | | | | | | | | | | | | | Sometimes, when you least expect it, a static binary is what you need to rescue your data... Or just get a good enough handle on things to make it work again ;) "make static" is a gift to you, dear user with filesystem problems! Anyway, on a more serious note, changed the cflags and ldflags so that we create a smaller binary, 1.1MB stripped on my 64 bit system (2.7MB with debug data) Signed-off-by: Ian Kumlien <pomac@demius.net>
* Merge branch 'for-chris' of git://repo.or.cz/btrfs-progs-unstable/devel into ↵Chris Mason2013-02-06
|\ | | | | | | | | | | | | | | | | raid56 Conflicts: ctree.h Signed-off-by: Chris Mason <chris.mason@fusionio.com>
| * btrfs-progs: fix parallel buildDavid Sterba2013-01-31
| | | | | | | | | | | | | | | | Parallel build may fail due to late creation of version.h, fix the rule name that does not match the filename. Signed-off-by: David Sterba <dsterba@suse.cz> Reviewed-by: Eri Sandeen <sandeen@redhat.com>