summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/super.c
diff options
context:
space:
mode:
authorJosef Bacik2012-06-21 22:03:58 +0200
committerChris Mason2012-07-23 22:27:42 +0200
commit02db0844beffc1c4e99d750be58ffb3ed95d6d62 (patch)
treeee82fa926f2900e24a1ca76eab6a85a32f453898 /fs/btrfs/super.c
parentBtrfs: flush delayed inodes if we're short on space (diff)
downloadkernel-qcow2-linux-02db0844beffc1c4e99d750be58ffb3ed95d6d62.tar.gz
kernel-qcow2-linux-02db0844beffc1c4e99d750be58ffb3ed95d6d62.tar.xz
kernel-qcow2-linux-02db0844beffc1c4e99d750be58ffb3ed95d6d62.zip
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>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r--fs/btrfs/super.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 88a2d2bb2d75..26da344231ac 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -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);