Commit Graph

398 Commits (796a0e9cc46a0d173a7bbcbeb792ca80f00bf19e)
 

Author SHA1 Message Date
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
Yan Zheng 4f0347004e Fix an accessing freed memory bug in btrfsck 2009-01-09 14:39:33 -05:00
Chris Mason b8271dc67e Rename debug-tree to btrfs-debug-tree
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2009-01-07 15:12:15 -05:00
Shen Feng 2e1ca67177 Add error processing for btrfsctl -a
brfsctl -a will do nothing and no error is output 
if btrfs.ko is not inserted.

Since no caller do error processing for btrfs_register_one_device,
make its return void and do error processing inside.

Signed-off-by: Shen Feng <shen@cn.fujitsu.com>
2009-01-07 14:57:11 -05:00
Shen Feng 52b14673e6 debug-tree output tree/key type instead of id
This makes the tree name and key type output more readable.

Signed-off-by: Shen Feng <shen@cn.fujitsu.com>
2009-01-07 14:57:12 -05:00
Shen Feng db6772f4d3 Update BUG_ON and WARN_ON
Define BUG_ON and WARN_ON as assert for easy debugging.

Signed-off-by: Shen Feng <shen@cn.fujitsu.com>
2009-01-07 14:57:12 -05:00
Yan Zheng 9a6930e9be Add semantic checks to btrfsck for files and directories
This patch makes btrfsck check more things, including
directory items, file extents, checksumming, inode link
counts etc.

The code for these checks is similar to the code verifies
extent back references. The main difference is that
shared tree blocks are treated specially. The partial
checking results(unresolved references and/or errors)
of shared sub-trees are cached. This avoids scanning
the shared blocks several times. Thank you,

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
2009-01-07 14:57:12 -05:00
Liu Hui 50e571e5b7 Fix compile error in quick-test.c of btrfs progs 2009-01-07 14:57:12 -05:00
Shen Feng 238fdcca20 Fix mkfs.btrfs usage help to match the current args
Signed-off-by: Shen Feng <shen@cn.fujitsu.com>
2009-01-07 14:57:12 -05:00
Shen Feng f7f0e8567f Make the minimum filesystem size error message more clear
Signed-off-by: Shen Feng <shen@cn.fujitsu.com>
2009-01-07 14:57:12 -05:00
Yan Zheng 0d53b212d8 Btrfs: update converter for the new disk format
This patch updates the ext3 to btrfs converter for the new
disk format. This mainly involves changing the convert's
data relocation and free space management code. This patch
also ports some functions from kernel module to btrfs-progs.
Thank you,

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
2008-12-17 16:10:07 -05:00
Chris Mason b238b4b072 Btrfs: Add inode sequence number for NFS and reserved space in a few structs
This adds a sequence number to the btrfs inode that is increased on
every update.  NFS will be able to use that to detect when an inode has
changed, without relying on inaccurate time fields.

While we're here, this also:

Puts reserved space into the super block and inode

Adds a log root transid to the super so we can pick the newest super
based on the fsync log as well as the main transaction ID.  For now
the log root transid is always zero, but that'll get fixed.

Adds a starting offset to the dev_item.  This will let us do better
alignment calculations if we know the start of a partition on the disk.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-12-08 17:01:14 -05:00
Yan Zheng 5ccd1715fa superblock duplication
This patch updates btrfs-progs for superblock duplication.
Note: I didn't make this patch as complete as the one for
kernel since updating the converter requires changing the
code again. Thank you,

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
2008-12-05 12:21:31 -05:00
Chris Mason d79f499eae Btrfs: move data checksumming into a dedicated tree
Btrfs stores checksums for each data block.  Until now, they have
been stored in the subvolume trees, indexed by the inode that is
referencing the data block.  This means that when we read the inode,
we've probably read in at least some checksums as well.

But, this has a few problems:

* The checksums are indexed by logical offset in the file.  When
compression is on, this means we have to do the expensive checksumming
on the uncompressed data.  It would be faster if we could checksum
the compressed data instead.

* If we implement encryption, we'll be checksumming the plain text and
storing that on disk.  This is significantly less secure.

* For either compression or encryption, we have to get the plain text
back before we can verify the checksum as correct.  This makes the raid
layer balancing and extent moving much more expensive.

* It makes the front end caching code more complex, as we have touch
the subvolume and inodes as we cache extents.

* There is potentitally one copy of the checksum in each subvolume
referencing an extent.

The solution used here is to store the extent checksums in a dedicated
tree.  This allows us to index the checksums by phyiscal extent
start and length.  It means:

* The checksum is against the data stored on disk, after any compression
or encryption is done.

* The checksum is stored in a central location, and can be verified without
following back references, or reading inodes.

This makes compression significantly faster by reducing the amount of
data that needs to be checksummed.  It will also allow much faster
raid management code in general.

The checksums are indexed by a key with a fixed objectid (a magic value
in ctree.h) and offset set to the starting byte of the extent.  This
allows us to copy the checksum items into the fsync log tree directly (or
any other tree), without having to invent a second format for them.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-12-08 17:00:31 -05:00
Chris Mason d45ee76e4f Rev the disk format for the compat code and the csum selection
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-12-02 10:20:36 -05:00
Josef Bacik 1148e55804 btrfs-progs: support for different csum algorithims
This is the btrfs-progs version of the patch to add the ability to have
different csum algorithims.  Note I didn't change the image maker since it
seemed a bit more complicated than just changing some stuff around so I will let
Yan take care of that.

