Whamcloud - gitweb
LU-14748 build: gcc9 fix address of packed member warning 61/43961/4
authorShaun Tancheff <shaun.tancheff@hpe.com>
Wed, 9 Jun 2021 16:25:21 +0000 (11:25 -0500)
committerOleg Drokin <green@whamcloud.com>
Tue, 27 Jul 2021 21:37:21 +0000 (21:37 +0000)
gcc9 complains about use of __swabXXs() with some packed
structures.
Use __swabXX() for these cases.

Test-Parameters: trivial
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: I7437c6f21d38c209ef452b41760aad6d1d3d6034
Reviewed-on: https://review.whamcloud.com/43961
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/utils/llog_reader.c

index 0dc8cea..f7aa1d9 100644 (file)
@@ -3417,7 +3417,7 @@ struct object_update_param {
        __u16   oup_padding;
        __u32   oup_padding2;
        char    oup_buf[0];
-};
+} __attribute__((packed));
 
 /* object update */
 struct object_update {
index bb9bec6..c71698c 100644 (file)
@@ -778,9 +778,9 @@ void print_changelog_rec(struct llog_changelog_rec *rec)
 
 static void lustre_swab_lu_fid(struct lu_fid *fid)
 {
-       __swab64s(&fid->f_seq);
-       __swab32s(&fid->f_oid);
-       __swab32s(&fid->f_ver);
+       fid->f_seq = __swab64(fid->f_seq);
+       fid->f_oid = __swab32(fid->f_oid);
+       fid->f_ver = __swab32(fid->f_ver);
 }
 
 static inline size_t
@@ -808,10 +808,10 @@ static void lustre_swab_update_ops(struct update_ops *uops,
 
        for (i = 0; i < op_count; i++, op = update_op_next_op(op)) {
                lustre_swab_lu_fid(&op->uop_fid);
-               __swab16s(&op->uop_type);
-               __swab16s(&op->uop_param_count);
+               op->uop_type = __swab16(op->uop_type);
+               op->uop_param_count = __swab16(op->uop_param_count);
                for (j = 0; j < op->uop_param_count; j++)
-                       __swab16s(&op->uop_params_off[j]);
+                       op->uop_params_off[j] = __swab16(op->uop_params_off[j]);
        }
 }
 static const char *update_op_str(__u16 opc)