[gfs2-utils] branch main updated: gfs2_convert: Clean up
strict-aliasing warnings
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch main
in repository gfs2-utils.
The following commit(s) were added to refs/heads/main by this push:
new c201ceb6 gfs2_convert: Clean up strict-aliasing warnings
c201ceb6 is described below
commit c201ceb6e481d44a25dac44dc61cf8b66d88ac9e
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Mon Mar 20 16:51:08 2023 +0000
gfs2_convert: Clean up strict-aliasing warnings
-Wstrict-aliasing=2 complains about list node casts in gfs2_convert.
They're not really bugs but worthwhile cleanups.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/convert/gfs2_convert.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index f371c435..0b5e2631 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -795,8 +795,7 @@ static int fix_cdpn_symlink(struct lgfs2_sbd *sbp, struct lgfs2_buffer_head *bh,
}
memset(fix, 0, sizeof(struct inode_dir_block));
fix->di_addr = ip->i_num.in_addr;
- osi_list_add_prev((osi_list_t *)&fix->list,
- (osi_list_t *)&cdpns_to_fix);
+ osi_list_add_prev(&fix->list, &cdpns_to_fix.list);
}
return 0;
@@ -878,8 +877,7 @@ static int adjust_inode(struct lgfs2_sbd *sbp, struct lgfs2_buffer_head *bh)
}
memset(fixdir, 0, sizeof(struct inode_block));
fixdir->di_addr = inode->i_num.in_addr;
- osi_list_add_prev((osi_list_t *)&fixdir->list,
- (osi_list_t *)&dirs_to_fix);
+ osi_list_add_prev(&fixdir->list, &dirs_to_fix.list);
break;
case GFS_FILE_REG: /* regular file */
inode->i_mode |= S_IFREG;
@@ -1574,8 +1572,8 @@ static int init(struct lgfs2_sbd *sbp, struct gfs2_options *opts)
perror(opts->device);
exit(-1);
}
- osi_list_init((osi_list_t *)&dirs_to_fix);
- osi_list_init((osi_list_t *)&cdpns_to_fix);
+ osi_list_init(&dirs_to_fix.list);
+ osi_list_init(&cdpns_to_fix.list);
/* ---------------------------------------------- */
/* Initialize lists and read in the superblock. */
/* ---------------------------------------------- */
@@ -2263,7 +2261,7 @@ int main(int argc, char **argv)
if (!error) {
/* Add a string notifying inode converstion start? */
error = inode_renumber(&sb2, sb2.sd_root_dir.in_addr,
- (osi_list_t *)&cdpns_to_fix);
+ &cdpns_to_fix.list);
if (error)
log_crit(_("\n%s: Error renumbering inodes.\n"), opts.device);
fsync(sb2.device_fd); /* write the buffers to disk */
@@ -2272,7 +2270,7 @@ int main(int argc, char **argv)
/* Fix the directories to match the new numbers. */
/* ---------------------------------------------- */
if (!error) {
- error = fix_directory_info(&sb2, (osi_list_t *)&dirs_to_fix);
+ error = fix_directory_info(&sb2, &dirs_to_fix.list);
log_notice(_("\r%"PRIu64" directories, %"PRIu64" dirents fixed."),
dirs_fixed, dirents_fixed);
fflush(stdout);
@@ -2283,7 +2281,7 @@ int main(int argc, char **argv)
/* Convert cdpn symlinks to empty dirs */
/* ---------------------------------------------- */
if (!error) {
- error = fix_cdpn_symlinks(&sb2, (osi_list_t *)&cdpns_to_fix);
+ error = fix_cdpn_symlinks(&sb2, &cdpns_to_fix.list);
log_notice(_("\r%"PRIu64" cdpn symlinks moved to empty directories."),
cdpns_fixed);
fflush(stdout);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
1 year, 1 month