Btrfs: add DEVICE_READY ioctl
This will be used in conjunction with btrfs device ready <dev>. This is needed for initrd's to have a nice and lightweight way to tell if all of the devices needed for a file system are in the cache currently. This keeps them from having to do mount+sleep loops waiting for devices to show up. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com>
This commit is contained in:
@@ -1462,6 +1462,13 @@ static long btrfs_control_ioctl(struct file *file, unsigned int cmd,
|
||||
ret = btrfs_scan_one_device(vol->name, FMODE_READ,
|
||||
&btrfs_fs_type, &fs_devices);
|
||||
break;
|
||||
case BTRFS_IOC_DEVICES_READY:
|
||||
ret = btrfs_scan_one_device(vol->name, FMODE_READ,
|
||||
&btrfs_fs_type, &fs_devices);
|
||||
if (ret)
|
||||
break;
|
||||
ret = !(fs_devices->num_devices == fs_devices->total_devices);
|
||||
break;
|
||||
}
|
||||
|
||||
kfree(vol);
|
||||
|
Reference in New Issue
Block a user