search for: cacheextents_add

Displaying 8 results from an estimated 8 matches for "cacheextents_add".

2019 May 20
2
Re: [nbdkit PATCH v2] Introduce cacheextents filter
...quot;, >> + cache_start, cache_end, cache_extents); >> + >> + if (cache_extents && >> + offset >= cache_start && offset < cache_end) { >> + nbdkit_debug ("cacheextents: returning from cache"); >> + return cacheextents_add (extents, err); >> + } >> + >> + nbdkit_debug ("cacheextents: cache miss"); >> + int r = next_ops->extents (nxdata, count, offset, flags, extents, err); > >This is a bit pessimistic. Observe: > request A (offset=0, count=1G) populates extents (0-.5G...
2019 May 20
0
Re: [nbdkit PATCH v2] Introduce cacheextents filter
On 5/20/19 8:23 AM, Martin Kletzander wrote: >>> +  if (cache_extents && >>> +      offset >= cache_start && offset < cache_end) { >>> +    nbdkit_debug ("cacheextents: returning from cache"); >>> +    return cacheextents_add (extents, err); >>> +  } >>> + >>> +  nbdkit_debug ("cacheextents: cache miss"); >>> +  int r = next_ops->extents (nxdata, count, offset, flags, extents, >>> err); >> >> This is a bit pessimistic.  Observe: >> request A (of...
2019 May 15
2
[nbdkit PATCH] Introduce cacheextents filter
...hed extents from the last extents () call and its start and end for the + sake of simplicity. */ +struct nbdkit_extents *cache_extents; +static uint64_t cache_start; +static uint64_t cache_end; + +static void +cacheextents_unload (void) +{ + nbdkit_extents_free (cache_extents); +} + +static int +cacheextents_add (struct nbdkit_extents *extents) +{ + size_t i = 0; + + for (i = 0; i < nbdkit_extents_count (cache_extents); i++) { + struct nbdkit_extent ex = nbdkit_get_extent (cache_extents, i); + if (nbdkit_add_extent (extents, ex.offset, ex.length, ex.type) < 0) + return -1; + } + + retu...
2019 Jun 11
0
Re: [nbdkit PATCH v2] Introduce cacheextents filter
...omment lines, and */ on its own line. > +struct nbdkit_extents *cache_extents; > +static uint64_t cache_start; > +static uint64_t cache_end; > + > +static void > +cacheextents_unload (void) > +{ > + nbdkit_extents_free (cache_extents); > +} > + > +static int > +cacheextents_add (struct nbdkit_extents *extents, int *err) > +{ > + size_t i = 0; > + > + for (i = 0; i < nbdkit_extents_count (cache_extents); i++) { > + struct nbdkit_extent ex = nbdkit_get_extent (cache_extents, i); > + if (nbdkit_add_extent (extents, ex.offset, ex.length, ex.type)...
2019 Jun 11
5
[nbdkit PATCH v2] Introduce cacheextents filter
...hed extents from the last extents () call and its start and end for the + sake of simplicity. */ +struct nbdkit_extents *cache_extents; +static uint64_t cache_start; +static uint64_t cache_end; + +static void +cacheextents_unload (void) +{ + nbdkit_extents_free (cache_extents); +} + +static int +cacheextents_add (struct nbdkit_extents *extents, int *err) +{ + size_t i = 0; + + for (i = 0; i < nbdkit_extents_count (cache_extents); i++) { + struct nbdkit_extent ex = nbdkit_get_extent (cache_extents, i); + if (nbdkit_add_extent (extents, ex.offset, ex.length, ex.type) == -1) { + *err = errno;...
2019 May 15
6
[nbdkit PATCH v2] Introduce cacheextents filter
...hed extents from the last extents () call and its start and end for the + sake of simplicity. */ +struct nbdkit_extents *cache_extents; +static uint64_t cache_start; +static uint64_t cache_end; + +static void +cacheextents_unload (void) +{ + nbdkit_extents_free (cache_extents); +} + +static int +cacheextents_add (struct nbdkit_extents *extents, int *err) +{ + size_t i = 0; + + for (i = 0; i < nbdkit_extents_count (cache_extents); i++) { + struct nbdkit_extent ex = nbdkit_get_extent (cache_extents, i); + if (nbdkit_add_extent (extents, ex.offset, ex.length, ex.type) == -1) { + *err = errno;...
2019 May 16
0
Re: [nbdkit PATCH v2] Introduce cacheextents filter
..." cache_extents=%p", > + cache_start, cache_end, cache_extents); > + > + if (cache_extents && > + offset >= cache_start && offset < cache_end) { > + nbdkit_debug ("cacheextents: returning from cache"); > + return cacheextents_add (extents, err); > + } > + > + nbdkit_debug ("cacheextents: cache miss"); > + int r = next_ops->extents (nxdata, count, offset, flags, extents, err); This is a bit pessimistic. Observe: request A (offset=0, count=1G) populates extents (0-.5G data, .5G-1.5G hole) reque...
2019 May 15
0
Re: [nbdkit PATCH] Introduce cacheextents filter
...om> > --- > Yes, I hate the filter name, so if anyone has a better idea, feel free to > suggest (or rename) it. Basically it's fine, however it could really do with having a test. I have no particular comment about the name. A few more things inline below. > +static int > +cacheextents_add (struct nbdkit_extents *extents) > +{ > + size_t i = 0; > + > + for (i = 0; i < nbdkit_extents_count (cache_extents); i++) { > + struct nbdkit_extent ex = nbdkit_get_extent (cache_extents, i); > + if (nbdkit_add_extent (extents, ex.offset, ex.length, ex.type) < 0) T...