search for: l2_page

Displaying 4 results from an estimated 4 matches for "l2_page".

2019 Aug 15
2
[nbdkit PATCH] data, memory: Optimize .zero > PAGE_SIZE
...common/sparse/sparse.c +++ b/common/sparse/sparse.c @@ -343,10 +343,13 @@ sparse_array_zero (struct sparse_array *sa, uint32_t count, uint64_t offset) n = count; if (p) { - memset (p, 0, n); + if (n < PAGE_SIZE) + memset (p, 0, n); + else + assert (p == *l2_page); /* If the whole page is now zero, free it. */ - if (is_zero (*l2_page, PAGE_SIZE)) { + if (n == PAGE_SIZE || is_zero (*l2_page, PAGE_SIZE)) { if (sa->debug) nbdkit_debug ("%s: freeing zero page at offset %" PRIu64, __func...
2019 Aug 15
0
Re: [nbdkit PATCH] data, memory: Optimize .zero > PAGE_SIZE
...arse.c > @@ -343,10 +343,13 @@ sparse_array_zero (struct sparse_array *sa, uint32_t count, uint64_t offset) > n = count; > > if (p) { > - memset (p, 0, n); > + if (n < PAGE_SIZE) > + memset (p, 0, n); > + else > + assert (p == *l2_page); > > /* If the whole page is now zero, free it. */ > - if (is_zero (*l2_page, PAGE_SIZE)) { > + if (n == PAGE_SIZE || is_zero (*l2_page, PAGE_SIZE)) { Should this be n >= PAGE_SIZE? My guess is no because lookup (..&n..) can't return n larger than the rem...
2020 Feb 10
2
[nbdkit PATCH 04/10] plugins: Wire up in-memory plugin support for NBD_INFO_INIT_STATE
...t, bool create, return NULL; } l2_dir[o] = page; + sa->used_pages++; } if (!page) return NULL; @@ -355,6 +363,7 @@ sparse_array_zero (struct sparse_array *sa, uint32_t count, uint64_t offset) __func__, offset); free (*l2_page); *l2_page = NULL; + sa->used_pages--; } } @@ -398,3 +407,22 @@ sparse_array_extents (struct sparse_array *sa, return 0; } + +void +sparse_array_set_size (struct sparse_array *sa, uint64_t size) +{ + assert (size <= INT64_MAX); + sa->max_pages = DIV_ROUN...
2020 Feb 10
17
Cross-project NBD extension proposal: NBD_INFO_INIT_STATE
I will be following up to this email with four separate threads each addressed to the appropriate single list, with proposed changes to: - the NBD protocol - qemu: both server and client - libnbd: client - nbdkit: server The feature in question adds a new optional NBD_INFO_ packet to the NBD_OPT_GO portion of handshake, adding up to 16 bits of information that the server can advertise to the