Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153988497
D41063.id124795.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D41063.id124795.diff
View Options
diff --git a/lib/libsysdecode/Makefile b/lib/libsysdecode/Makefile
--- a/lib/libsysdecode/Makefile
+++ b/lib/libsysdecode/Makefile
@@ -121,6 +121,11 @@
CFLAGS+=-DPF
.endif
+ZFSINC= ${SRCTOP}/sys/contrib/openzfs/include
+.if ${MK_ZFS} != "no"
+CFLAGS+=-DZFS -I${ZFSINC}
+.endif
+
# Workaround duplicate declarations in <netinet/ip_compat.h>
CFLAGS.gcc.ioctl.c+= -Wno-redundant-decls
@@ -139,6 +144,7 @@
.endif
ioctl.c.tmp: mkioctls .META
env CPP="${CPP}" MK_PF="${MK_PF}" \
+ MK_ZFS="${MK_ZFS}" ZFSINC="${ZFSINC}" \
/bin/sh ${.CURDIR}/mkioctls ${SYSROOT:U${DESTDIR}}${INCLUDEDIR} > ${.TARGET}
ioctl.c: ioctl.c.tmp
diff --git a/lib/libsysdecode/mkioctls b/lib/libsysdecode/mkioctls
--- a/lib/libsysdecode/mkioctls
+++ b/lib/libsysdecode/mkioctls
@@ -75,6 +75,11 @@
print "#include <stddef.h>"
print "#include <stdint.h>"
print "#include <sysdecode.h>"
+ print "#ifdef ZFS"
+ print "#define boolean_t int"
+ print "#define hrtime_t int"
+ print "#include <sys/fs/zfs.h>"
+ print "#endif"
print ""
print ioctl_includes
print ""
@@ -99,9 +104,17 @@
printf("if (val == %s)\n", $i);
printf("\t\tstr = \"%s\";\n", $i);
}
-END {
- print ""
- print "\treturn (str);"
- print "}"
-}
'
+# ZFS is special
+if [ "${MK_ZFS}" = "yes" ]; then
+ sed -nE 's/^ (ZFS_IOC_[A-Z0-9_]+).*$/\1/p' ${ZFSINC}/sys/fs/zfs.h |
+ sort -u | grep -vE 'ZFS_IOC_(FIRST|LAST)' |
+ while read ioc; do
+ printf "\telse if ((val & 0xffff) == $ioc + ('Z' << 8))\n"
+ printf "\t\tstr = \"$ioc\";\n"
+ done
+fi
+
+printf "\n"
+printf "\treturn (str);\n"
+printf "}\n"
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Apr 26, 6:57 AM (2 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32171651
Default Alt Text
D41063.id124795.diff (1 KB)
Attached To
Mode
D41063: libsysdecode: add zfs iocs
Attached
Detach File
Event Timeline
Log In to Comment