summaryrefslogtreecommitdiffstats
path: root/lib/libgeom/geom_util.c
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2010-01-17 06:20:30 +0000
committerdelphij <delphij@FreeBSD.org>2010-01-17 06:20:30 +0000
commit16c4a5ec2099b564a3372fead91070ad8816723a (patch)
treeeddbf7d4c94dd7c16658d16b0e3f9612ebc27ff9 /lib/libgeom/geom_util.c
parent7cef302ab8816e0aac85ec3070022921b840af26 (diff)
downloadFreeBSD-src-16c4a5ec2099b564a3372fead91070ad8816723a.zip
FreeBSD-src-16c4a5ec2099b564a3372fead91070ad8816723a.tar.gz
Expose stripe offset and stripe size through libgeom and geom(8) userland
utilities. Reviewed by: pjd, mav (earlier version)
Diffstat (limited to 'lib/libgeom/geom_util.c')
-rw-r--r--lib/libgeom/geom_util.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/libgeom/geom_util.c b/lib/libgeom/geom_util.c
index 539b6c6..54844c6 100644
--- a/lib/libgeom/geom_util.c
+++ b/lib/libgeom/geom_util.c
@@ -114,6 +114,32 @@ g_sectorsize(int fd)
}
/*
+ * Return stripe size of the given provider.
+ */
+off_t
+g_stripesize(int fd)
+{
+ off_t stripesize;
+
+ if (g_ioctl_arg(fd, DIOCGSTRIPESIZE, &stripesize) == -1)
+ return (-1);
+ return (stripesize);
+}
+
+/*
+ * Return stripe size of the given provider.
+ */
+off_t
+g_stripeoffset(int fd)
+{
+ off_t stripeoffset;
+
+ if (g_ioctl_arg(fd, DIOCGSTRIPEOFFSET, &stripeoffset) == -1)
+ return (-1);
+ return (stripeoffset);
+}
+
+/*
* Return the correct provider name.
*/
char *
OpenPOWER on IntegriCloud