1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 20:25:52 +03:00
lvm2/lib/metadata/pv_map.h
Joe Thornber 488a58a998 o Striped allocator
o  Changed pv_map.c to maintain the list of free areas in size order, which
   is more helpful to the allocators.  If you want to allocate a bit of an
   area call consume_area(area, size), this will adjust the area if there's
   some space left and shuffle it to the correct place in the list.


Not tested.
2001-11-29 18:45:35 +00:00

44 lines
798 B
C

/*
* Copyright (C) 2001 Sistina Software
*
* This file is released under the LGPL.
*/
#ifndef _LVM_PV_MAP_H
#define _LVM_PV_MAP_H
#include "metadata.h"
#include "bitset.h"
#include "pool.h"
/*
* The in core rep. only stores a mapping from
* logical extents to physical extents against an
* lv. Sometimes, when allocating a new lv for
* instance, it is useful to have the inverse
* mapping available.
*/
struct pv_area {
struct pv_map *map;
uint32_t start;
uint32_t count;
struct list list;
};
struct pv_map {
struct physical_volume *pv;
bitset_t allocated_extents;
struct list areas;
struct list list;
};
struct list *create_pv_maps(struct pool *mem,
struct volume_group *vg, struct list *pvs);
void consume_pv_area(struct pv_area *area, uint32_t to_go);
#endif