diff -urN xfsprogs-2.0.3/libdisk/Makefile xfsprogs-2.0.3-evms/libdisk/Makefile --- xfsprogs-2.0.3/libdisk/Makefile Mon Apr 15 09:08:58 2002 +++ xfsprogs-2.0.3-evms/libdisk/Makefile Thu Aug 1 12:27:38 2002 @@ -38,8 +38,8 @@ LT_REVISION = 0 LT_AGE = 0 -CFILES = fstype.c pttype.c md.c xvm.c lvm.c drivers.c mountinfo.c -HFILES = fstype.h pttype.h md.h xvm.h +CFILES = fstype.c pttype.c md.c xvm.c lvm.c drivers.c mountinfo.c evms.c +HFILES = fstype.h pttype.h md.h xvm.h evms.h default: $(LTLIBRARY) diff -urN xfsprogs-2.0.3/libdisk/drivers.c xfsprogs-2.0.3-evms/libdisk/drivers.c --- xfsprogs-2.0.3/libdisk/drivers.c Mon Apr 15 09:08:58 2002 +++ xfsprogs-2.0.3-evms/libdisk/drivers.c Thu Aug 1 12:27:38 2002 @@ -40,6 +40,7 @@ extern int md_get_subvol_stripe(char*, sv_type_t, int*, int*, struct stat64*); extern int lvm_get_subvol_stripe(char*, sv_type_t, int*, int*, struct stat64*); extern int xvm_get_subvol_stripe(char*, sv_type_t, int*, int*, struct stat64*); +extern int evms_get_subvol_stripe(char*, sv_type_t, int*, int*, struct stat64*); void get_subvol_stripe_wrapper(char *dev, sv_type_t type, int *sunit, int *swidth) @@ -53,7 +54,9 @@ fprintf(stderr, "Cannot stat %s: %s\n", dev, strerror(errno)); exit(1); } - + + if (evms_get_subvol_stripe(dev, type, sunit, swidth, &sb)) + return; if ( md_get_subvol_stripe(dev, type, sunit, swidth, &sb)) return; if (lvm_get_subvol_stripe(dev, type, sunit, swidth, &sb)) diff -urN xfsprogs-2.0.3/libdisk/evms.c xfsprogs-2.0.3-evms/libdisk/evms.c --- xfsprogs-2.0.3/libdisk/evms.c Wed Dec 31 18:00:00 1969 +++ xfsprogs-2.0.3-evms/libdisk/evms.c Thu Aug 1 12:52:51 2002 @@ -0,0 +1,62 @@ +/* + * + * Copyright (c) International Business Machines Corp., 2002 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU 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 +#include +#include +#include +#include +#include +#include +#include "evms.h" + +int +mnt_is_evms_subvol(dev_t dev) +{ + if (major(dev) == EVMS_MAJOR) + return(1); + return(0); +} + + +int +evms_get_subvol_stripe(char *device, + sv_type_t type, + int *sunit, int *swidth, struct stat64 *sb) +{ + int rc = 0; + + if (mnt_is_evms_subvol(sb->st_rdev)) { + int fd; + + fd = open(device, O_RDONLY | O_NONBLOCK); + if (fd >= 0) { + evms_vol_stripe_info_t info; + + if (ioctl(fd, EVMS_GET_VOL_STRIPE_INFO, &info) == 0) { + *sunit = info.size; + *swidth = *sunit * info.width; + rc = 1; + } + close(fd); + } + } + return(rc); +} diff -urN xfsprogs-2.0.3/libdisk/evms.h xfsprogs-2.0.3-evms/libdisk/evms.h --- xfsprogs-2.0.3/libdisk/evms.h Wed Dec 31 18:00:00 1969 +++ xfsprogs-2.0.3-evms/libdisk/evms.h Thu Aug 1 12:27:50 2002 @@ -0,0 +1,37 @@ +/* + * + * Copyright (c) International Business Machines Corp., 2002 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU 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 + * + */ + +#define EVMS_MAJOR 117 + +#define EVMS_GET_VOL_STRIPE_INFO_NUMBER 0xF0 + +/* + * struct evms_vol_stripe_info_s - contains stripe information for a volume + * + * unit: the stripe unit specified in 512 byte block units + * width: the number of stripe members or RAID data disks + * + */ +typedef struct evms_vol_stripe_info_s { + u_int32_t size; + u_int32_t width; +} evms_vol_stripe_info_t; + +#define EVMS_GET_VOL_STRIPE_INFO _IOR(EVMS_MAJOR, EVMS_GET_VOL_STRIPE_INFO_NUMBER, evms_vol_stripe_info_t)