search for: insert_map

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

Did you mean: insert_imp
2015 Dec 24
4
[PATCH] btrfs: Fix logical to physical block address mapping
...deletions(-) diff --git a/core/fs/btrfs/btrfs.c b/core/fs/btrfs/btrfs.c index 53e1105..a06607e 100644 --- a/core/fs/btrfs/btrfs.c +++ b/core/fs/btrfs/btrfs.c @@ -81,7 +81,8 @@ static int btrfs_comp_chunk_map(struct btrfs_chunk_map_item *m1, } /* insert a new chunk mapping item */ -static void insert_map(struct fs_info *fs, struct btrfs_chunk_map_item *item) +static void insert_chunk_item(struct fs_info *fs, + struct btrfs_chunk_map_item *item) { struct btrfs_info * const bfs = fs->fs_info; struct btrfs_chunk_map *chunk_map = &bfs->chunk_map; @@ -113,6 +114,22 @@ static void...
2015 Dec 24
0
[PATCH v2] btrfs: Fix logical to physical block address mapping
...deletions(-) diff --git a/core/fs/btrfs/btrfs.c b/core/fs/btrfs/btrfs.c index 53e1105..ca611db 100644 --- a/core/fs/btrfs/btrfs.c +++ b/core/fs/btrfs/btrfs.c @@ -81,7 +81,8 @@ static int btrfs_comp_chunk_map(struct btrfs_chunk_map_item *m1, } /* insert a new chunk mapping item */ -static void insert_map(struct fs_info *fs, struct btrfs_chunk_map_item *item) +static void insert_chunk_item(struct fs_info *fs, + struct btrfs_chunk_map_item *item) { struct btrfs_info * const bfs = fs->fs_info; struct btrfs_chunk_map *chunk_map = &bfs->chunk_map; @@ -113,6 +114,22 @@ static void...
2015 Dec 27
0
[PATCH v3] btrfs: Fix logical to physical block address mapping
...deletions(-) diff --git a/core/fs/btrfs/btrfs.c b/core/fs/btrfs/btrfs.c index 53e1105..58e1fe6 100644 --- a/core/fs/btrfs/btrfs.c +++ b/core/fs/btrfs/btrfs.c @@ -81,7 +81,8 @@ static int btrfs_comp_chunk_map(struct btrfs_chunk_map_item *m1, } /* insert a new chunk mapping item */ -static void insert_map(struct fs_info *fs, struct btrfs_chunk_map_item *item) +static void insert_chunk_item(struct fs_info *fs, + struct btrfs_chunk_map_item *item) { struct btrfs_info * const bfs = fs->fs_info; struct btrfs_chunk_map *chunk_map = &bfs->chunk_map; @@ -113,6 +114,22 @@ static void...
2015 Dec 27
1
[PATCH v2] btrfs: Fix logical to physical block address mapping
...item.logical = path.item.key.offset; > - item.length = chunk->length; > - item.devid = chunk->stripe.devid; > - item.physical = chunk->stripe.offset; > - insert_map(fs, &item); > + insert_map(fs, &path.item.key, chunk); > + > + skip_dev_item: > + ; > } while (!next_slot(fs, &search_key, &path)); > i...
2018 Jul 31
2
Re: [PATCH nbdkit 3/4] Add map filter.
...format itself permits overlaps for shorthands for special-casing subregions. Is there a syntax for explicitly mentioning a subset is unmapped even after a larger mapping is applied first (perhaps useful for redacting a portion of a disk containing sensitive information)? > +static int > +insert_mapping (struct map *map, const struct mapping *new_mapping) > +{ > + size_t i; > + > + /* Adjust existing mappings if they overlap with this mapping. */ > + for (i = 0; i < map->nr_map; ++i) { > + if (mappings_overlap (&map->map[i], new_mapping)) { > + /* T...
2018 Aug 01
0
Re: [PATCH nbdkit 3/4] Add map filter.
...ive information)? It's a good idea for a TODO item, so I'll add it there. At the moment it's possible to express this in the map file, but only by positively listing the regions you want to be mapped, not by negatively listing regions you want unmapped. > >+static int > >+insert_mapping (struct map *map, const struct mapping *new_mapping) > >+{ > >+ size_t i; > >+ > >+ /* Adjust existing mappings if they overlap with this mapping. */ > >+ for (i = 0; i < map->nr_map; ++i) { > >+ if (mappings_overlap (&map->map[i], new_mapp...
2018 Jul 31
0
[PATCH nbdkit 3/4] Add map filter.
...); +} + +/* Return the highest address in the map+1. */ +int64_t +map_size (struct map *map) +{ + if (map->nr_map == 0) + return 0; + else + return map->map[map->nr_map-1].rq_end + 1; +} + +/* Add a single new mapping at the end of the map. Does NOT maintain + * the invariant, use insert_mapping instead. + */ +static int +add_mapping (struct map *map, const struct mapping *mapping) +{ + struct mapping *new_map; + + map->nr_map++; + new_map = realloc (map->map, map->nr_map * sizeof map->map[0]); + if (new_map == NULL) { + nbdkit_error ("realloc: %m"); + r...
2018 Jul 31
7
[PATCH nbdkit 0/4] Add truncate and map filters.
This patch series proposes two new filters. * truncate: This can truncate, extend, round up or round down the size of a plugin/device. A typical usage is to fix the qemu problem that it can only handle devices which are a multiple of 512-bytes: nbdkit --filter=truncate random size=500 round-up=512 This will serve a virtual device with size 512 bytes. Reading from the last 12 bytes will