diff options
Diffstat (limited to 'c_src/posix_to_bcachefs.c')
-rw-r--r-- | c_src/posix_to_bcachefs.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/c_src/posix_to_bcachefs.c b/c_src/posix_to_bcachefs.c index 8cb1c7c8..0e7d4c29 100644 --- a/c_src/posix_to_bcachefs.c +++ b/c_src/posix_to_bcachefs.c @@ -282,7 +282,7 @@ static void write_data(struct bch_fs *c, closure_call(&op.cl, bch2_write, NULL, NULL); BUG_ON(!(op.flags & BCH_WRITE_submitted)); - dst_inode->bi_sectors += len >> 9; + dst_inode->bi_sectors += op.i_sectors_delta; if (op.error) die("write error: %s", bch2_err_str(op.error)); @@ -371,6 +371,8 @@ static void copy_link(struct bch_fs *c, if (ret) die("bch2_fpunch error: %s", bch2_err_str(ret)); + dst->bi_sectors += i_sectors_delta; + ret = readlink(src, src_buf, sizeof(src_buf)); if (ret < 0) die("readlink error: %m"); @@ -669,6 +671,7 @@ static int recursive_remove(struct bch_fs *c, } static int delete_non_matching_dirents(struct bch_fs *c, + struct copy_fs_state *s, subvol_inum dst_dir_inum, struct bch_inode_unpacked *dst_dir, dirents src_dirents) @@ -692,7 +695,8 @@ static int delete_non_matching_dirents(struct bch_fs *c, !strcmp(dst_d->d_name, "lost+found")) continue; - printf("deleting %s type %u\n", dst_d->d_name, dst_d->d_type); + if (s->verbosity > 1) + printf("deleting %s\n", dst_d->d_name); ret = recursive_remove(c, dst_dir_inum, dst_dir, dst_d); if (ret) @@ -724,7 +728,7 @@ static int copy_dir(struct bch_fs *c, sort(dirents.data, dirents.nr, sizeof(dirents.data[0]), dirent_cmp, NULL); subvol_inum dir_inum = { 1, dst->bi_inum }; - int ret = delete_non_matching_dirents(c, dir_inum, dst, dirents); + int ret = delete_non_matching_dirents(c, s, dir_inum, dst, dirents); if (ret) goto err; |