mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-12-10 00:00:24 +03:00
fix rereplicate command
This commit is contained in:
parent
b5094ee854
commit
cecf7e05e1
@ -792,27 +792,30 @@ int bchu_data(struct bchfs_handle fs, struct bch_ioctl_data cmd)
|
|||||||
int progress_fd = xioctl(fs.ioctl_fd, BCH_IOCTL_DATA, &cmd);
|
int progress_fd = xioctl(fs.ioctl_fd, BCH_IOCTL_DATA, &cmd);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
struct bch_ioctl_data_progress p;
|
struct bch_ioctl_data_event e;
|
||||||
|
|
||||||
if (read(progress_fd, &p, sizeof(p)) != sizeof(p))
|
if (read(progress_fd, &e, sizeof(e)) != sizeof(e))
|
||||||
die("error reading from progress fd");
|
die("error reading from progress fd %m");
|
||||||
|
|
||||||
if (p.data_type == U8_MAX)
|
if (e.type)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (e.p.data_type == U8_MAX)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
printf("\33[2K\r");
|
printf("\33[2K\r");
|
||||||
|
|
||||||
printf("%llu%% complete: current position %s",
|
printf("%llu%% complete: current position %s",
|
||||||
p.sectors_done * 100 / p.sectors_total,
|
e.p.sectors_done * 100 / e.p.sectors_total,
|
||||||
bch2_data_types[p.data_type]);
|
bch2_data_types[e.p.data_type]);
|
||||||
|
|
||||||
switch (p.data_type) {
|
switch (e.p.data_type) {
|
||||||
case BCH_DATA_BTREE:
|
case BCH_DATA_BTREE:
|
||||||
case BCH_DATA_USER:
|
case BCH_DATA_USER:
|
||||||
printf(" %s:%llu:%llu",
|
printf(" %s:%llu:%llu",
|
||||||
bch2_btree_ids[p.btree_id],
|
bch2_btree_ids[e.p.btree_id],
|
||||||
p.pos.inode,
|
e.p.pos.inode,
|
||||||
p.pos.offset);
|
e.p.pos.offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
sleep(1);
|
sleep(1);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user