Skip to contentSkip to conversation

Revert "ceph: make members in struct ceph_mds_request_args_ext a union"

PATCH In review Ilya Dryomov 2 participants 2 messages Sep 18, 2023 Ceph common code (libceph)

lore
Share & tools
lore

Ilya Dryomov

author maintainer
#0 lore raw

PATCH 1/1 Revert "ceph: make members in struct ceph_mds_request_args_ext a union"

This reverts commit 3af5ae22030cb59fab4fba35f5a2b62f47e14df9.

ceph_mds_request_args_ext was already (and remains to be) a union. An additional anonymous union inside is bogus:

    union ceph_mds_request_args_ext {
        union {
            union ceph_mds_request_args old;
            struct { ... } __attribute__ ((packed)) setattr_ext;
        };
    }
---
 include/linux/ceph/ceph_fs.h | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)
include/linux/ceph/ceph_fs.h +11 -13
index 5f2301ee88bc..f3b3593254b9 100644
@@ -467,19 +467,17 @@ union ceph_mds_request_args {
 } __attribute__ ((packed));
 
 union ceph_mds_request_args_ext {
-	union {
-		union ceph_mds_request_args old;
-		struct {
-			__le32 mode;
-			__le32 uid;
-			__le32 gid;
-			struct ceph_timespec mtime;
-			struct ceph_timespec atime;
-			__le64 size, old_size;       /* old_size needed by truncate */
-			__le32 mask;                 /* CEPH_SETATTR_* */
-			struct ceph_timespec btime;
-		} __attribute__ ((packed)) setattr_ext;
-	};
+	union ceph_mds_request_args old;
+	struct {
+		__le32 mode;
+		__le32 uid;
+		__le32 gid;
+		struct ceph_timespec mtime;
+		struct ceph_timespec atime;
+		__le64 size, old_size;       /* old_size needed by truncate */
+		__le32 mask;                 /* CEPH_SETATTR_* */
+		struct ceph_timespec btime;
+	} __attribute__ ((packed)) setattr_ext;
 };
 
 #define CEPH_MDS_FLAG_REPLAY		1 /* this is a replayed op */
Signature · 1 line
2.41.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 42 lines · Ilya Dryomov

This reverts commit 3af5ae22030cb59fab4fba35f5a2b62f47e14df9.

ceph_mds_request_args_ext was already (and remains to be) a union. An additional anonymous union inside is bogus:

     union ceph_mds_request_args_ext {
         union {
             union ceph_mds_request_args old;
             struct { ... } __attribute__ ((packed)) setattr_ext;
         };
     }
---
  include/linux/ceph/ceph_fs.h | 24 +++++++++++-------------
  1 file changed, 11 insertions(+), 13 deletions(-)
include/linux/ceph/ceph_fs.h +4 -13
index 5f2301ee88bc..f3b3593254b9 100644
@@ -467,19 +467,17 @@ union ceph_mds_request_args {
  } __attribute__ ((packed));
 
  union ceph_mds_request_args_ext {
-	union {
-		union ceph_mds_request_args old;
-		struct {
-			__le32 mode;
-			__le32 uid;
-			__le32 gid;
-			struct ceph_timespec mtime;
-			struct ceph_timespec atime;
-			__le64 size, old_size;       /* old_size needed by truncate */
-			__le32 mask;                 /* CEPH_SETATTR_* */
-			struct ceph_timespec btime;
-		} __attribute__ ((packed)) setattr_ext;
-	};
+	union ceph_mds_request_args old;
+	struct {
+		__le32 mode;
+		__le32 uid;

include/linux/ceph/ceph_fs.h union ceph_mds_request_args { · line 483

Quoted 10 lines
include/linux/ceph/ceph_fs.h +7 -0
+		__le32 gid;
+		struct ceph_timespec mtime;
+		struct ceph_timespec atime;
+		__le64 size, old_size;       /* old_size needed by truncate */
+		__le32 mask;                 /* CEPH_SETATTR_* */
+		struct ceph_timespec btime;
+	} __attribute__ ((packed)) setattr_ext;
  };
 
  #define CEPH_MDS_FLAG_REPLAY		1 /* this is a replayed op */

Thanks

- Xiubo