summaryrefslogtreecommitdiff
path: root/c_src/cmd_migrate.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2025-03-19 12:51:44 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2025-03-19 15:47:44 -0400
commit846f3398a27cff78c48e37c7a1ba1bccccff6287 (patch)
treeca038b1762701b2839689f903cae918074a7fc24 /c_src/cmd_migrate.c
parente6aecdd3b8a00d9718fc1ef30ab6a5dbdb5a53dc (diff)
More device option work
More work to regularize device options, with common command line parsing - like other options. This fixes an assortment of little nits: buggyness with the discard option, device state (and others) can now be specied at device add time, and is a decent cleanup. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'c_src/cmd_migrate.c')
-rw-r--r--c_src/cmd_migrate.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/c_src/cmd_migrate.c b/c_src/cmd_migrate.c
index bce115b7..698cfd55 100644
--- a/c_src/cmd_migrate.c
+++ b/c_src/cmd_migrate.c
@@ -159,9 +159,9 @@ static void find_superblock_space(ranges extents,
{
darray_for_each(extents, i) {
u64 start = round_up(max(256ULL << 10, i->start),
- dev->bucket_size << 9);
+ dev->opts.bucket_size << 9);
u64 end = round_down(i->end,
- dev->bucket_size << 9);
+ dev->opts.bucket_size << 9);
/* Need space for two superblocks: */
if (start + (opts.superblock_size << 9) * 2 <= end) {
@@ -225,9 +225,9 @@ static int migrate_fs(const char *fs_path,
printf("Creating new filesystem on %s in space reserved at %s\n",
dev.path, file_path);
- dev.size = get_size(dev.bdev->bd_fd);
- dev.bucket_size = bch2_pick_bucket_size(fs_opts, &dev);
- dev.nbuckets = dev.size / dev.bucket_size;
+ dev.opts.fs_size = get_size(dev.bdev->bd_fd);
+ dev.opts.bucket_size = bch2_pick_bucket_size(fs_opts, &dev);
+ dev.nbuckets = dev.opts.fs_size / dev.opts.bucket_size;
bch2_check_bucket_size(fs_opts, &dev);