summaryrefslogtreecommitdiffstats
path: root/sys/cddl
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2014-12-18 08:38:07 +0000
committermav <mav@FreeBSD.org>2014-12-18 08:38:07 +0000
commit4ff47ae9abedf70df85d191c50e4130adbdea839 (patch)
tree493e69933075582f0f9d4d1a850896cee12710af /sys/cddl
parent251a95deec1d0bdb97ae02542b701f42eb54476a (diff)
downloadFreeBSD-src-4ff47ae9abedf70df85d191c50e4130adbdea839.zip
FreeBSD-src-4ff47ae9abedf70df85d191c50e4130adbdea839.tar.gz
MFC r275474: Add GET LBA STATUS command support to CTL.
It is implemented for LUNs backed by ZVOLs in "dev" mode and files. GEOM has no such API, so for LUNs backed by raw devices all LBAs will be reported as mapped/unknown. Sponsored by: iXsystems, Inc.
Diffstat (limited to 'sys/cddl')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
index 0451c65..e483d33 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
@@ -91,6 +91,7 @@
#include <sys/dmu_tx.h>
#include <sys/zfeature.h>
#include <sys/zio_checksum.h>
+#include <sys/filio.h>
#include <geom/geom.h>
@@ -2914,6 +2915,18 @@ zvol_d_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct threa
error = ENOIOCTL;
break;
}
+ case FIOSEEKHOLE:
+ case FIOSEEKDATA: {
+ off_t *off = (off_t *)data;
+ uint64_t noff;
+ boolean_t hole;
+
+ hole = (cmd == FIOSEEKHOLE);
+ noff = *off;
+ error = dmu_offset_next(zv->zv_objset, ZVOL_OBJ, hole, &noff);
+ *off = noff;
+ break;
+ }
default:
error = ENOIOCTL;
}
OpenPOWER on IntegriCloud