Commit Graph

336 Commits (075587c96c2f39e227847d13ca0ef305b13cd7d3)
 

Author SHA1 Message Date
Chris Mason 075587c96c Btrfs: add btrfs-debug-tree -b <block number> to print a single block 2010-04-06 09:30:17 -04:00
Chris Mason 8f55b769c7 Add btrfs subvol find-new command
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.
2010-03-18 12:32:32 -04:00
Chris Mason fb3a539c92 Add ioctl-test.c which just prints all the ioctl numbers.
This is used to compare the output on 64 bit and 32 bit machines and
make sure all of our ioctls are compat defined.
2010-03-15 11:24:20 -04:00
Josef Bacik b72e4c4e19 Btrfs-progs: add btrfs filesystem df to print space info
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>
2010-03-14 08:34:38 -04:00
Goffredo Baroncelli 35401ac190 Update the btrfs man page with the new commands 2010-03-11 22:09:46 -05:00
Goffredo Baroncelli 866539056a Correct the check of the argument number for the "btrfs dev add|rem" commands 2010-03-11 22:09:46 -05:00
Goffredo Baroncelli e584004d3c Avoid the exit(2) function; instead return with an appropriate value; 2010-03-11 22:09:46 -05:00
Goffredo Baroncelli 7ebebb7bb1 Add the program name as the first parameter in the command of the btrfs tool
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2010-03-11 22:09:38 -05:00
ghigo 6d2cf04247 new util: 'btrfs'
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>
2010-03-11 13:45:47 -05:00
Chris Mason 06cbf62fda Add new defrag range ioctl that can also compress files on demand. 2010-03-11 09:38:52 -05:00
Josef Bacik 7b14bc0f4f Btrfs-progs: add command to set default subvol
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>
2010-02-28 19:24:25 -05:00
Chris Mason 4ff9e2af17 Add btrfs-list for listing subvolumes
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2010-02-28 15:35:38 -05:00
Chris Mason ab8fb4c995 Add btrfs-map-logical program to map and read logical block numbers
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>
2009-11-12 14:49:03 -05:00
Yan, Zheng 6f3cf25a4e btrfsck: check root back/forward references
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>
2009-09-21 16:03:57 -04:00
Yan, Zheng 45195b216d btrfsctl: add snapshot/subvolume destroy ioctl
resend Aaron Straus's patch

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2009-09-21 16:03:57 -04:00
Yan Zheng 4f89b6eb07 used space accounting fix for the converter
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>
2009-06-12 12:55:50 -04:00
Chris Mason 5e762a371f btrfs-progs v0.19 2009-06-11 12:56:15 -04:00
Yan Zheng 0e3c5d410f Check duplicate backrefs for both data and metadata
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>
2009-06-11 09:27:37 -04:00
Yan Zheng 0030f1d3ae Make sure all dirty blocks are written at commit time
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>
2009-06-08 13:31:10 -04:00
Yan Zheng 50860d6e31 Update converter for the new format
Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2009-06-08 13:31:10 -04:00
Chris Mason 95d3f20b51 Mixed back reference (FORWARD ROLLING FORMAT CHANGE)
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
2009-06-08 13:30:36 -04:00
Chris Mason 2d39a83829 Fix man page headers to include the correct program name. 2009-06-03 12:15:40 -04:00
Luca Bruno 6fa19b04d9 Fix printf format casting errors
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>
2009-06-03 12:15:40 -04:00
nick d 99b6d94018 Fix spelling mistake when running 'btrfsck' when argument doesn't exist.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2009-06-03 12:15:40 -04:00
Shen Feng 61907d4e81 Update btrfs-debug-tree to output more readable strings.
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>
2009-06-03 12:15:40 -04:00
Peng Tao 0869c0ca7c Add btrfs-show man page
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2009-06-03 12:15:40 -04:00
Luca Bruno 3fb5c031fe Add -V|--version to mkfs.btrfs argument parser
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>
2009-06-03 12:15:40 -04:00
Peng Tao bf2b9d2ba4 Add btrfs-image man page
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2009-06-03 12:15:40 -04:00
Peng Tao a74f4651c9 Fix typos in btrfsck, btrfsctl, mkfs.btrfs manual
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2009-06-03 12:15:40 -04:00
Chris Mason ed20f5fc90 Fix print-tree.c to skip blocks it can't read instead of aborting 2009-05-13 11:27:35 -04:00
Chris Mason cc04d99e90 Add scan of the btrfs log tree to btrfs-debug-tree 2009-04-15 14:30:14 -04:00
Chris Mason b8420fabb8 Fix showblocks to display different colors for different metadata roots 2009-03-09 13:00:44 -04:00
Goldwyn Rodrigues e3b0f66bde Add man/btrfsck.8.in and Makefile for man pages
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@gmail.com>
2009-01-21 13:22:49 -05:00
Goldwyn Rodrigues bdfb2fd0fa Add man/btrfsctl.8.in
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@gmail.com>
2009-01-21 13:22:49 -05:00
Goldwyn Rodrigues ecc69a3b47 Add man/mkfs.btrfs.8.in
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>
2009-01-21 13:22:49 -05:00
Wang Cong 47e1a8f56a btrfsck.c: bit-fields should be unsigned
Signed-off-by: WANG Cong <wangcong@zeuux.org>
2009-01-21 13:22:49 -05:00
Thadeu Lima de Souza Cascardo af250420ca btrfsck: Exit and print error message when not able to open a device
If btrfsck is not able to open a device, it segfaults. This fixes it and
prints an error message too.
2009-01-21 13:59:36 -05:00
Wang Cong ed62c2b0c2 btrfs-image.c: fix return values
- Exit with non-zero when fail;
- Don't exit in non-main functions, return.

