summaryrefslogtreecommitdiff
path: root/Makefile
Commit message (Collapse)AuthorAge
* 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>
| * Btrfs-progs: add support for device replace procedureStefan Behrens2013-01-31
| | | | | | | | | | | | | | | | | | | | | | This is the user mode part of the device replace patch series. The command group "btrfs replace" is added with three commands: - btrfs replace start srcdev|srcdevid targetdev [-Bfr] mount_point - btrfs replace status mount_point [-1] - btrfs replace cancel mount_point Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
| * Btrfs-progs: move open_file_or_dir() to utils.cAnand Jain2013-01-30
| | | | | | | | | | | | | | | | | | | | | | The definition of the function open_file_or_dir() is moved from common.c to utils.c in order to be able to share some common code between scrub and the device stats in the following step. That common code uses open_file_or_dir(). Since open_file_or_dir() makes use of the function dirfd(3), the required XOPEN version was raised from 6 to 7. Signed-off-by: Anand Jain <anand.jain@oracle.com> Original-Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
| * btrfs-progs pretty/quiet buildEric Sandeen2013-01-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A quieter build makes warnings more obvious. This could probably be improved, but just to see if people like this or if they hate it. :) make V=1 overrides it and gets you the full glory again. [CC] ctree.o [CC] disk-io.o [CC] radix-tree.o [CC] extent-tree.o ... Signed-off-by: Eric Sandeen <sandeen@redhat.com>
| * btrfs-progs: Add btrfs-show-superStefan Behrens2013-01-23
| | | | | | | | | | | | | | Just a small program to print the fields of a super block. Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de> Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
| * Btrfs-progs: detect if the disk we are formatting is a ssdJosef Bacik2013-01-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch rebased because of changes in mkfs.c but otherwise the same as created by Josef Bacik SSD's do not gain anything by having metadata DUP turned on. The underlying file system that is a part of all SSD's could easily map duplicate metadat blocks into the same erase block which effectively eliminates the benefit of duplicating the metadata on disk. So detect if we are formatting a single SSD drive and if we are do not use DUP. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Gene Czarcinski <gene@czarc.net>
* | Add basic RAID[56] supportDavid Woodhouse2013-02-01
|/ | | | | | | | | | | | | | | | David Woodhouse originally contributed this code, and Chris Mason changed it around to reflect the current design goals for raid56. The original code expected all metadata and data writes to be full stripes. This meant metadata block size == stripe size, and had a few other restrictions. This version allows metadata blocks smaller than the stripe size. It implements both raid5 and raid6, although it does not have code to rebuild from parity if one of the drives is missing or incorrect. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* Btrfs progs: quota groups supportArne Jansen2012-09-04
| | | | | Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net> Signed-off-by: Arne Jansen <sensille@gmx.net>
* Switch to -O1 for optimizations to enable FORTIFY_SOURCEChris Mason2012-07-26
| | | | Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* Btrfs-progs: add btrfs send/receive commandsAlexander Block2012-07-26
| | | | | | | | | | Add user space commands for btrfs send/receive. Signed-off-by: Alexander Block <ablock84@googlemail.com> Reviewed-by: David Sterba <dave@jikos.cz> Reviewed-by: Arne Jansen <sensille@gmx.net> Reviewed-by: Jan Schmidt <list.btrfs@jan-o-sch.net> Reviewed-by: Alex Lyakas <alex.bolshoy.btrfs@gmail.com>
* Makefile: use $(MAKE) instead of hardcoded 'make'Sergei Trofimovich2012-06-05
| | | | | CC: Chris Mason <chris.mason@oracle.com> Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>