search for: cache_extents

Displaying 14 results from an estimated 14 matches for "cache_extents".

2019 May 15
2
[nbdkit PATCH] Introduce cacheextents filter
...is lock protects the global state. */ +static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; + +/* The real size of the underlying plugin. */ +static uint64_t size; + +/* Cached 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++)...
2019 Jun 11
5
[nbdkit PATCH v2] Introduce cacheextents filter
...up.h" + +#define THREAD_MODEL NBDKIT_THREAD_MODEL_PARALLEL + +/* This lock protects the global state. */ +static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; + +/* Cached 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_exte...
2019 May 15
0
Re: [nbdkit PATCH] Introduce cacheextents filter
...t'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) This really only returns -1 on failure, and not any other negative values. > + return -1; > + } > + > + return 0;...
2019 Jun 11
0
Re: [nbdkit PATCH v2] Introduce cacheextents filter
...acheextents/cacheextents.c > + > +/* Cached extents from the last extents () call and its start and end for the > + sake of simplicity. */ The prevailing style seems to be the use of leading ' *' on subsequent comment 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_...
2019 May 15
6
[nbdkit PATCH v2] Introduce cacheextents filter
...is lock protects the global state. */ +static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; + +/* The real size of the underlying plugin. */ +static uint64_t size; + +/* Cached 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_exte...
2019 May 20
2
Re: [nbdkit PATCH v2] Introduce cacheextents filter
...int *err) >> +{ >> + ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&lock); >> + >> + nbdkit_debug ("cacheextents:" >> + " cache_start=%" PRIu64 >> + " cache_end=%" PRIu64 >> + " cache_extents=%p", >> + cache_start, cache_end, cache_extents); >> + >> + if (cache_extents && >> + offset >= cache_start && offset < cache_end) { >> + nbdkit_debug ("cacheextents: returning from cache"); >> + ret...
2019 May 16
0
Re: [nbdkit PATCH v2] Introduce cacheextents filter
...xtents, > + int *err) > +{ > + ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&lock); > + > + nbdkit_debug ("cacheextents:" > + " cache_start=%" PRIu64 > + " cache_end=%" PRIu64 > + " 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 (ex...
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 (&quot...
2019 Jun 11
0
Re: [nbdkit PATCH v2] Introduce cacheextents filter
...dhat.com> > --- > > + > +/* This lock protects the global state. */ > +static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; > + > +/* Cached 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; This shares a common cache across multiple connections. If the plugin ever returns connection-dependent differences (such as different sizes according to when the connection was made), we may have to change this to track a cache...
2013 Mar 18
0
[PATCH] Btrfs-progs: fix memory leaks on cleanup
I''ve been working on btrfs-image and I kept seeing these leaks pop up on valgrind so I''m just fixing them. We don''t properly cleanup the device cache, the chunk tree mapping cache, or the space infos on close. With this patch valgrind doesn''t complain about any memory leaks running btrfs-image. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com>
2019 May 16
0
Re: [nbdkit PATCH v2] Introduce cacheextents filter
...is lock protects the global state. */ static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; -/* The real size of the underlying plugin. */ -static uint64_t size; - /* Cached extents from the last extents () call and its start and end for the sake of simplicity. */ struct nbdkit_extents *cache_extents; @@ -131,9 +128,8 @@ cacheextents_extents (struct nbdkit_next_ops *next_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,...
2019 May 16
1
Re: [nbdkit PATCH v2] Introduce cacheextents filter
...te. */ > static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; > >-/* The real size of the underlying plugin. */ >-static uint64_t size; >- > /* Cached extents from the last extents () call and its start and end for the > sake of simplicity. */ > struct nbdkit_extents *cache_extents; >@@ -131,9 +128,8 @@ cacheextents_extents (struct nbdkit_next_ops *next_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...
2012 Mar 20
13
[PATCH 0 of 3 v2] PV-GRUB: add support for ext4 and btrfs
Hi, The following patches add support for ext4 and btrfs to PV-GRUB. These patches are taken nearly verbatim from those provided by Fedora and Gentoo. We''ve been using these patches for the PV-GRUB images available in EC2 for some time now with no problems. Changes from v1: - Makefile has been changed to check the exit code from patch - The btrfs patch has been rebased to apply
2013 Mar 15
0
[PATCH] Btrfs-progs: add skinny metadata support to progs V3
This fixes up the progs to properly deal with skinny metadata. This adds the -x option to mkfs and btrfstune for enabling the skinny metadata option. This also makes changes to fsck so it can properly deal with the skinny metadata entries. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com> --- V2->V3: update the mkfs.btrfs man page with the new option This is based on