summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* btrfs-progs: Improvement for making btrfs image from source directory.Zhong, Xin2011-10-25
| | | | | | | | | | | | * Initialize ret in btrfs_csum_file_block * Do not abort when xattr is not supported in the source directory * Remove size limitation of 256M * Alloc data chunk in a smaller size (8M) to make btrfs image smaller * Let user specify the btrfs image name Depends on below patch from samsung guys: http://marc.info/?l=linux-btrfs&m=127858068226025&w=2 Signed-off-by: Zhong, Xin <xin.zhong@intel.com>
* Scan the devices listed in /proc/partitionsGoffredo Baroncelli2011-10-25
| | | | | | | | | | | During the commands: - btrfs filesystem show - btrfs device scan the devices "scanned" are extracted from /proc/partitions. This should avoid to scan devices not suitable for a btrfs filesystem like cdrom and floppy or to scan not existant devices. The old behavior (scan all the block devices under /dev) may be forced passing the "--all-devices" switch.
* Btrfs-progs: specify label length larger than 255 bytes cause mkfs.btrfs ↵Jeff Liu2011-10-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | buffer overflow Hello, While going through the mkfs.c, I noticed there is an issue for label length checking, mkfs.btrfs will crashed if the label length exceeding 255 bytes, it's easy to triggered that out as below: jeff@pibroch:~/opensource/btrfs-progs$ sudo ./mkfs.btrfs -L `perl -e 'print "A"x256'` /usr/src/linux-3.0/img0 WARNING! - Btrfs v0.19-35-g1b444cd IS EXPERIMENTAL WARNING! - see http://btrfs.wiki.kernel.org before using *** buffer overflow detected ***: ./mkfs.btrfs terminated ======= Backtrace: ========= /lib/i386-linux-gnu/libc.so.6(__fortify_fail+0x50)[0xb7774df0] /lib/i386-linux-gnu/libc.so.6(+0xe4cca)[0xb7773cca] /lib/i386-linux-gnu/libc.so.6(__strcpy_chk+0x3f)[0xb777305f] ./mkfs.btrfs[0x805acc4] ./mkfs.btrfs[0x805def6] /lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0xb76a5e37] ./mkfs.btrfs[0x8048ef1] ======= Memory map: ======== ...... a tiny patch could fix it. Signed-off-by: Jie Liu <jeff.liu@oracle.com>
* btrfsck: decode error properlySergei Trofimovich2011-10-25
| | | | | | | | | | | | | | | check_mounted() returns kernel-style negative errors. Patch drops sign for strerror(). Before the patch: check_mounted(): Could not open /dev/sdb2 Could not check mount status: Unknown error 18446744073709551603 After the patch: check_mounted(): Could not open /dev/sdb2 Could not check mount status: Permission denied Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* check number of args for btrfs sub snap correctlyAndreas Philipp2011-10-25
| | | | | | | | Check whether there are the right number of arguments (exatly 2 without the flag -r) in the subcommand handler for the btrfs subvolume snapshot command. Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com>
* Btrfs-progs: add "btrfs subvolume get-default" subcommandZhong, Xin2011-10-25
| | | | | | | | | | | | | | Add subcommand to get the default subvolume of btrfs filesystem V2->V3: * add man page * based on http://git.darksatanic.net/repo/btrfs-progs-unstable.git integration-20110705 Reviewed-by: Andreas Philipp <philipp.andreas@gmail.com> Reviewed-by: Goffredo Baroncelli <kreijack@libero.it> Reported-by: Yang, Yi <yi.y.yang@intel.com> Signed-off-by: Zhong, Xin <xin.zhong@intel.com>
* btrfs-progs-unstable: replace debug-tree to btrfs-debug-tree in INSTALLWang Sheng-Hui2011-10-25
| | | | | | | | | | | | | From c04da1655df6d75db834ddbd3a3b4a58a0d9a0c9 Mon Sep 17 00:00:00 2001 From: Wang Sheng-Hui <shhuiw@gmail.com> Date: Mon, 18 Jul 2011 02:17:31 -0500 Subject: [PATCH] btrfs-progs-unstable: replace debug-tree to btrfs-debug-tree in INSTALL debug-tree doesn't exist after btrfs-progs installed. Use btrfs-debug-tree to print FS metadata in text form, not debug-tree. Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
* fix incorrect argument checking for "btrfs sub snap -r"Hugo Mills2011-10-25
| | | | | | | | Stephane Chazelas and Andreas Philipp spotted that the earlier patch fixing this issue was incomplete, and should also update the argument- count checking code as well. Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* btrfs-progs: scrub added to manpageJan Schmidt2011-10-25
| | | | | Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* btrfs-progs: scrub userland implementationJan Schmidt2011-10-25
| | | | | Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* btrfs-progs: added check_mounted_whereJan Schmidt2011-10-25
| | | | | | | | | new version of check_mounted() returning more information gathered while searching. check_mounted() is now a wrapper for check_mounted_where(). the new version is needed by scrub.c Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* btrfs-progs: scrub ioctlsJan Schmidt2011-10-25
| | | | | | | | | - scrub structs added - ioctls for scrub - BTRFS_FSID_SIZE moved Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* 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>
* remove unused include "version.h"Andreas Philipp2011-10-25
| | | | | | | | In the file btrfs-list.c version.h was included but not used. So just drop it. Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* update manpage entries for btrfs subvolume listAndreas Philipp2011-10-25
| | | | | | | | Update the manpage entries for the btrfs subvolume list command to reflect the newly created additional option '-p'. Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* print parent ID in btrfs suvolume listAndreas Philipp2011-10-25
| | | | | | | | | There was some discussion on "where" subvolumes live in. Why do we not simply print the parent ID for each subvolume in btrfs subvolume list? This patch adds this functionality when called with parameter "-p". Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com> 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>
* remove unused variablesHubert Kario2011-10-25
| | | | | | | fixes compilation warnings with gcc 4.6.0 20110429 Signed-off-by: Hubert Kario <kario@wit.edu.pl> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* gcc 4.6: fix potentially unused variableHugo Mills2011-10-25
| | | | | | | Fix a complaint by gcc 4.6 that "ret" may be unused in process_one_leaf of btrfsck. 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
* mkfs.btrfs: Fix compilation errors with gcc 4.6Hugo Mills2011-10-25
| | | | | | | | | gcc 4.6 complains about several possible use-before-initialise cases in mkfs, and stops. Fix these by initialising one of the variables in question, and using the correct error-handling paths for the remainder. Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* Btrfs-progs: Correct path munging in bcpcwillu2011-10-25
| | | | | | | | | | Bcp was assuming that a path on the command line would never have a slash after it, which is silly, and would cause the first letter of everything in the root of the source to be truncated. Instead, use os.path.relpath to handle it properly. Signed-off-by: Carey Underwood <cwillu@cwillu.com> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* btrfs-map-logical: segfaults when no output file is givenArne Jansen2011-10-25
| | | | | | | | when no output file is given, info_file stays NULL and the following fprintf segfaults. Default to stdout. Signed-off-by: Arne Jansen <sensille@gmx.net> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* mkfs.btrfs: fix error text in '-r' modeSergei Trofimovich2011-10-25
| | | | | | | | | | Smart gcc noticed use of uninitialized warning when compiled with -O0 flags: mkfs.c:1291: error: 'file' may be used uninitialized in this function Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* mkfs.btrfs: fix memory leak caused by 'scandir()' callsSergei Trofimovich2011-10-25
| | | | | Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* mkfs.btrfs: free buffers allocated by pretty_sizesSergei Trofimovich2011-10-25
| | | | | | | | | | | found by valgrind: ==2559== 16 bytes in 1 blocks are definitely lost in loss record 3 of 19 ==2559== at 0x4C2720E: malloc (vg_replace_malloc.c:236) ==2559== by 0x412F7E: pretty_sizes (utils.c:1054) ==2559== by 0x4179E9: main (mkfs.c:1395) Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* mkfs.btrfs: write zeroes instead on uninitialized data.Sergei Trofimovich2011-10-25
| | | | | | | | | | | | | | | | | | | | | | | | | Found by valgrind: ==8968== Use of uninitialised value of size 8 ==8968== at 0x41CE7D: crc32c_le (crc32c.c:98) ==8968== by 0x40A1D0: csum_tree_block_size (disk-io.c:82) ==8968== by 0x40A2D4: csum_tree_block (disk-io.c:105) ==8968== by 0x40A7D6: write_tree_block (disk-io.c:241) ==8968== by 0x40ACEE: __commit_transaction (disk-io.c:354) ==8968== by 0x40AE9E: btrfs_commit_transaction (disk-io.c:385) ==8968== by 0x42CF66: make_image (mkfs.c:1061) ==8968== by 0x42DE63: main (mkfs.c:1410) ==8968== Uninitialised value was created by a stack allocation ==8968== at 0x42B5FB: add_inode_items (mkfs.c:493) 1. On-disk inode format has reserved (and thus, random at alloc time) fields: btrfs_inode_item: __le64 reserved[4] 2. Sometimes extents are created on disk without writing data there. (Or at least not all data is written there). Kernel code always had it kzalloc'ed. Zero them all. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* mkfs.btrfs: fix symlink names writingSergei Trofimovich2011-10-25
| | | | | | | | | | | | | | | | | | | | Found by valgrind: ==8968== Use of uninitialised value of size 8 ==8968== at 0x41CE7D: crc32c_le (crc32c.c:98) ==8968== by 0x40A1D0: csum_tree_block_size (disk-io.c:82) ==8968== by 0x40A2D4: csum_tree_block (disk-io.c:105) ==8968== by 0x40A7D6: write_tree_block (disk-io.c:241) ==8968== by 0x40ACEE: __commit_transaction (disk-io.c:354) ==8968== by 0x40AE9E: btrfs_commit_transaction (disk-io.c:385) ==8968== by 0x42CF66: make_image (mkfs.c:1061) ==8968== by 0x42DE63: main (mkfs.c:1410) ==8968== Uninitialised value was created by a stack allocation ==8968== at 0x42B5FB: add_inode_items (mkfs.c:493) readlink(2) does not write '\0' for us, so make it manually. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* mkfs.btrfs: return some defined value instead of garbage when lookup checksumSergei Trofimovich2011-10-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | ==31873== Command: ./mkfs.btrfs -r /some/root/ ==31873== Parent PID: 31872 ==31873== ==31873== Conditional jump or move depends on uninitialised value(s) ==31873== at 0x42C3D0: add_file_items (mkfs.c:792) ==31873== by 0x42CAB3: traverse_directory (mkfs.c:948) ==31873== by 0x42CF11: make_image (mkfs.c:1047) ==31873== by 0x42DE53: main (mkfs.c:1401) ==31873== Uninitialised value was created by a stack allocation ==31873== at 0x41B1B1: btrfs_csum_file_block (file-item.c:195) 'ret' value was not initialized for 'found' branch. The same fix sits in kernel: > commit 639cb58675ce9b507eed9c3d6b3335488079b21a > Author: Chris Mason <chris.mason@oracle.com> > Date: Thu Aug 28 06:15:25 2008 -0400 > > Btrfs: Fix variable init during csum creation > > Signed-off-by: Chris Mason <chris.mason@oracle.com> Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* mkfs.btrfs: fail on scandir error (-r mode)Sergei Trofimovich2011-10-25
| | | | | | | | | | | | | | | | | | | | | | mkfs.btrfs does not handle relative pathnames for now. When they are passed to it it creates empty image. So first time I thought it does not work at all. This patch adds error handling for scandir(). With patch it behaves this way: $ mkfs.btrfs -r ./root ... fs created label (null) on output.img nodesize 4096 leafsize 4096 sectorsize 4096 size 256.00MB Btrfs v0.19-52-g438c5ff-dirty scandir for ./root failed: No such file or directory unable to traverse_directory Making image is aborted. mkfs.btrfs: mkfs.c:1402: main: Assertion `!(ret)' failed. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* btrfs-convert: fix typo: 'all inode' -> 'all inodes'Sergei Trofimovich2011-10-25
| | | | | Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* make "btrfs filesystem label" command actually workFajar A. Nugraha2011-10-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This simple patch makes "btrfs filesystem label" command actually work. On tmp branch, commit d1dc6a9, "btrfs filesystem label" functionality was introduced. However the commit lacks one component that lets "btrfs" accept "filesystem label" command. Test case: /dev/loop0 WARNING! - Btrfs Btrfs v0.19 IS EXPERIMENTAL WARNING! - see http://btrfs.wiki.kernel.org before using fs created label old on /dev/loop0 nodesize 4096 leafsize 4096 sectorsize 4096 size 1.00GB Btrfs Btrfs v0.19 old new FATAL: the filesystem has to be unmounted new Not sure if you need if you need a signoff for something as trivial as this, but here it is just in case. Signed-off-by: Fajar A. Nugraha <list@fajar.net> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* btrfs progs: fix extra metadata chunk allocation in --mixed caseArne Jansen2011-10-25
| | | | | | | | | | | | | | | | | | | | When creating a mixed fs with mkfs, an extra metadata chunk got allocated. This is because btrfs_reserve_extent calls do_chunk_alloc for METADATA, which in turn wasn't able to find the proper space_info, as __find_space_info did a hard compare of the flags. It is now sufficient for the space_info to include the proper flag. This reflects the change done to the kernel code to support mixed chunks. Also for a subsequent chunk allocation (which should not be hit in the mkfs case), the chunk is now created with the flags from the space_info instead of the requested flags. A better solution would be to pull the full changeset for the mixed case from the kernel into the user mode (or, even better, share the code) The additional chunk probably confused block_rsv calculation, which in turn led to severeal ENOSPC Oopses. Signed-off-by: Arne Jansen <sensille@gmx.net> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* incorrect argument checking for "btrfs sub snap -r"Stephane Chazelas2011-10-25
| | | | | | | Looks like this was missing in integration-20110626 for the readonly snapshot patch: Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* btrfs-progs: Fix over-sized limit on bufferHugo Mills2011-10-25
| | | | | | | gcc-4.4 complains (rightly) that the strncpy has a limit too large for the array it's copying into. Use the correct array length. Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* Updated manpage for btrfs subvolume snapshot.Andreas Philipp2011-10-25
| | | | | Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* Test the additional ioctl.Andreas Philipp2011-10-25
| | | | | Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* Support the new parameters in do_clone(int argc, char** argv).Andreas Philipp2011-10-25
| | | | | | | | Now 'btrfs subvolume snapshot' takes not two but only at least two parameters. Additionally, the help message is updated accordingly. Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* Add support for read-only subvolumes.Andreas Philipp2011-10-25
| | | | | | | | Use BTRFS_IOC_CREATE_SNAP_V2 instead of BTRFS_IOC_CREATE_SNAP and add an option for the creation of a readonly snapshot. Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* Added support for an additional ioctl.Andreas Philipp2011-10-25
| | | | | | | | Added BTRFS_IOC_SNAP_CREATE_V2 and struct btrfs_ioctl_vol_args_v2 as defined in fs/btrfs/ioctl.h in the kernel sources. Signed-off-by: Andreas Philipp <philipp.andreas@gmail.com> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* btrfs-progs: cast u64 to long long to avoid printf warningsAnton Blanchard2011-10-25
| | | | | | | | | | | | When building on ppc64 I hit a number of warnings in printf: btrfs-map-logical.c:69: error: format ‘%Lu’ expects type ‘long long unsigned int’, but argument 4 has type ‘u64’ Fix them. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* Fix unused-but-set errors in gcc-4.6Chris Ball2011-10-25
| | | | | | | | | | | | | | | | gcc-4.6 (as shipped in Fedora) turns on -Wunused-but-set-variable by default, which breaks the build when combined with -Wall, e.g.: debug-tree.c: In function ‘print_extent_leaf’: debug-tree.c:45:13: error: variable ‘last_len’ set but not used [-Werror=unused-but-set-variable] debug-tree.c:44:13: error: variable ‘last’ set but not used [-Werror=unused-but-set-variable] debug-tree.c:41:21: error: variable ‘item’ set but not used [-Werror=unused-but-set-variable] cc1: all warnings being treated as errors This patch fixes the errors by removing the unused variables. Signed-off-by: Chris Ball <cjb@laptop.org> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* add detailed help messages to btrfs commandHubert Kario2011-10-25
| | | | | | | | | | | | | | | | extend the btrfs <cmd> --help command to print detailed help message if available but fallback to basic help message if detailed is unavailable add detailed help message for 'filesystem defragment' command little tweaks in comments Signed-off-by: Hubert Kario <kario@wit.edu.pl> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* add advanced use of --help to help messageHubert Kario2011-10-25
| | | | | | | | | | | explain how to use btrfs <cmd> --help command in help message Signed-off-by: Hubert Kario <kario@wit.edu.pl> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* mkfs should initialize unused fields properlyJan Schmidt2011-10-25
| | | | | | | | | | | we discovered speed setting is (probably unintentionally) initialized to 1 in make_btrfs(), while being initialized to 0 in btrfs_add_to_fsid(). initialization in make_btrfs() is due to reuse of buf after pwrite() without clearing it. consequently, code like btrfs_set_extent_generation(buf, extent_item, 1); writes to the same location in buf where speed will be placed, later. It may be a good idea to clear buf after each pwrite(), though leaving the struct btrfs_header intact. Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* btrfs-progs: setting of time to the root directoryTsutomu Itoh2011-10-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the setting of time to the root directory to the mkfs.btrfs command. As a result, the time of the mount point not correctly displayed comes to be displayed correctly. [before] # mkfs.btrfs /dev/sdd10 # mount /dev/sdd10 /test1 # ls -ld /test1 dr-xr-xr-x 1 root root 0 Jan 1 1970 /test1 [after] # date Tue Nov 16 18:06:05 JST 2010 # mkfs.btrfs /dev/sdd10 # mount /dev/sdd10 /test1 # ls -ld /test1 dr-xr-xr-x 1 root root 0 Nov 16 18:06 /test1 Thanks, Tsutomu Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* btrfs-progs: add discard support to mkfsChristoph Hellwig2011-10-25
| | | | | | | | Discard the whole device before starting to create the filesystem structures. Modelled after similar support in mkfs.xfs. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* btrfs-progs: fix wrong extent buffer size when reading tree blockMiao Xie2011-10-25
| | | | | | | | the root extent buffer of a tree may not be a leaf, so we must get the right size by its level when reading it. Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* btrfs-progs: Add new feature to mkfs.btrfs to make file system image file ↵Donggeun Kim2011-10-25
| | | | | | | | | | | | | | | | | | from source directory Changes from V1 to V2: - support extended attributes - move btrfs_alloc_data_chunk function to volumes.c - fix an execution error when additional useless parameters are specified - fix traverse_directory function so that the insertion functions for the common items are invoked in a single point The extended attributes is implemented through llistxattr and getxattr function calls. Thanks Signed-off-by: Donggeun Kim <dg77.kim@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>