From d57b8232eefadd2a783981da0edee73b70b22e06 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Mon, 25 Mar 2019 14:56:55 -0700 Subject: [PATCH] scoutfs: move base types in format.h We had scattered some base types throughout the format file which made them annoying to reference in higher level structs. Let's put them at the top so we can use them without declarations or moving things around in unrelated commits. Signed-off-by: Zach Brown --- kmod/src/format.h | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/kmod/src/format.h b/kmod/src/format.h index 7c8589bb..f577b4bf 100644 --- a/kmod/src/format.h +++ b/kmod/src/format.h @@ -38,6 +38,25 @@ */ #define SCOUTFS_SUPER_BLKNO ((64ULL * 1024) >> SCOUTFS_BLOCK_SHIFT) +/* + * Base types used by other structures. + */ +struct scoutfs_timespec { + __le64 sec; + __le32 nsec; +} __packed; + +struct scoutfs_betimespec { + __be64 sec; + __be32 nsec; +} __packed; + +/* XXX ipv6 */ +struct scoutfs_inet_addr { + __le32 addr; + __le16 port; +} __packed; + /* * This header is stored at the start of btree blocks and the super * block for verification. The crc is calculated by zeroing the crc and @@ -340,10 +359,6 @@ struct scoutfs_xattr { __u8 name[0]; } __packed; -struct scoutfs_betimespec { - __be64 sec; - __be32 nsec; -} __packed; /* XXX does this exist upstream somewhere? */ #define member_sizeof(TYPE, MEMBER) (sizeof(((TYPE *)0)->MEMBER)) @@ -351,12 +366,6 @@ struct scoutfs_betimespec { #define SCOUTFS_UUID_BYTES 16 #define SCOUTFS_UNIQUE_NAME_MAX_BYTES 64 /* includes null */ -/* XXX ipv6 */ -struct scoutfs_inet_addr { - __le32 addr; - __le16 port; -} __packed; - struct scoutfs_super_block { struct scoutfs_block_header hdr; __le64 id; @@ -378,10 +387,6 @@ struct scoutfs_super_block { #define SCOUTFS_ROOT_INO 1 -struct scoutfs_timespec { - __le64 sec; - __le32 nsec; -} __packed; /* * @meta_seq: advanced the first time an inode is updated in a given