search for: cacheextents_fill

Displaying 10 results from an estimated 10 matches for "cacheextents_fill".

2019 May 15
2
[nbdkit PATCH] Introduce cacheextents filter
...*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; + } + + return 0; +} + +static int +cacheextents_fill (struct nbdkit_extents *extents) +{ + size_t i = 0; + size_t count = nbdkit_extents_count (extents); + struct nbdkit_extent first = nbdkit_get_extent (extents, 0); + struct nbdkit_extent last = nbdkit_get_extent (extents, count - 1); + + nbdkit_extents_free (cache_extents); + cache_start = fi...
2019 May 15
6
[nbdkit PATCH v2] Introduce cacheextents filter
...+ + 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; + return -1; + } + } + + return 0; +} + +static int +cacheextents_fill (struct nbdkit_extents *extents, int *err) +{ + size_t i = 0; + size_t count = nbdkit_extents_count (extents); + struct nbdkit_extent first = nbdkit_get_extent (extents, 0); + struct nbdkit_extent last = nbdkit_get_extent (extents, count - 1); + + nbdkit_extents_free (cache_extents); + cache_...
2019 Jun 11
5
[nbdkit PATCH v2] Introduce cacheextents filter
...+ + 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; + return -1; + } + } + + return 0; +} + +static int +cacheextents_fill (struct nbdkit_extents *extents, int *err) +{ + size_t i = 0; + size_t count = nbdkit_extents_count (extents); + struct nbdkit_extent first = nbdkit_get_extent (extents, 0); + struct nbdkit_extent last = nbdkit_get_extent (extents, count - 1); + + nbdkit_extents_free (cache_extents); + cache_...
2019 May 20
2
Re: [nbdkit PATCH v2] Introduce cacheextents filter
...of an added value, since most of the time the requests would be sequential and if there is a quick response (or the client is not using req_one), this would not speed things up. So this is quite a niche filter for now. >> + if (r == -1) >> + return r; >> + >> + return cacheextents_fill (extents, err); >> +} >> + > >> +++ b/filters/cacheextents/nbdkit-cacheextents-filter.pod >> @@ -0,0 +1,47 @@ >> +=head1 NAME >> + >> +nbdkit-cacheextents-filter - cache extents > >> +=head1 SEE ALSO >> + >> +L<nbdkit(1)>, >...
2019 Jun 11
0
Re: [nbdkit PATCH v2] Introduce cacheextents filter
...); 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; > + return -1; > + } > + } > + > + return 0; > +} > + > +static int > +cacheextents_fill (struct nbdkit_extents *extents, int *err) > +{ > + size_t i = 0; > + size_t count = nbdkit_extents_count (extents); > + struct nbdkit_extent first = nbdkit_get_extent (extents, 0); > + struct nbdkit_extent last = nbdkit_get_extent (extents, count - 1); > + > + nbdkit_exte...
2019 May 16
0
Re: [nbdkit PATCH v2] Introduce cacheextents filter
...erefore do a three-step action: fill 'extents' with the tail of the cached extents (filling .5-1.0G), call next_ops->extents for the remainder (1.0G-wherever), extend the cache to fill out the additional information learned. > + if (r == -1) > + return r; > + > + return cacheextents_fill (extents, err); > +} > + > +++ b/filters/cacheextents/nbdkit-cacheextents-filter.pod > @@ -0,0 +1,47 @@ > +=head1 NAME > + > +nbdkit-cacheextents-filter - cache extents > +=head1 SEE ALSO > + > +L<nbdkit(1)>, > +L<nbdkit-cache-filter(1)>, > +L<nb...
2019 May 16
0
Re: [nbdkit PATCH v2] Introduce cacheextents filter
..._ops, void *nxdata, } nbdkit_debug ("cacheextents: cache miss"); - int r = next_ops->extents (nxdata, count, offset, flags, extents, err); - if (r == -1) - return r; + if (next_ops->extents (nxdata, count, offset, flags, extents, err) == -1) + return -1; return cacheextents_fill (extents, err); } diff --git a/tests/Makefile.am b/tests/Makefile.am index a2bbaea..aaf7450 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -366,9 +366,7 @@ test_oldstyle_LDADD = libtest.la $(LIBGUESTFS_LIBS) endif HAVE_LIBGUESTFS # Test export flags. -TESTS += \ - test-cacheextents....
2019 May 15
0
Re: [nbdkit PATCH] Introduce cacheextents filter
...nt ex = nbdkit_get_extent (cache_extents, i); > + if (nbdkit_add_extent (extents, ex.offset, ex.length, ex.type) < 0) This really only returns -1 on failure, and not any other negative values. > + return -1; > + } > + > + return 0; > +} > + > +static int > +cacheextents_fill (struct nbdkit_extents *extents) > +{ > + size_t i = 0; > + size_t count = nbdkit_extents_count (extents); > + struct nbdkit_extent first = nbdkit_get_extent (extents, 0); > + struct nbdkit_extent last = nbdkit_get_extent (extents, count - 1); > + > + nbdkit_extents_free (...
2019 May 16
1
Re: [nbdkit PATCH v2] Introduce cacheextents filter
...nbdkit_debug ("cacheextents: cache miss"); >- int r = next_ops->extents (nxdata, count, offset, flags, extents, err); >- if (r == -1) >- return r; >+ if (next_ops->extents (nxdata, count, offset, flags, extents, err) == -1) >+ return -1; > > return cacheextents_fill (extents, err); > } >diff --git a/tests/Makefile.am b/tests/Makefile.am >index a2bbaea..aaf7450 100644 >--- a/tests/Makefile.am >+++ b/tests/Makefile.am >@@ -366,9 +366,7 @@ test_oldstyle_LDADD = libtest.la $(LIBGUESTFS_LIBS) > endif HAVE_LIBGUESTFS > > # Test export flag...
2019 May 20
0
Re: [nbdkit PATCH v2] Introduce cacheextents filter
...err) == -1) return -1; if (offset + count <= cache_end) return 0; count -= cache_end - offset; offset = cache_end; append = true; } /* Miss or partially cached */ if (next_ops->extents (nxdata, count, offset, flags, extents, err) == -1) return -1; return cacheextents_fill (extents, append, err); and maybe even consider passing in a larger count to next_ops->extents, or even intentionally clearing the REQ_ONE flag before calling into next_ops, if our goal is to get as much information as feasible from next_ops for saving in our cache. > 2) Make sure that when...