]>
git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - libdisk/lvm.c
2 * Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of version 2 of the GNU General Public License as
6 * published by the Free Software Foundation.
8 * This program is distributed in the hope that it would be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 * Further, this software is distributed without any warranty that it is
13 * free of the rightful claim of any third person regarding infringement
14 * or the like. Any license provided herein, whether implied or
15 * otherwise, applies only to this software file. Patent licenses, if
16 * any, provided herein do not apply to combinations of this program with
17 * other software, or any other product whatsoever.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write the Free Software Foundation, Inc., 59
21 * Temple Place - Suite 330, Boston MA 02111-1307, USA.
23 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24 * Mountain View, CA 94043, or:
28 * For further information regarding this notice, see:
30 * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
41 char *cmd
; /* Not used. liblvm is broken */
42 int opt_d
; /* Same thing */
46 mnt_is_lvm_subvol(dev_t dev
)
48 if (dev
>> 8 == LVM_BLK_MAJOR
)
54 lvm_get_subvol_stripe(
62 if (mnt_is_lvm_subvol(sb
->st_rdev
)) {
66 /* Find volume group */
67 if (! (vgname
= vg_name_of_lv(dfile
))) {
68 fprintf(stderr
, "Can't find volume group for %s\n",
74 if (! lvm_tab_lv_check_exist(dfile
)) {
75 fprintf(stderr
, "Logical volume %s doesn't exist!\n",
81 if (lv_status_byname(vgname
, dfile
, &lv
) < 0 || lv
== NULL
) {
82 fprintf(stderr
, "Could not get status info from %s\n",
87 /* Check that data is consistent */
88 if (lv_check_consistency(lv
) < 0) {
89 fprintf(stderr
, "Logical volume %s is inconsistent\n",
95 *sunit
= lv
->lv_stripesize
;
96 *swidth
= lv
->lv_stripes
* lv
->lv_stripesize
;
100 #endif /* HAVE_LIBLVM */