1 /* $NetBSD: lvm_pv.c,v 1.1.1.1 2009/12/02 00:26:15 haad Exp $ */
4 * Copyright (C) 2008,2009 Red Hat, Inc. All rights reserved.
6 * This file is part of LVM2.
8 * This copyrighted material is made available to anyone wishing to use,
9 * modify, copy, or redistribute it subject to the terms and conditions
10 * of the GNU Lesser General Public License v.2.1.
12 * You should have received a copy of the GNU Lesser General Public License
13 * along with this program; if not, write to the Free Software Foundation,
14 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #include "metadata-exported.h"
20 #include "lvm-string.h"
22 char *lvm_pv_get_uuid(const pv_t pv)
24 char uuid[64] __attribute((aligned(8)));
26 if (!id_write_format(&pv->id, uuid, sizeof(uuid))) {
27 log_error("Internal error converting uuid");
30 return strndup((const char *)uuid, 64);
33 char *lvm_pv_get_name(const pv_t pv)
37 name = dm_malloc(NAME_LEN + 1);
38 strncpy(name, (const char *)pv_dev_name(pv), NAME_LEN);
39 name[NAME_LEN] = '\0';
43 uint64_t lvm_pv_get_mda_count(const pv_t pv)
45 return (uint64_t) pv_mda_count(pv);
48 int lvm_pv_resize(const pv_t pv, uint64_t new_size)
50 /* FIXME: add pv resize code here */
51 log_error("NOT IMPLEMENTED YET");