+ *
+ * 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
+ *
+ * Module: evms.c
Urgg, could you remove thise Module: junk? I had to fight that in JFS already..
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <asm/errno.h>
DON'T include kernel headers from userspace. Please use <errno.h> instead.
+#include <volume.h>
+#include "evms.h"
+
+int
+mnt_is_evms_subvol(dev_t dev)
+{
+ if (dev >> 8 == EVMS_MAJOR)
Please use major() from <sys/sysmacros.h> instead. Userspace dev_t
is 16bit on libc4/libc5 systems and 64bit on glibc systems. I guess
uclibc/dietlibc use something small, too.
+static int
+get_stripe_info(int fd, evms_vol_stripe_info_t *info)
+{
+ int rc = 0;
+ int status;
+
+ status = ioctl(fd, EVMS_GET_VOL_STRIPE_INFO, info);
+ if (status) {
+ rc = errno;
+ }
+ return(rc);
What about:
if (ioctl(fd, EVMS_GET_VOL_STRIPE_INFO, info))
return errno;
return 0;
instead? much easier to parse.
+ * Module: evms.h
Dito.
+#include <linux/hdreg.h>
+#include <linux/major.h>
Kernel header _again_. What do you actually need them for?
|