Btrfs: Add balance ioctl to restripe the chunks

Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
Chris Mason
2008-04-28 15:29:52 -04:00
parent 788f20eb5a
commit ec44a35cbe
5 changed files with 208 additions and 27 deletions

View File

@@ -2864,6 +2864,15 @@ int btrfs_defrag_file(struct file *file) {
goto out_unlock;
}
}
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18)
ClearPageDirty(page);
#else
cancel_dirty_page(page, PAGE_CACHE_SIZE);
#endif
wait_on_page_writeback(page);
set_page_extent_mapped(page);
page_start = (u64)page->index << PAGE_CACHE_SHIFT;
page_end = page_start + PAGE_CACHE_SIZE - 1;
@@ -3105,6 +3114,8 @@ long btrfs_ioctl(struct file *file, unsigned int
return btrfs_ioctl_resize(root, (void __user *)arg);
case BTRFS_IOC_ADD_DEV:
return btrfs_ioctl_add_dev(root, (void __user *)arg);
case BTRFS_IOC_BALANCE:
return btrfs_balance(root->fs_info->dev_root);
}
return -ENOTTY;