summaryrefslogtreecommitdiff
path: root/cmds-subvolume.c
diff options
context:
space:
mode:
authorAnand Jain <anand.jain@oracle.com>2016-03-21 15:21:01 +0800
committerDavid Sterba <dsterba@suse.com>2016-03-30 16:25:13 +0200
commita5dbd2064ef8a9b78eb0c2819b4d432623e1917d (patch)
treebac5860cfe09af9c77eb0e6533e8456ec24055af /cmds-subvolume.c
parent906dfb9e387812484718c981b7ec2ffbb9e892be (diff)
btrfs-progs: move test_issubvolume() to utils.c
Signed-off-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-subvolume.c')
-rw-r--r--cmds-subvolume.c27
1 files changed, 0 insertions, 27 deletions
diff --git a/cmds-subvolume.c b/cmds-subvolume.c
index 3953d7c0..f62ab958 100644
--- a/cmds-subvolume.c
+++ b/cmds-subvolume.c
@@ -224,33 +224,6 @@ out:
return retval;
}
-/*
- * Test if path is a subvolume
- * Returns:
- * 0 - path exists but it is not a subvolume
- * 1 - path exists and it is a subvolume
- * < 0 - error
- */
-int test_issubvolume(const char *path)
-{
- struct stat st;
- struct statfs stfs;
- int res;
-
- res = stat(path, &st);
- if (res < 0)
- return -errno;
-
- if (st.st_ino != BTRFS_FIRST_FREE_OBJECTID || !S_ISDIR(st.st_mode))
- return 0;
-
- res = statfs(path, &stfs);
- if (res < 0)
- return -errno;
-
- return (int)stfs.f_type == BTRFS_SUPER_MAGIC;
-}
-
static int wait_for_commit(int fd)
{
int ret;