dev-replace.c (8b558c5f097b636209b654f4d7775ac96054d6e3) dev-replace.c (b02441999efcc6152b87cd58e7970bb7843f76cf)
1/*
2 * Copyright (C) STRATO AG 2012. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public
6 * License v2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,

--- 377 unchanged lines hidden (view full) ---

386 dev_replace->committed_cursor_left = 0;
387 dev_replace->cursor_left_last_write_of_item = 0;
388 dev_replace->cursor_right = 0;
389 dev_replace->is_valid = 1;
390 dev_replace->item_needs_writeback = 1;
391 args->result = BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR;
392 btrfs_dev_replace_unlock(dev_replace);
393
1/*
2 * Copyright (C) STRATO AG 2012. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public
6 * License v2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,

--- 377 unchanged lines hidden (view full) ---

386 dev_replace->committed_cursor_left = 0;
387 dev_replace->cursor_left_last_write_of_item = 0;
388 dev_replace->cursor_right = 0;
389 dev_replace->is_valid = 1;
390 dev_replace->item_needs_writeback = 1;
391 args->result = BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR;
392 btrfs_dev_replace_unlock(dev_replace);
393
394 btrfs_wait_all_ordered_extents(root->fs_info);
394 btrfs_wait_ordered_roots(root->fs_info, -1);
395
396 /* force writing the updated state information to disk */
397 trans = btrfs_start_transaction(root, 0);
398 if (IS_ERR(trans)) {
399 ret = PTR_ERR(trans);
400 btrfs_dev_replace_lock(dev_replace);
401 goto leave;
402 }

--- 58 unchanged lines hidden (view full) ---

461 * flush all outstanding I/O and inode extent mappings before the
462 * copy operation is declared as being finished
463 */
464 ret = btrfs_start_all_delalloc_inodes(root->fs_info, 0);
465 if (ret) {
466 mutex_unlock(&dev_replace->lock_finishing_cancel_unmount);
467 return ret;
468 }
395
396 /* force writing the updated state information to disk */
397 trans = btrfs_start_transaction(root, 0);
398 if (IS_ERR(trans)) {
399 ret = PTR_ERR(trans);
400 btrfs_dev_replace_lock(dev_replace);
401 goto leave;
402 }

--- 58 unchanged lines hidden (view full) ---

461 * flush all outstanding I/O and inode extent mappings before the
462 * copy operation is declared as being finished
463 */
464 ret = btrfs_start_all_delalloc_inodes(root->fs_info, 0);
465 if (ret) {
466 mutex_unlock(&dev_replace->lock_finishing_cancel_unmount);
467 return ret;
468 }
469 btrfs_wait_all_ordered_extents(root->fs_info);
469 btrfs_wait_ordered_roots(root->fs_info, -1);
470
471 trans = btrfs_start_transaction(root, 0);
472 if (IS_ERR(trans)) {
473 mutex_unlock(&dev_replace->lock_finishing_cancel_unmount);
474 return PTR_ERR(trans);
475 }
476 ret = btrfs_commit_transaction(trans, root);
477 WARN_ON(ret);

--- 379 unchanged lines hidden ---
470
471 trans = btrfs_start_transaction(root, 0);
472 if (IS_ERR(trans)) {
473 mutex_unlock(&dev_replace->lock_finishing_cancel_unmount);
474 return PTR_ERR(trans);
475 }
476 ret = btrfs_commit_transaction(trans, root);
477 WARN_ON(ret);

--- 379 unchanged lines hidden ---