}
for (i = 0; i < device_info_count; i++) {
- printf("%s\t%10s\n", device_info_ptr[i].path,
- df_pretty_sizes(device_info_ptr[i].size, mode));
-
+ printf("%s, ID: %llu\n", device_info_ptr[i].path,
+ device_info_ptr[i].devid);
+ print_device_sizes(fd, &device_info_ptr[i], mode);
print_device_chunks(fd, device_info_ptr[i].devid,
device_info_ptr[i].size,
info_ptr, info_count,
info[ndevs].devid = dev_info.devid;
strcpy(info[ndevs].path, (char *)dev_info.path);
- info[ndevs].size = get_partition_size((char *)dev_info.path);
+ info[ndevs].device_size = get_partition_size((char *)dev_info.path);
+ info[ndevs].size = dev_info.total_bytes;
++ndevs;
}
printf(" Unallocated: %*s%10s\n",
(int)(20 - strlen("Unallocated")), "",
df_pretty_sizes(total_size - allocated, mode));
+}
+void print_device_sizes(int fd, struct device_info *devinfo, int mode)
+{
+ printf(" Device size: %*s%10s\n",
+ (int)(20 - strlen("Device size")), "",
+ df_pretty_sizes(devinfo->device_size, mode));
+ printf(" FS occupied: %*s%10s\n",
+ (int)(20 - strlen("FS occupied")), "",
+ df_pretty_sizes(devinfo->size, mode));
}
struct device_info {
u64 devid;
char path[BTRFS_DEVICE_PATH_NAME_MAX];
- u64 size;
+ /* Size of the block device */
+ u64 device_size;
+ /* Size that's occupied by the filesystem, can be changed via resize */
+ u64 size;
};
/*
void print_device_chunks(int fd, u64 devid, u64 total_size,
struct chunk_info *chunks_info_ptr,
int chunks_info_count, int mode);
+void print_device_sizes(int fd, struct device_info *devinfo, int mode);
#endif