2009-07-24 03:40:05 +04:00
/*
* Copyright ( C ) 2008 , 2009 Red Hat , Inc . All rights reserved .
*
* This file is part of LVM2 .
*
* This copyrighted material is made available to anyone wishing to use ,
* modify , copy , or redistribute it subject to the terms and conditions
* of the GNU Lesser General Public License v .2 .1 .
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program ; if not , write to the Free Software Foundation ,
* Inc . , 59 Temple Place , Suite 330 , Boston , MA 02111 - 1307 USA
*/
# include "lib.h"
2009-07-29 17:26:01 +04:00
# include "lvm2app.h"
2010-09-30 18:07:47 +04:00
# include "metadata.h"
2009-07-24 03:40:05 +04:00
# include "lvm-string.h"
2010-04-19 19:22:24 +04:00
const char * lvm_pv_get_uuid ( const pv_t pv )
2009-07-24 03:40:05 +04:00
{
2010-09-30 18:07:47 +04:00
return pv_uuid_dup ( pv ) ;
2009-07-24 03:40:05 +04:00
}
2010-04-19 19:22:24 +04:00
const char * lvm_pv_get_name ( const pv_t pv )
2009-07-24 03:40:05 +04:00
{
2010-04-19 19:22:24 +04:00
return dm_pool_strndup ( pv - > vg - > vgmem ,
( const char * ) pv_dev_name ( pv ) , NAME_LEN + 1 ) ;
2009-07-24 03:40:05 +04:00
}
2009-08-13 16:18:15 +04:00
uint64_t lvm_pv_get_mda_count ( const pv_t pv )
2009-07-26 17:06:59 +04:00
{
return ( uint64_t ) pv_mda_count ( pv ) ;
}
2009-07-28 01:00:50 +04:00
2010-02-14 06:21:37 +03:00
uint64_t lvm_pv_get_dev_size ( const pv_t pv )
{
2010-02-16 03:27:01 +03:00
return ( uint64_t ) SECTOR_SIZE * pv_dev_size ( pv ) ;
2010-02-14 06:21:37 +03:00
}
uint64_t lvm_pv_get_size ( const pv_t pv )
{
2010-02-16 03:27:01 +03:00
return ( uint64_t ) SECTOR_SIZE * pv_size_field ( pv ) ;
2010-02-14 06:21:37 +03:00
}
uint64_t lvm_pv_get_free ( const pv_t pv )
{
2010-02-16 03:27:01 +03:00
return ( uint64_t ) SECTOR_SIZE * pv_free ( pv ) ;
2010-02-14 06:21:37 +03:00
}
2009-08-13 16:18:15 +04:00
int lvm_pv_resize ( const pv_t pv , uint64_t new_size )
2009-07-28 01:00:50 +04:00
{
/* FIXME: add pv resize code here */
2009-07-28 01:03:15 +04:00
log_error ( " NOT IMPLEMENTED YET " ) ;
2009-07-28 01:00:50 +04:00
return - 1 ;
}