summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* fix a compile fail by strndup in RHEL5 envZhao Lei2010-09-23
| | | | | | | | | | | | | | | | | | | | | | When we compile btrfs-progs in RHEL5(with default gcc 4.1.2 and glibc-2.5-18), we can get following error: cc1: warnings being treated as errors btrfs-list.c: In function 'ino_resolve': btrfs-list.c:511: warning: implicit declaration of function 'strndup' btrfs-list.c:511: warning: incompatible implicit declaration of built-in function 'strndup' make: *** [btrfs-list.o] Error 1 ... cc1: warnings being treated as errors btrfs.c: In function 'split_command': btrfs.c:168: warning: implicit declaration of function 'strndup' btrfs.c:168: warning: incompatible implicit declaration of built-in function 'strndup' make: *** [btrfs-list.o] Error 1 We can add _GNU_SOURCE definition according man strndup. Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
* fix wrong return valueMiao Xie2010-09-23
| | | | | | | btrfsctl returns 1 if it does something successfully. this patch fixes this problem. Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
* Remove superfluous WARN_ON in btrfsckYan Zheng2010-09-23
| | | | Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
* add mounted-checking for btrfs-volMiao Xie2010-09-23
| | | | | | | Adding a mounted device is dangerous because it will destroy the filesystem on that mounted device. So we add mounted-checking for btrfs-vol. Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
* only print FIRST_CHUNK_TREE for chunk items in debug-treeSage Weil2010-09-23
| | | | | | | Otherwise we print FIRST_CHUNK_TREE for any objectid 256, which e.g. for the root tree is the first snap/subvol. Signed-off-by: Sage Weil <sage@newdream.net>
* check slash in deleting subvolumesTARUISI Hiroaki2010-09-23
| | | | | | | | | | | | For now, btrfsctl does not check whether subvolume name contains slash or not. If someone specify subvolume with trailing slash (in case using shell completion), ioctl returns with EINVAL and this error may confuse some careless users like me. So, this patch adds check slashes in subvolume name in deletion same as snapshot/subvolume creating. But considering shell completion, this fix allows trailing slash. Signed-off-by: TARUISI Hiroaki <taruishi.hiroak@jp.fujitsu.com>
* add missing include for btrfsck.cChristian Hesse2010-09-23
| | | | | | | | compiling btrfs-progs from current git I get an error in btrfsck.c about undefined references. The attached patch adds an include for sys/stat.h which fixes the problem for me. Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
* prevent btrfsck to run on mounted filesystemsAndi Drebes2010-09-23
| | | | | | | | | As recently discussed on the list, btrfsck should only be run on unmounted filesystems. This patch adds a short check for the mount status at the beginning of btrfsck. If the FS is mounted, the program aborts showing an error message. Signed-off-by: Andi Drebes <lists-receive@programmierforen.de>
* multidevice support for check_mountedAndi Drebes2010-09-23
| | | | | | | | | | | | | | Check_mount() should also work with multi device filesystems. This patch adds checks that allow to detect if a file is a device file used by a mounted single or multi device btrfs or if it is a regular file used by a loopback device that is part of a mounted single or multi device btrfs. The single device checks also work for non-btrfs filesystems. This might be helpful to prevent users from running btrfs programs (e.g. mkfs.btrfs) accidentally on a filesystem used somewhere else. Signed-off-by: Andi Drebes <lists-receive@programmierforen.de>
* Btrfs: add btrfs-debug-tree -b <block number> to print a single blockChris Mason2010-04-06
|
* Add btrfs subvol find-new commandChris Mason2010-03-18
| | | | | | | | btrfs-subvol find-new <subvol> <id> will search through a given subvol and print out all the files with extents newer than a given id. Care must be taken to make sure any pending delalloc is on disk before running this because that won't show up in the output.
* Add ioctl-test.c which just prints all the ioctl numbers.Chris Mason2010-03-15
| | | | | This is used to compare the output on 64 bit and 32 bit machines and make sure all of our ioctls are compat defined.
* Btrfs-progs: add btrfs filesystem df to print space infoJosef Bacik2010-03-14
| | | | | | | | | This goes along with the new space info ioctl. This will spit out the space info all nice and pretty with the type, it's flags (DUP, RAID) and how much space is in that group and how much is in use. Signed-off-by: Josef Bacik <josef@redhat.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Update the btrfs man page with the new commandsGoffredo Baroncelli2010-03-11
|
* Correct the check of the argument number for the "btrfs dev add|rem" commandsGoffredo Baroncelli2010-03-11
|
* Avoid the exit(2) function; instead return with an appropriate value;Goffredo Baroncelli2010-03-11
|
* Add the program name as the first parameter in the command of the btrfs toolGoffredo Baroncelli2010-03-11
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* new util: 'btrfs'ghigo2010-03-11
| | | | | | | | | | | | | | | This commit introduces a new command called 'btrfs' for managing a btrfs filesystem. 'btrfs' handles: - snapshot/subvolume creation - adding/removal of volume (ie: disk) - defragment of a tree - scan of a device searching a btrfs filesystem - re-balancing of the chunk on the disks - listing subvolumes and snapshots This has also been updated to include the new defrag range ioctl. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Add new defrag range ioctl that can also compress files on demand.Chris Mason2010-03-11
|
* Btrfs-progs: add command to set default subvolJosef Bacik2010-02-28
| | | | | | | | | | | | | | | | | | This introduces a new btrfsctl option, -m, to allow you to set the default'ly mounted subvolume. You can do btrfsctl -m /your/subvolume and that will make that subvolume the subvolume that is mounted by default, or you can do btrfsctl -m <treeid> /any/subvolume and this will make the subvolume with tree id <treeid> the default'ly mounted subvolume. You can get the treeid by using the listing option. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Add btrfs-list for listing subvolumesChris Mason2010-02-28
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Add btrfs-map-logical program to map and read logical block numbersChris Mason2009-11-12
| | | | | | | | | This allows us to figure out which physical byte offset on which device is the real location for a given logical block number. It can optionally read the block in and save it to a file for debugging analysis. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* btrfsck: check root back/forward referencesYan, Zheng2009-09-21
| | | | | | | | This patch adds semantic checks for links to snapshot/subvolume and root back/forward references. Signed-off-by: Yan Zheng <zheng.yan@oracle.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* btrfsctl: add snapshot/subvolume destroy ioctlYan, Zheng2009-09-21
| | | | | | | resend Aaron Straus's patch Signed-off-by: Yan Zheng <zheng.yan@oracle.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* used space accounting fix for the converterYan Zheng2009-06-12
| | | | | | | | remove code that updates the total used space, since btrfs_update_block_group does that work now. Signed-off-by: Yan Zheng <zheng.yan@oracle.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* btrfs-progs v0.19Chris Mason2009-06-11
|
* Check duplicate backrefs for both data and metadataYan Zheng2009-06-11
| | | | | | | | | | lookup_inline_extent_backref only checks for duplicate backref for data extent. It assumes backrefs for tree block never conflict. This patch makes lookup_inline_extent_backref check duplicate backrefs for both data and tree block, so that we can detect potential bug earlier. Signed-off-by: Yan Zheng <zheng.yan@oracle.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Make sure all dirty blocks are written at commit timeYan Zheng2009-06-08
| | | | | | | | | Write dirty block groups may make some block groups dirty. This patch make btrfs_write_dirty_block_groups properly handle the recursion. Signed-off-by: Yan Zheng <zheng.yan@oracle.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Update converter for the new formatYan Zheng2009-06-08
| | | | | Signed-off-by: Yan Zheng <zheng.yan@oracle.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Mixed back reference (FORWARD ROLLING FORMAT CHANGE)Chris Mason2009-06-08
| | | | | | | | | | | | | | | | | This commit introduces a new kind of back reference for btrfs metadata. Once a filesystem has been mounted with this commit, IT WILL NO LONGER BE MOUNTABLE BY OLDER KERNELS. The new back ref provides information about pointer's key, level and in which tree the pointer lives. This information allow us to find the pointer by searching the tree. The shortcoming of the new back ref is that it only works for pointers in tree blocks referenced by their owner trees. This is mostly a problem for snapshots, where resolving one of these fuzzy back references would be O(number_of_snapshots) and quite slow. The solution used here is to use the fuzzy back references in the common case where a given tree block is only referenced by one root, and use the full back references when multiple roots have a reference
* Fix man page headers to include the correct program name.Chris Mason2009-06-03
|
* Fix printf format casting errorsLuca Bruno2009-06-03
| | | | | | | | | | | | There are still some warnings of the form: format '%llu' expects type 'long long unsigned int' but argument has type 'u64' In conjunction with -Werror, this is causing some build failures. Now they're properly casted, avoiding compiler warnings. Signed-off-by: Luca Bruno <lucab@debian.org> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Fix spelling mistake when running 'btrfsck' when argument doesn't exist.nick d2009-06-03
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Update btrfs-debug-tree to output more readable strings.Shen Feng2009-06-03
| | | | | | | | | | output objectid in btrfs_disk_key with human readable strings. Other updates are included for more readable output. Thanks Fengguang's fix to this patch. Signed-off-by: Shen Feng <shen@cn.fujitsu.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Add btrfs-show man pagePeng Tao2009-06-03
| | | | | Signed-off-by: Peng Tao <bergwolf@gmail.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Add -V|--version to mkfs.btrfs argument parserLuca Bruno2009-06-03
| | | | | | | | | | | | | | | mkfs.btrfs now prints its version when invoked with -V|--version and exits without error. All other mkfs.* tools provide this feature and follow this implicit argument naming convention, as it is commonly used to check for helper tools presence. The corrisponding manual already mentions this option, no need to touch it. Signed-off-by: Luca Bruno <lucab@debian.org> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Add btrfs-image man pagePeng Tao2009-06-03
| | | | | Signed-off-by: Peng Tao <bergwolf@gmail.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Fix typos in btrfsck, btrfsctl, mkfs.btrfs manualPeng Tao2009-06-03
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Fix print-tree.c to skip blocks it can't read instead of abortingChris Mason2009-05-13
|
* Add scan of the btrfs log tree to btrfs-debug-treeChris Mason2009-04-15
|
* Fix showblocks to display different colors for different metadata rootsChris Mason2009-03-09
|
* Add man/btrfsck.8.in and Makefile for man pagesGoldwyn Rodrigues2009-01-21
| | | | Signed-off-by: Goldwyn Rodrigues <rgoldwyn@gmail.com>
* Add man/btrfsctl.8.inGoldwyn Rodrigues2009-01-21
| | | | Signed-off-by: Goldwyn Rodrigues <rgoldwyn@gmail.com>
* Add man/mkfs.btrfs.8.inGoldwyn Rodrigues2009-01-21
| | | | | | | | | Kept the name with the name in, so that further processing such as BUILD_DATE BUILD_VERSION etc. could be included later. All man pages included in the man directory to avoid file cluttering. Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.de>
* btrfsck.c: bit-fields should be unsignedWang Cong2009-01-21
| | | | | Signed-off-by: WANG Cong <wangcong@zeuux.org>
* btrfsck: Exit and print error message when not able to open a deviceThadeu Lima de Souza Cascardo2009-01-21
| | | | | | If btrfsck is not able to open a device, it segfaults. This fixes it and prints an error message too.
* btrfs-image.c: fix return valuesWang Cong2009-01-21
| | | | | | | | - Exit with non-zero when fail; - Don't exit in non-main functions, return. Signed-off-by: WANG Cong <wangcong@zeuux.org>
* btrfs-progs: make several functions staticWang Cong2009-01-21
| | | | | | | Make several functions static, and make one argument const. Signed-off-by: WANG Cong <wangcong@zeuux.org>
* Fix misleading error message in btrfsctlCalvin Walton2009-01-21
| | | | | | This updates Peter Klotz's original patch to use perror instead of fprintf when it fails to open /dev/btrfs-control
* Mention minimum size on devices that are considered too smallJan Engelhardt2009-01-21
| | | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de>