Skip to content

Commit

Permalink
btrfs-progs: test_skip_this_disk() isn't needed anymore
Browse files Browse the repository at this point in the history
add_seen_fsid() which was introduced lately will eliminate
the mounted disks, so we don't need test_skip_this_disk()
anymore

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
  • Loading branch information
asj authored and masoncl committed Jan 31, 2014
1 parent d894378 commit 62d0245
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1967,21 +1967,6 @@ int test_dev_for_mkfs(char *file, int force_overwrite, char *estr)
return 0;
}

static int test_skip_this_disk(char *path)
{
int fd;

/*
* this will eliminate disks which are mounted (btrfs)
* and non-dm disk path when dm is enabled
*/
fd = open(path, O_RDWR|O_EXCL);
if (fd < 0)
return 1;
close(fd);
return 0;
}

int btrfs_scan_lblkid(int update_kernel)
{
int fd = -1;
Expand All @@ -2006,8 +1991,6 @@ int btrfs_scan_lblkid(int update_kernel)
continue;
/* if we are here its definitely a btrfs disk*/
strncpy(path, blkid_dev_devname(dev), PATH_MAX);
if (test_skip_this_disk(path))
continue;

fd = open(path, O_RDONLY);
if (fd < 0) {
Expand Down

0 comments on commit 62d0245

Please sign in to comment.