Everything else was converted and for now a mkfs just
sets the type to be BTRFS_CSUM_TYPE_CRC32.

Signed-off-by: Josef Bacik <jbacik@redhat.com>
2008-12-02 09:58:23 -05:00
Josef Bacik 76b8244a7a btrfs-progs: add support for compat flags
This patch updates btrfs-progs with the disk format changes for the
compatability flags.

Signed-off-by: Josef Bacik <jbacik@redhat.com>
2008-12-02 07:18:36 -05:00
yanhai zhu f27688bde8 Fix image tool compile warnings 2008-12-02 07:19:08 -05:00
Yan Zheng aa62e84c84 Btrfs image tool
This patch adds btrfs image tool. The image tool is
a debugging tool that creates/restores btrfs metadump
image.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
2008-11-20 09:52:48 -05:00
Chris Mason 49bc666d5f Update the super magic string to match the seed and root format changes 2008-11-18 14:13:44 -05:00
Chris Mason 2d9bc57b9a Add disk format requirements for subvol backward and forward refs 2008-11-18 10:34:08 -05:00
Chris Mason 6c771595af Modify the subvol and snapshot creation ioctls to work anywhere in the tree
This changes the snapshot and subvol ioctl API and command lines so
that new snapshots and subvols can be created anywhere.

Subvolume creation hasn't changed much:

btrfsctl -S subvol_name directory

This creates a new subvolume under 'directory'

Snapshot creation looks the same, but is actually different:

btrfsctl -s full_path_to_new_snapshot file_or_dir

For example: btrfsctl -s /mnt/new_snap /mnt/subvol

Will create a new snapshot named new_snap under /mnt of the root
found in /mnt/subvol.  It always snapshots the entire root regardless of
which file or directory inside the root you give it.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-11-18 11:26:35 -05:00
Yan Zheng 4d1d3a59d6 update btrfs-progs for seed device support
This patch does the following:

1) Update device management code to match the kernel code.

2) Allocator fixes.

3) Add a program called btrfstune to set/clear the SEEDING
   super block flags.
2008-11-18 10:40:06 -05:00
Yan Zheng 95470dfaf1 Add fallocate support v2
This patch updates btrfs-progs for fallocate support.
 
Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
2008-10-31 12:48:02 -04:00
Chris Mason 0a7869d69d Avoid tree of tree root cow when committing a clean FS
The root node generation number code made commit_tree_root look like the
kernel code.  It forces a cow of the tree of tree roots even when
the FS hasn't changed.

This causes errors during fsck and other readonly operations.  This adds
a check to see if commit_tree_root is going to trigger writes to the
tree of tree roots, and bails if none are pending.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-10-30 11:11:39 -04:00
Chris Mason 712c1dea5e Rev the disk format for compression and root pointer generation fields
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-10-29 14:09:40 -04:00
Yan Zheng 38702ea7c6 Add root tree pointer transaction ids
This patch adds transaction IDs to root tree pointers.
Transaction IDs in tree pointers are compared with the
generation numbers in block headers when reading root
blocks of trees. This can detect some types of IO errors.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
2008-10-29 14:07:47 -04:00
Chris Mason c830821ddf Add disk format elements for compression
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-10-29 14:37:41 -04:00
Chris Mason b431f25ec7 Rev the disk format for the new back reference format
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-10-09 13:40:23 -04:00
Yan Zheng 9559e0b09e Count space allocated to file in bytes
This patch updates btrfs-progs for counting space
allocated to file in bytes.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
2008-10-09 11:55:26 -04:00
Yan Zheng 5986faaf47 Remove offset field from struct btrfs_extent_ref
The offset field in struct btrfs_extent_ref records the position
inside file that file extent is referenced by. In the new back
reference system, tree leaves holding reference to file extent
are recorded explicitly. We can quickly scan these tree leaves, so the
offset field is not required.

This patch also makes the back reference system check the objectid
when extents are being deleted

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
2008-10-09 11:55:30 -04:00
Zheng Yan 09ab0365ff update mkfs.btrfs for the new space balancing code
The new space balancing code needs a subvol to store the
temporary inode for data extent relocation.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-26 10:26:53 -04:00
Zheng Yan 428b7fa630 Full back reference support
This patch makes the back reference system to explicit record the
location of parent node for all types of extents. The location of
parent node is placed into the offset field of backref key. Every
time a tree block is balanced, the back references for the affected
lower level extents are updated.
2008-09-23 12:29:10 -04:00
Chris Mason cea88ec1d7 Disk format changes required for write ahead tree log 2008-09-05 16:15:58 -04:00
Chris Mason 2f2f9ef77a Rev the disk format 2008-08-21 15:49:34 -04:00
David Woodhouse a2ec48bb6b Switch btrfs_name_hash() to crc32c
Date: Tue, 19 Aug 2008 19:21:22 +0100
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-08-20 20:11:23 -04:00
David Woodhouse be8c87e176 Use git for version number too
Date: Tue, 19 Aug 2008 18:57:17 +0100
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2008-08-20 20:11:22 -04:00
Eric Sandeen e7e7bb1727 fix btrfs-progs version script
btrfs-progs-0.16.tar.bz2 seems to be distributed w/o an .hg,
which make the version.sh script go bonk.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
2008-08-06 12:17:01 -04:00
Chris Mason 3c6e5b165d Added tag v0.16 for changeset 2b26e4f8c71e 2008-08-04 15:46:36 -04:00