diff options
author | David Teigland <teigland@redhat.com> | 2020-03-31 14:14:50 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2020-06-10 12:15:50 -0500 |
commit | a7b2fc8f5791747ff3326997a07743eeebbd3ef7 (patch) | |
tree | 1f394eb62d7a6c750678eee907f0313da6795e20 /device_mapper | |
parent | d15c466f9557004fa003b8986b82deca25cc5aaf (diff) | |
download | lvm2-a7b2fc8f5791747ff3326997a07743eeebbd3ef7.tar.gz |
writecache: add settings cleaner and max_age
available in dm-writecache 1.2
Diffstat (limited to 'device_mapper')
-rw-r--r-- | device_mapper/all.h | 4 | ||||
-rw-r--r-- | device_mapper/libdm-deptree.c | 12 |
2 files changed, 16 insertions, 0 deletions
diff --git a/device_mapper/all.h b/device_mapper/all.h index f00b6a5dc..c3c6219e3 100644 --- a/device_mapper/all.h +++ b/device_mapper/all.h @@ -951,6 +951,8 @@ struct writecache_settings { uint64_t autocommit_time; /* in milliseconds */ uint32_t fua; uint32_t nofua; + uint32_t cleaner; + uint32_t max_age; /* * Allow an unrecognized key and its val to be passed to the kernel for @@ -970,6 +972,8 @@ struct writecache_settings { unsigned autocommit_time_set:1; unsigned fua_set:1; unsigned nofua_set:1; + unsigned cleaner_set:1; + unsigned max_age_set:1; }; int dm_tree_node_add_writecache_target(struct dm_tree_node *node, diff --git a/device_mapper/libdm-deptree.c b/device_mapper/libdm-deptree.c index 9ba24cbbf..2722a2c3b 100644 --- a/device_mapper/libdm-deptree.c +++ b/device_mapper/libdm-deptree.c @@ -2670,6 +2670,10 @@ static int _writecache_emit_segment_line(struct dm_task *dmt, count += 1; if (seg->writecache_settings.nofua_set) count += 1; + if (seg->writecache_settings.cleaner_set && seg->writecache_settings.cleaner) + count += 1; + if (seg->writecache_settings.max_age_set) + count += 2; if (seg->writecache_settings.new_key) count += 2; @@ -2713,6 +2717,14 @@ static int _writecache_emit_segment_line(struct dm_task *dmt, EMIT_PARAMS(pos, " nofua"); } + if (seg->writecache_settings.cleaner_set && seg->writecache_settings.cleaner) { + EMIT_PARAMS(pos, " cleaner"); + } + + if (seg->writecache_settings.max_age_set) { + EMIT_PARAMS(pos, " max_age %u", seg->writecache_settings.max_age); + } + if (seg->writecache_settings.new_key) { EMIT_PARAMS(pos, " %s %s", seg->writecache_settings.new_key, |