3434#include "kernel-shared/disk-io.h"
3535#include "kernel-shared/volumes.h"
3636#include "common/utils.h"
37+ #include "common/device-utils.h"
3738#include "common/path-utils.h"
3839#include "common/open-utils.h"
3940#include "common/sysfs-utils.h"
@@ -67,18 +68,6 @@ void btrfs_format_csum(u16 csum_type, const u8 *data, char *output)
6768 }
6869}
6970
70- int get_device_info (int fd , u64 devid ,
71- struct btrfs_ioctl_dev_info_args * di_args )
72- {
73- int ret ;
74-
75- di_args -> devid = devid ;
76- memset (& di_args -> uuid , '\0' , sizeof (di_args -> uuid ));
77-
78- ret = ioctl (fd , BTRFS_IOC_DEV_INFO , di_args );
79- return ret < 0 ? - errno : 0 ;
80- }
81-
8271int get_df (int fd , struct btrfs_ioctl_space_args * * sargs_ret )
8372{
8473 u64 count = 0 ;
@@ -281,7 +270,7 @@ int get_fs_info(const char *path, struct btrfs_ioctl_fs_info_args *fi_args,
281270 * search_chunk_tree_for_fs_info() will lacks the devid 0
282271 * so manual probe for it here.
283272 */
284- ret = get_device_info (fd , 0 , & tmp );
273+ ret = device_get_info (fd , 0 , & tmp );
285274 if (!ret ) {
286275 fi_args -> num_devices ++ ;
287276 ndevs ++ ;
@@ -304,7 +293,7 @@ int get_fs_info(const char *path, struct btrfs_ioctl_fs_info_args *fi_args,
304293 memcpy (di_args , & tmp , sizeof (tmp ));
305294 for (; last_devid <= fi_args -> max_id && ndevs < fi_args -> num_devices ;
306295 last_devid ++ ) {
307- ret = get_device_info (fd , last_devid , & di_args [ndevs ]);
296+ ret = device_get_info (fd , last_devid , & di_args [ndevs ]);
308297 if (ret == - ENODEV )
309298 continue ;
310299 if (ret )
0 commit comments