Btrfs: When shrinking, only update disk size on success

Previously, we updated a device's size prior to attempting a shrink
operation.  This patch moves the device resizing logic to only happen if
the shrink completes successfully.  In the process, it introduces a new
field to btrfs_device -- disk_total_bytes -- to track the on-disk size.

Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
Chris Ball
2009-04-27 07:29:03 -04:00
committed by Chris Mason
parent 59bc5c758e
commit d6397baee4
2 changed files with 27 additions and 11 deletions

View File

@@ -61,6 +61,9 @@ struct btrfs_device {
/* size of the device */
u64 total_bytes;
/* size of the disk */
u64 disk_total_bytes;
/* bytes used */
u64 bytes_used;