mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-12-09 00:00:17 +03:00
posix_to_bcachefs: plumb verbosity
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
97b8348d28
commit
ac9ca56637
@ -477,7 +477,7 @@ static void image_create(struct bch_opt_strs fs_opt_strs,
|
||||
if (ret)
|
||||
goto err;
|
||||
|
||||
struct copy_fs_state s = {};
|
||||
struct copy_fs_state s = { .verbosity = verbosity };
|
||||
ret = copy_fs(c, &s, src_fd, src_path) ?:
|
||||
finish_image(c, keep_alloc, verbosity);
|
||||
if (ret)
|
||||
@ -705,7 +705,7 @@ static int image_update(const char *src_path, const char *dst_image,
|
||||
goto err_stop;
|
||||
|
||||
bch_verbose(c, "Syncing data");
|
||||
struct copy_fs_state s = {};
|
||||
struct copy_fs_state s = { .verbosity = verbosity };
|
||||
|
||||
ret = copy_fs(c, &s, src_fd, src_path) ?:
|
||||
finish_image(c, keep_alloc, verbosity);
|
||||
|
||||
@ -671,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)
|
||||
@ -694,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)
|
||||
@ -726,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;
|
||||
|
||||
|
||||
@ -36,6 +36,7 @@ struct copy_fs_state {
|
||||
GENRADIX(u64) hardlinks;
|
||||
ranges extents;
|
||||
enum bch_migrate_type type;
|
||||
unsigned verbosity;
|
||||
|
||||
u64 reserve_start;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user