Skip to content

Commit

Permalink
API to get condensed tree of modified blocks between two txg (openzfs#6)
Browse files Browse the repository at this point in the history
- API to get condensed tree of modified blocks between two txg
Signed-off-by: mayank <[email protected]>
  • Loading branch information
mynktl authored and Jan Kryl committed Jun 26, 2018
1 parent 10a14ec commit 6076c64
Show file tree
Hide file tree
Showing 13 changed files with 787 additions and 46 deletions.
3 changes: 2 additions & 1 deletion cmd/uzfs_test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ sbin_PROGRAMS = uzfs_test
uzfs_test_SOURCES = \
uzfs_test.c \
uzfs_test_sync.c \
uzfs_zvol_zap.c
uzfs_zvol_zap.c \
uzfs_txg_diff.c

uzfs_test_LDADD = \
$(top_builddir)/lib/libnvpair/libnvpair.la \
Expand Down
24 changes: 12 additions & 12 deletions cmd/uzfs_test/uzfs_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ uzfs_test_info_t uzfs_tests[] = {
{ uzfs_zvol_zap_operation, "uzfs zap operation test" },
{ replay_fn, "zvol replay test" },
{ unit_test_fn, "zvol read/write verification test"},
{ uzfs_txg_diff_verifcation_test,
"test to verify modified blocks between two txg for zvol" },
{ uzfs_txg_diff_tree_test, "txg_diff_tree functionality test" },
};

uint64_t metaverify = 0;
Expand Down Expand Up @@ -416,14 +419,10 @@ static void process_options(int argc, char **argv)
val = nicenumtoull(optarg);
break;
}

switch (opt) {
case 'a':
active_size = val;
if (vol_size == 0)
vol_size = active_size;
else
active_size = (active_size < vol_size)
? (active_size) : (vol_size);
break;
case 'b':
block_size = val;
Expand Down Expand Up @@ -457,11 +456,6 @@ static void process_options(int argc, char **argv)
break;
case 'v':
vol_size = val;
if (active_size == 0)
active_size = vol_size;
else
active_size = (active_size < vol_size)
? (active_size) : (vol_size);
break;
case 'V':
verify = val;
Expand All @@ -482,8 +476,14 @@ static void process_options(int argc, char **argv)
usage(0);
}
}
if (active_size == 0 || vol_size == 0)
active_size = vol_size = 1024*1024*1024ULL;
if (active_size == 0)
active_size = 1024*1024*1024ULL;

if (vol_size == 0)
vol_size = 1024*1024*1024ULL;

if (active_size > vol_size)
vol_size = active_size;

if (silent == 0) {
printf("vol size: %lu active size: %lu create: %d\n", vol_size,
Expand Down
Loading

0 comments on commit 6076c64

Please sign in to comment.