summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--utils.c10
-rw-r--r--utils.h2
2 files changed, 6 insertions, 6 deletions
diff --git a/utils.c b/utils.c
index 21de09d3..d4395b1f 100644
--- a/utils.c
+++ b/utils.c
@@ -540,7 +540,7 @@ int get_btrfs_mount(const char *dev, char *mp, size_t mp_size)
goto out;
}
- ret = check_mounted_where(fd, dev, mp, mp_size, NULL);
+ ret = check_mounted_where(fd, dev, mp, mp_size, NULL, SBREAD_DEFAULT);
if (!ret) {
ret = -EINVAL;
} else { /* mounted, all good */
@@ -901,14 +901,14 @@ int check_mounted(const char* file)
return -errno;
}
- ret = check_mounted_where(fd, file, NULL, 0, NULL);
+ ret = check_mounted_where(fd, file, NULL, 0, NULL, SBREAD_DEFAULT);
close(fd);
return ret;
}
int check_mounted_where(int fd, const char *file, char *where, int size,
- struct btrfs_fs_devices **fs_dev_ret)
+ struct btrfs_fs_devices **fs_dev_ret, unsigned sbflags)
{
int ret;
u64 total_devs = 1;
@@ -919,7 +919,7 @@ int check_mounted_where(int fd, const char *file, char *where, int size,
/* scan the initial device */
ret = btrfs_scan_one_device(fd, file, &fs_devices_mnt,
- &total_devs, BTRFS_SUPER_INFO_OFFSET, SBREAD_DEFAULT);
+ &total_devs, BTRFS_SUPER_INFO_OFFSET, sbflags);
is_btrfs = (ret >= 0);
/* scan other devices */
@@ -1675,7 +1675,7 @@ int get_fs_info(const char *path, struct btrfs_ioctl_fs_info_args *fi_args,
goto out;
}
ret = check_mounted_where(fd, path, mp, sizeof(mp),
- &fs_devices_mnt);
+ &fs_devices_mnt, SBREAD_DEFAULT);
if (!ret) {
ret = -EINVAL;
goto out;
diff --git a/utils.h b/utils.h
index 403de481..b6c00cfa 100644
--- a/utils.h
+++ b/utils.h
@@ -92,7 +92,7 @@ char *canonicalize_dm_name(const char *ptname);
char *canonicalize_path(const char *path);
int check_mounted(const char *devicename);
int check_mounted_where(int fd, const char *file, char *where, int size,
- struct btrfs_fs_devices **fs_devices_mnt);
+ struct btrfs_fs_devices **fs_devices_mnt, unsigned sbflags);
int btrfs_device_already_in_root(struct btrfs_root *root, int fd,
int super_offset);