third_party/rootdev: support btrfs using ioctl
rootdev assumes only one device exist for an FS (which is true for ext2/squashfs). FS like
btrfs supports multiple devices and uses an anonymous namespace for each device number. Thus sys
call 'stat' no longer works for btrfs. This change adds a function rootdev_wrapper_btrfs in
which we use ioctl to read the ioctl dev info from device directly. Then in main.c and rootdev
library call, we predicate on FS type to decide whether call rootdev_wrapper or
rootdev_wrapper_btrfs.
BUG=chromium:702400, chromium:698296
TEST=manual
Change-Id: I4a388192026ec36dd02c810cf5f31d02f5a87988
Reviewed-on: https://chromium-review.googlesource.com/486263
Commit-Ready: Xiaochu Liu <xiaochu@chromium.org>
Tested-by: Xiaochu Liu <xiaochu@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
3 files changed