1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-10-13 11:33:16 +03:00

device: Keep the last data buffer read off each device.

If there's a second metadata area on device, we record that separately.

Note that the memory requirements aren't restricted yet.
This commit is contained in:
Alasdair G Kergon
2018-01-10 02:09:06 +00:00
parent bacc942333
commit bd0967a4b1
3 changed files with 137 additions and 60 deletions

View File

@@ -1247,12 +1247,22 @@ int dev_cache_check_for_open_devices(void)
int dev_cache_exit(void)
{
struct btree_iter *b;
int num_open = 0;
if (_cache.names)
if ((num_open = _check_for_open_devices(1)) > 0)
log_error(INTERNAL_ERROR "%d device(s) were left open and have been closed.", num_open);
if (_cache.devices) {
/* FIXME Replace with structured devbuf cache */
b = btree_first(_cache.devices);
while (b) {
devbufs_release(btree_get_data(b));
b = btree_next(b);
}
}
if (_cache.mem)
dm_pool_destroy(_cache.mem);