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

BUG=chromium:702400, chromium:698296

Change-Id: I4a388192026ec36dd02c810cf5f31d02f5a87988
Commit-Ready: Xiaochu Liu <>
Tested-by: Xiaochu Liu <>
Reviewed-by: Mike Frysinger <>
3 files changed