2001-12-13 03:07:29 +03:00
/*
* Copyright ( C ) 2001 Sistina Software ( UK ) Limited .
*
* This file is released under the LGPL .
*
*/
# ifndef _LVM_VGCACHE_H
# define _LVM_VGCACHE_H
2002-01-15 13:24:48 +03:00
# include <sys/types.h>
# include <asm/page.h>
2002-01-14 14:43:52 +03:00
# include "dev-cache.h"
2002-01-15 13:24:48 +03:00
# include "list.h"
2002-03-05 23:03:09 +03:00
# include "uuid.h"
# include "toolcontext.h"
2001-12-13 03:07:29 +03:00
2002-01-15 13:24:48 +03:00
struct vgname_entry {
struct list pvdevs ;
char * vgname ;
2002-03-05 23:03:09 +03:00
char vgid [ ID_LEN + 1 ] ;
2002-04-24 22:20:51 +04:00
struct format_type * fmt ;
2002-01-15 13:24:48 +03:00
} ;
2001-12-13 03:07:29 +03:00
2002-01-15 13:24:48 +03:00
struct pvdev_list {
struct list list ;
struct device * dev ;
} ;
2001-12-13 03:07:29 +03:00
2002-01-15 13:24:48 +03:00
int vgcache_init ( ) ;
void vgcache_destroy ( ) ;
2001-12-13 03:07:29 +03:00
2002-01-15 13:24:48 +03:00
/* Return list of PVs in named VG */
struct list * vgcache_find ( const char * vg_name ) ;
2002-04-24 22:20:51 +04:00
struct format_type * vgcache_find_format ( const char * vg_name ) ;
2002-03-05 23:03:09 +03:00
struct list * vgcache_find_by_vgid ( const char * vgid ) ;
/* FIXME Temporary function */
char * vgname_from_vgid ( struct cmd_context * cmd , struct id * vgid ) ;
2001-12-13 03:07:29 +03:00
2002-01-15 13:24:48 +03:00
/* Add/delete a device */
2002-04-24 22:20:51 +04:00
int vgcache_add ( const char * vg_name , const char * vgid , struct device * dev ,
struct format_type * fmt ) ;
2002-01-15 13:24:48 +03:00
void vgcache_del ( const char * vg_name ) ;
2001-12-13 03:07:29 +03:00
# endif