summaryrefslogtreecommitdiff
path: root/fs/btrfs/volumes.h
diff options
context:
space:
mode:
authorChris Ball <cjb@laptop.org>2009-04-27 07:29:03 -0400
committerChris Mason <chris.mason@oracle.com>2009-04-27 07:40:51 -0400
commitd6397baee468809ef311e763dfc6e9f73418f8a6 (patch)
treeb8f20c01239674eea287c1665fbf96fb92dfcb00 /fs/btrfs/volumes.h
parent59bc5c758ece00fb0b2a170dd8fbbf31f1856c8a (diff)
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>
Diffstat (limited to 'fs/btrfs/volumes.h')
-rw-r--r--fs/btrfs/volumes.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h
index 5836327ba5d..5c3ff6d02fd 100644
--- a/fs/btrfs/volumes.h
+++ b/fs/btrfs/volumes.h
@@ -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;