diff --git a/kmod/src/Makefile b/kmod/src/Makefile index 5b824081..889f80d7 100644 --- a/kmod/src/Makefile +++ b/kmod/src/Makefile @@ -7,3 +7,18 @@ CFLAGS_scoutfs_trace.o = -I$(src) # define_trace.h double include scoutfs-y += alloc.o bio.o btree.o compact.o counters.o data.o dir.o kvec.o \ inode.o ioctl.o item.o key.o lock.o manifest.o msg.o net.o \ options.o seg.o scoutfs_trace.o sort_priv.o super.o trans.o xattr.o + +# +# The raw types aren't available in userspace headers. Make sure all +# the types we use in the headers are the exported __ versions. +# +# XXX dunno how we're really supposed to do this in kbuild +# +.PHONY: $(src)/check_exported_types +$(src)/check_exported_types: + @if egrep '\<[us](8|16|32|64\>)' $(src)/format.h $(src)/ioctl.h; then \ + echo "no raw types in exported headers, preface with __"; \ + exit 1; \ + fi + +extra-y += check_exported_types diff --git a/kmod/src/format.h b/kmod/src/format.h index 6251c8f8..6c37816d 100644 --- a/kmod/src/format.h +++ b/kmod/src/format.h @@ -212,8 +212,8 @@ struct scoutfs_segment_item { __u8 nr_links; __le32 skip_links[0]; /* - * u8 key_bytes[key_len] - * u8 val_bytes[val_len] + * __u8 key_bytes[key_len] + * __u8 val_bytes[val_len] */ } __packed; diff --git a/kmod/src/ioctl.h b/kmod/src/ioctl.h index 79241e9f..0dcb6bc7 100644 --- a/kmod/src/ioctl.h +++ b/kmod/src/ioctl.h @@ -116,7 +116,7 @@ struct scoutfs_ioctl_ino_path { } __packed; #define SCOUTFS_IOC_INO_PATH_CURSOR_BYTES \ - (sizeof(u64) + SCOUTFS_NAME_LEN + 1) + (sizeof(__u64) + SCOUTFS_NAME_LEN + 1) /* Get a single path from the root to the given inode number */ #define SCOUTFS_IOC_INO_PATH _IOW(SCOUTFS_IOCTL_MAGIC, 2, \