summaryrefslogtreecommitdiff
path: root/Makefile
Commit message (Collapse)AuthorAge
* 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>
* Makefile: use $(CC) as a compilers instead of $(CC)/gccSergei Trofimovich2012-06-05
| | | | | CC: Chris Mason <chris.mason@oracle.com> Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* Btrfsck: add the ability to prune corrupt extent allocation tree blocksChris Mason2012-02-21
| | | | | | | When we discover bad blocks in the extent allocation tree, repair can now discard them and recreate the references from the rest of the trees. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Fix btrfs-convert, btrfs-restore and btrfs-find-root buildChris Mason2012-02-08
| | | | | | | Signed-off-by: Chris Mason <chris.mason@oracle.com> fixit Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Turn off some commands in MakefileChris Mason2012-02-08
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs-progs: add 'balance' command group infrastructureIlya Dryomov2012-02-03
| | | | | | | Add balance command group under both 'btrfs' and 'btrfs filesystem'. Preserve the old 'btrfs filesystem balance <path>' behaviour. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
* Btrfs-progs: implement new subcommand parserIlya Dryomov2012-02-03
| | | | | | | | | | | | | | | | This completely replaces the existing subcommand infrastructure, which is not flexible enough to accomodate our needs. Instead of a global command table we now have per-level tables and command group handlers, which allows command-group-specific handling of options and subcommands. The new parser exports a clear interface and gets out of the way - all control over how matching is done is passed to commands and command group handlers. One side effect of this is that command implementors have to check the number of arguments themselves - patch to fix up all existing commands follows. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
* Btrfs-progs: rearrange files in the repoIlya Dryomov2012-02-03
| | | | | | | Separate every command group into its own file (cmds_<group>.c) and rearrange includes. Remove btrfs_cmds.c. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
* Btrfs-progs: Relocate -lpthread in makefileArnd Hannemann2011-12-01
| | | | | | | | | | | | | | | | | | | | | This patch fixes the following compile error when compiled with gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3): gcc -lpthread -g -O0 -o btrfs btrfs.o btrfs_cmds.o scrub.o \ ctree.o disk-io.o radix-tree.o extent-tree.o print-tree.o root-tree.o dir-item.o file-item.o inode-item.o inode-map.o crc32c.o rbtree.o extent-cache.o extent_io.o volumes.o utils.o btrfs-list.o btrfslabel.o -luuid scrub.o: In function `scrub_start': /home/arnd/Projekte/kernel/btrfs-progs/scrub.c:1342: undefined reference to `pthread_create' /home/arnd/Projekte/kernel/btrfs-progs/scrub.c:1360: undefined reference to `pthread_create' /home/arnd/Projekte/kernel/btrfs-progs/scrub.c:1374: undefined reference to `pthread_join' /home/arnd/Projekte/kernel/btrfs-progs/scrub.c:1430: undefined reference to `pthread_cancel' /home/arnd/Projekte/kernel/btrfs-progs/scrub.c:1432: undefined reference to `pthread_join' collect2: ld returned 1 exit status make: *** [btrfs] Error 1 The gcc man page says: "[...] the placement of the -l option is significant." so lets include -lpthread together with the usual $(LIBS) Signed-off-by: Arnd Hannemann <arnd@arndnet.de> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* btrfs-progs: add a utility to corrupt a single blockChris Mason2011-10-27
|
* restore: deal with holes and set i_size correctlyChris Mason2011-10-27
| | | | | | | | This changes restore to set the i_size of the files it copies out based on the size in the inode. It also changes it to skip over holes. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* btrfs-progs: add a recovery utility to pull files from damanged filesystemsJosef Bacik2011-10-27
| | | | | Signed-off-by: Josef Bacik <josef@redhat.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* btrfs-progs: commands addedJan Schmidt2011-10-25
| | | | | | | | - scrub commands added - open_file_or_dir no longer static (needed by scrub.c) Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* some style/layout changesAndreas Philipp2011-10-25
| | | | | | | | Just do a few simple style/layout changes to make the makefile look better. Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* add all targets to clean targetAndreas Philipp2011-10-25
| | | | | | | | | When issuing 'make clean' not all files generated by the individual targets have been deleted since some files have been missing in the definition of the 'make clean' target. Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* make btrfs cross compilation friendlyKamble, Nitin A2011-10-25
| | | | | | | | | | | | | | | | | | Attached is a patch to fix a cross compilation issue I observed with btrfs-tools. Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Hugo Mills <hugo@carfax.org.uk> Nitin A Kamble Yocto Project www.yoctoproject.org Avoid these kinds of errors while doing cross build: | ccache i586-poky-linux-gcc -march=i586 --sysroot=/disk0/pokybuild/build0/tmp/sysroots/qemux86 -Wp,-MMD,./.btrfsctl.o.d,-MT,btrfsctl.o -Wall -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -O2 -pipe -g -feliminate-unused-debug-types -c btrfsctl.c | gcc -O2 -pipe -g -feliminate-unused-debug-types -o btrfsctl btrfsctl.o ctree.o disk-io.o radix-tree.o extent-tree.o print-tree.o root-tree.o dir-item.o file-item.o inode-item.o inode-map.o crc32c.o rbtree.o extent-cache.o extent_io.o volumes.o utils.o btrfs-list.o -Wl,-O1 -Wl,--as-needed -luuid | /usr/bin/ld: i386 architecture of input file `btrfsctl.o' is incompatible with i386:x86-64 output | /usr/bin/ld: i386 architecture of input file `ctree.o' is incompatible with i386:x86-64 output
* Add the "btrfs filesystem label" commandGoffredo Baroncelli2011-10-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hi all, this patch adds the command "btrfs filesystem label" to change (or show) the label of a filesystem. This patch is a subset of the one written previously by Morey Roof. I included the user space part only. So it is possible only to change/show a label of a *single device* and *unounted* filesystem. The reason of excluding the kernel space part, is to simplify the patch in order to speed the check and then the merging of the patch itself. In fact I have to point out that in the past there was almost three attempts to propose this patch, without success neither complaints. Chris, let me know how you want to proceed. I know that you are very busy, and you prefer to work to stabilize btrfs instead adding new feature. But I think that changing a label is a *essential* feature for a filesystem managing tool. Think about a mount by LABEL. To show a label $ btrfs filesystem label <device> To set a label $ btrfs filesystem label <device> <newlabel> Please guys, give a look to the source. Comments are welcome. You can pull the source from the branch "label" of the repository http://cassiopea.homelinux.net/git/btrfs-progs-unstable.git Regards G.Baroncelli Signed-off-by: Chris Mason <chris.mason@oracle.com>