2 Mar 2009 03:29
Re: [review] Btrfs: Allow shrinking close to used space
Chris Ball <cjb <at> laptop.org>
2009-03-02 02:29:37 GMT
2009-03-02 02:29:37 GMT
Hi, Here's a new patch that incorporates these comments. We now update device->fs_devices->total_rw_bytes before the shrink, as Josef suggests, and create a new field in btrfs_device to store an on-disk size that is only updated on a successful shrink operation, as requested by Yan. (Thanks, Yan and Josef, for the patient explanations.) == From: Chris Ball <cjb <at> laptop.org> 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 <at> laptop.org> --- fs/btrfs/volumes.c | 35 ++++++++++++++++++++++++----------- fs/btrfs/volumes.h | 3 +++ 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 1316139..303b7d6 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c <at> <at> -1433,7 +1433,7 <at> <at> static noinline int btrfs_update_device(struct btrfs_trans_handle *trans,(Continue reading)
RSS Feed