Commit Graph

4885 Commits (master)
 

Author SHA1 Message Date
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
Chris Mason 324f6ca04f Update version.sh to v0.16 2008-08-04 15:46:31 -04:00
Radoslaw Szkodzinski 33d7977a95 btrfs-convert: Iterate correctly using libext2fs functions
This patch corrects open-coded inode_map iteration, which happens to be
illegal in new libext2fs due to inode_map being private, causing warning,
which becomes a compile error.
2008-07-30 17:02:57 -04:00
email.ahmedkamal@googlemail.com e9fa78e2ec Cleanup btrfsctl help message
Many options were not mentioned in the usage message, fix that and
cleaning up the brackets

Signed-Off-By: Ahmed Kamal <email.ahmedkamal@googlemail.com>
2008-07-30 13:29:28 -04:00
Ahmed 26641e8d32 Fix: btrfsctl arguments handling
btrfsctl -A
in the current -unstable branch, does not result in the error message
designated for it, namely "-A requires an arg\n"
2008-07-30 09:17:21 -04:00
Yan 48c2290d4c btrfs-convert new dir index support
This patch updates btrfs-convert for the new dir index format.
2008-07-30 09:16:42 -04:00
Josef Bacik 0045e0dd70 btrfs-progs: add orphan support to print-tree
This adds orphan support to print-tree so when debug_tree hits an orphan item it
will print out "orphan item" under it so you know what it is
2008-07-30 09:15:02 -04:00
Chris Mason e74b89d675 Rev the disk format 2008-07-24 13:52:04 -04:00
Josef Bacik 059c20b384 btrfs-progs new dir index support 2008-07-24 12:13:32 -04:00
Chris Mason 9864c90760 Print the version string in a few programs 2008-07-24 12:13:30 -04:00
Chris Mason cbfe93f68f Add version strings 2008-07-23 12:12:13 -04:00
Chris Mason a9629e709a Add .hgignore file to ignore verison.h 2008-07-23 11:36:13 -04:00
Chris Mason 969c548acb Add sync and transaction ioctl defs
btrfsctl -c forces a single FS sync

The transaction ioctls are unsafe for general use because they can lead
to deadlocks if the application is not very careful.  But, ceph is
experimenting with btrfs as a backing store, and these ioctls are required
for testing.
2008-06-10 10:09:18 -04:00
Linda Knippers d8d4df9474 btrfsctl: print usage when called with bad args 2008-06-09 22:23:13 -04:00