btrfs-progs: three new device/path helpers
authorEric Sandeen <sandeen@redhat.com>
Mon, 11 Mar 2013 23:12:59 +0000 (18:12 -0500)
committerDavid Sterba <dsterba@suse.cz>
Tue, 12 Mar 2013 15:44:40 +0000 (16:44 +0100)
commit10e00b07640438c2412ec360433e38609c727738
treefabc1a5ee78397e975bd3af048d80fd0842570e8
parent5bc34c66028fe8c9eea21a682b760713c2e0dc47
btrfs-progs: three new device/path helpers

Add 3 new helpers:

* is_block_device(), to test if a path is a block device.
* get_btrfs_mount(), to get the mountpoint of a device,
  if mounted.
* open_path_or_dev_mnt(path), to open either the pathname
  or, if it's a mounted btrfs dev, the mountpoint.  Useful
  for some commands which can take either type of arg.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
utils.c
utils.h