diff options
author | Anand Jain <anand.jain@oracle.com> | 2016-03-21 15:21:02 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-03-30 16:25:18 +0200 |
commit | 0f9a5cf70cf6f6c3f02ef3dd999e13f334bc29bb (patch) | |
tree | e07329507986edd679ab10658432eb20323f4b3f /utils.c | |
parent | a5dbd2064ef8a9b78eb0c2819b4d432623e1917d (diff) |
btrfs-progs: remove duplicate function __is_subvol()
The function test_issubvolume() provides the same check, and
has better logic.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'utils.c')
-rw-r--r-- | utils.c | 21 |
1 files changed, 1 insertions, 20 deletions
@@ -1867,25 +1867,6 @@ int set_label(const char *btrfs_dev, const char *label) } /* - * Unsafe subvolume check. - * - * This only checks ino == BTRFS_FIRST_FREE_OBJECTID, even it is not in a - * btrfs mount point. - * Must use together with other reliable method like btrfs ioctl. - */ -static int __is_subvol(const char *path) -{ - struct stat st; - int ret; - - ret = lstat(path, &st); - if (ret < 0) - return ret; - - return st.st_ino == BTRFS_FIRST_FREE_OBJECTID; -} - -/* * A not-so-good version fls64. No fascinating optimization since * no one except parse_size use it */ @@ -2005,7 +1986,7 @@ u64 parse_qgroupid(const char *p) path: /* Path format like subv at 'my_subvol' is the fallback case */ - ret = __is_subvol(p); + ret = test_issubvolume(p); if (ret < 0 || !ret) goto err; fd = open(p, O_RDONLY); |