aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/filio.h
diff options
context:
space:
mode:
authorAlan Somers <asomers@FreeBSD.org>2019-06-20 14:13:10 +0000
committerAlan Somers <asomers@FreeBSD.org>2019-06-20 14:13:10 +0000
commitd49b446bfb0a2714dbb99183ec61269a741c2211 (patch)
treefc2fc3666b74d1eae6e4d504b2bf32c5e587057b /sys/sys/filio.h
parentd01752c70359f43da4a6b41058a8987227135ae5 (diff)
downloadsrc-d49b446bfb0a2714dbb99183ec61269a741c2211.tar.gz
src-d49b446bfb0a2714dbb99183ec61269a741c2211.zip
Add FIOBMAP2 ioctl
This ioctl exposes VOP_BMAP information to userland. It can be used by programs like fragmentation analyzers and optimized cp implementations. But I'm using it to test fusefs's VOP_BMAP implementation. The "2" in the name distinguishes it from the similar but incompatible FIBMAP ioctls in NetBSD and Linux. FIOBMAP2 differs from FIBMAP in that it uses a 64-bit block number instead of 32-bit, and it also returns runp and runb. Reviewed by: mckusick MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20705
Notes
Notes: svn path=/head/; revision=349231
Diffstat (limited to 'sys/sys/filio.h')
-rw-r--r--sys/sys/filio.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/sys/filio.h b/sys/sys/filio.h
index 868fe53c2585..1a3fc4293d29 100644
--- a/sys/sys/filio.h
+++ b/sys/sys/filio.h
@@ -62,6 +62,13 @@ struct fiodgname_arg {
/* Handle lseek SEEK_DATA and SEEK_HOLE for holey file knowledge. */
#define FIOSEEKDATA _IOWR('f', 97, off_t) /* SEEK_DATA */
#define FIOSEEKHOLE _IOWR('f', 98, off_t) /* SEEK_HOLE */
+struct fiobmap2_arg {
+ int64_t bn;
+ int runp;
+ int runb;
+};
+/* Get the file's bmap info for the logical block bn */
+#define FIOBMAP2 _IOWR('f', 99, struct fiobmap2_arg)
#ifdef _KERNEL
#ifdef COMPAT_FREEBSD32