Displaying 14 results from an estimated 14 matches for "cache_ext".
Did you mean:
cache_ent
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);...
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_...
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...
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)
> +{
> + s...
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_...
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");
>> +...
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...
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 (&...
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 ca...
2013 Mar 18
0
[PATCH] Btrfs-progs: fix memory leaks on cleanup
...close(device->fd);
+ kfree(device->name);
+ kfree(device->label);
+ kfree(device);
}
+ kfree(fs_info->fs_devices);
return 0;
}
+static void free_mapping_cache(struct btrfs_fs_info *fs_info)
+{
+ struct cache_tree *cache_tree = &fs_info->mapping_tree.cache_tree;
+ struct cache_extent *ce;
+ struct map_lookup *map;
+
+ while ((ce = find_first_cache_extent(cache_tree, 0))) {
+ map = container_of(ce, struct map_lookup, ce);
+ remove_cache_extent(cache_tree, ce);
+ kfree(map);
+ }
+}
+
int close_ctree(struct btrfs_root *root)
{
int ret;
@@ -1326,6 +1341,7 @@ int close_ctr...
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 (nxd...
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;
>+...
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
...,7 +2226,7 @@ static int add_extent_rec(struct cache_tree *extent_cache,
struct btrfs_key *parent_key,
u64 start, u64 nr, u64 extent_item_refs,
int is_root, int inc_ref, int set_checked,
- u64 max_size)
+ int metadata, u64 max_size)
{
struct extent_record *rec;
struct cache_extent *cache;
@@ -2277,6 +2279,7 @@ static int add_extent_rec(struct cache_tree *extent_cache,
rec->nr = max(nr, max_size);
rec->content_checked = 0;
rec->owner_ref_checked = 0;
+ rec->metadata = metadata;
INIT_LIST_HEAD(&rec->backrefs);
if (is_root)
@@ -2320,7 +2323,8 @...