Signed-off-by: WANG Cong <wangcong@zeuux.org>
2009-01-21 13:22:49 -05:00
Wang Cong 86179a0507 btrfs-progs: make several functions static
Make several functions static, and make one argument const.

Signed-off-by: WANG Cong <wangcong@zeuux.org>
2009-01-21 13:22:49 -05:00
Calvin Walton 901314f070 Fix misleading error message in btrfsctl
This updates Peter Klotz's original patch to use perror instead of fprintf
when it fails to open /dev/btrfs-control
2009-01-21 13:22:49 -05:00
Jan Engelhardt 16b04fb5f5 Mention minimum size on devices that are considered too small
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
2009-01-21 13:22:49 -05:00
Goldwyn Rodrigues 20da00318d Modify Makefile to include man directory 2009-01-21 13:22:49 -05:00
Yan Zheng fc5a740b1c Update convert for uninitialized block groups
There is a new feature 'uninitialized block groups' in ext4.
Block and inode bitmaps in uninitialized block groups are
uninitialized. This confuses the converter. The fix is call
ext2fs_new_inode for each block group at open time. It set
up uninitialized block and inode bitmaps appropriately.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
2009-01-21 13:22:49 -05:00
Chris Mason fd53de4d01 Drop bit-radix.[ch] files
These are no longer in use

Signed-off-by: Chris Mason <chris.mason@oracle.com>
2009-01-21 14:00:24 -05:00
Chris Mason a7c5f04870 Update version.sh to 0.18
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2009-01-16 20:08:19 -05:00
Chris Mason f9f3fff9a4 Fix ioctl arg size (userland incompatible change!)
The structure used to send device in btrfs ioctl calls was not
properly aligned, and so 32 bit ioctls would not work properly on
64 bit kernels.

We could fix this with compat ioctls, but we're just one byte away
and it doesn't make sense at this stage to carry about the compat ioctls
forever at this stage in the project.

This patch brings the ioctl arg up to an evenly aligned 4k.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
2009-01-16 12:05:01 -05:00
Chris Mason 6fc10e9fe3 Update version.sh to v0.17
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2009-01-12 12:56:34 -05:00
Yan Zheng abcfb5463c Fix isize/nbytes update bugs in btrfs-convert
These fix a few converter problems found by the new btrfsck code.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
2009-01-12 12:47:06 -05:00
Chris Mason 6a63d49114 Fix mispatch of the experimental warnings
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2009-01-11 07:58:35 -05:00
Jim Owens 72359e8515 Warn user that this release is experimental
Post wiki pointer message for getting version
status, limitations, and known problems.

Signed-off-by: jim owens <jowens@hp.com>
2009-01-09 15:06:28 -05:00