diff options
author | Eric Sandeen <sandeen@redhat.com> | 2013-03-11 18:12:59 -0500 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2013-03-12 16:44:40 +0100 |
commit | 10e00b07640438c2412ec360433e38609c727738 (patch) | |
tree | fabc1a5ee78397e975bd3af048d80fd0842570e8 /utils.h | |
parent | 5bc34c66028fe8c9eea21a682b760713c2e0dc47 (diff) |
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>
Diffstat (limited to 'utils.h')
-rw-r--r-- | utils.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -56,6 +56,9 @@ int get_label(const char *btrfs_dev); int set_label(const char *btrfs_dev, const char *label); char *__strncpy__null(char *dest, const char *src, size_t n); +int is_block_device(const char *file); +int get_btrfs_mount(const char *path, char *mp, size_t mp_size); +int open_path_or_dev_mnt(const char *path); int is_swap_device(const char *file); /* Helper to always get proper size of the destination string */ #define strncpy_null(dest, src) __strncpy__null(dest, src, sizeof(dest)) |