Expand PMF_FN_* macros.
[netbsd-mini2440.git] / external / gpl2 / lvm2 / dist / liblvm / lvm_pv.c
blob087e1bb5ecdde957d18eec06c051e3a01465e222
1 /* $NetBSD$ */
3 /*
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
17 #include "lib.h"
18 #include "lvm2app.h"
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");
28 return NULL;
30 return strndup((const char *)uuid, 64);
33 char *lvm_pv_get_name(const pv_t pv)
35 char *name;
37 name = dm_malloc(NAME_LEN + 1);
38 strncpy(name, (const char *)pv_dev_name(pv), NAME_LEN);
39 name[NAME_LEN] = '\0';
40 return name;
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");
52 return -1;