Lines Matching defs:device

29  * To copy all extents (both new and on-disk) from source device to target
30 * device, while still keeping the filesystem read-write.
38 * if replace gets canceled, sources device still contans up-to-date data.
101 "found replace target device without a valid replace item");
164 "replace without active item, run 'device scan --forget' on the target device");
179 * allow 'btrfs dev replace_cancel' if src/tgt device is
186 "cannot mount because device replace operation is ongoing and");
195 "cannot mount because device replace operation is ongoing and");
233 * Initialize a new device for device replace target from a given source dev
236 * Return 0 and new device in @device_out, otherwise return < 0
243 struct btrfs_device *device;
258 btrfs_err(fs_info, "target device %s is invalid!", device_path);
264 list_for_each_entry(device, &fs_info->fs_devices->devices, dev_list) {
265 if (device->bdev == bdev) {
267 "target device is in the filesystem!");
277 "target device is smaller than source device!");
283 device = btrfs_alloc_device(NULL, &devid, NULL);
284 if (IS_ERR(device)) {
285 ret = PTR_ERR(device);
291 btrfs_free_device(device);
295 rcu_assign_pointer(device->name, name);
297 set_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state);
298 device->generation = 0;
299 device->io_width = fs_info->sectorsize;
300 device->io_align = fs_info->sectorsize;
301 device->sector_size = fs_info->sectorsize;
302 device->total_bytes = btrfs_device_get_total_bytes(srcdev);
303 device->disk_total_bytes = btrfs_device_get_disk_total_bytes(srcdev);
304 device->bytes_used = btrfs_device_get_bytes_used(srcdev);
305 device->commit_total_bytes = srcdev->commit_total_bytes;
306 device->commit_bytes_used = device->bytes_used;
307 device->fs_info = fs_info;
308 device->bdev = bdev;
309 set_bit(BTRFS_DEV_STATE_IN_FS_METADATA, &device->dev_state);
310 set_bit(BTRFS_DEV_STATE_REPLACE_TGT, &device->dev_state);
311 device->mode = FMODE_EXCL;
312 device->dev_stats_valid = 1;
313 set_blocksize(device->bdev, BTRFS_BDEV_BLOCKSIZE);
314 device->fs_devices = fs_info->fs_devices;
317 list_add(&device->dev_list, &fs_info->fs_devices->devices);
322 *device_out = device;
331 * called from commit_transaction. Writes changed device replace state to
442 static char* btrfs_dev_name(struct btrfs_device *device)
444 if (!device || test_bit(BTRFS_DEV_STATE_MISSING, &device->dev_state))
447 return rcu_str_deref(device->name);
468 "cannot replace device %s (devid %llu) due to active swapfile",
610 * we have removed target device, it is safe to allow new bios request.
619 * When finishing the device replace, before swapping the source device with the
620 * target device we must update the chunk allocation state in the target device,
719 * chunks shouldn't be allocated on the device.
733 /* Prevent new chunks being allocated on the source device */
754 * Update allocation state in the new device and replace the old device
822 * is running, the target device is part of the filesystem, the
823 * source device is not part of the filesystem anymore and its 1st
850 * Read progress of device replace status according to the state and last