Skip to content

Commit

Permalink
drr_begin: can't forward declare untagged struct
Browse files Browse the repository at this point in the history
When compiling with Clang++ it does not allow for untagged structs, so
struct ddr_begin needs to be declared before the struct that uses it.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jorgen Lundman <lundman@lundman.net>
Closes openzfs#10453
  • Loading branch information
lundman authored and RageLtMan committed May 31, 2021
1 parent 0f8d666 commit 91d9bd6
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions include/sys/zfs_ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,19 @@ typedef enum dmu_send_resume_token_version {
/*
* zfs ioctl command structure
*/

/* Header is used in C++ so can't forward declare untagged struct */
struct drr_begin {
uint64_t drr_magic;
uint64_t drr_versioninfo; /* was drr_version */
uint64_t drr_creation_time;
dmu_objset_type_t drr_type;
uint32_t drr_flags;
uint64_t drr_toguid;
uint64_t drr_fromguid;
char drr_toname[MAXNAMELEN];
};

typedef struct dmu_replay_record {
enum {
DRR_BEGIN, DRR_OBJECT, DRR_FREEOBJECTS,
Expand All @@ -233,16 +246,7 @@ typedef struct dmu_replay_record {
} drr_type;
uint32_t drr_payloadlen;
union {
struct drr_begin {
uint64_t drr_magic;
uint64_t drr_versioninfo; /* was drr_version */
uint64_t drr_creation_time;
dmu_objset_type_t drr_type;
uint32_t drr_flags;
uint64_t drr_toguid;
uint64_t drr_fromguid;
char drr_toname[MAXNAMELEN];
} drr_begin;
struct drr_begin drr_begin;
struct drr_end {
zio_cksum_t drr_checksum;
uint64_t drr_toguid;
Expand Down

0 comments on commit 91d9bd6

Please sign in to comment.